-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TWAI is not working for ESP32-S3 #1895
Labels
Comments
A simple test program with transceivers and nothing on the CAN bus yields:
|
I tested the CAN RX on a live bus (1Mbps) with transceiver. I confirmed that RX of the transceiver has continuous data, but a simple test program with no filter receiver nothing on the bus. // The speed of the CAN bus.
const CAN_BAUDRATE: twai::BaudRate = twai::BaudRate::B1000K;
// Begin configuring the TWAI peripheral. The peripheral is in a reset like
// state that prevents transmission but allows configuration.
let mut can_config = twai::TwaiConfiguration::new_async(
peripherals.TWAI0,
can_tx_pin,
can_rx_pin,
&clocks,
CAN_BAUDRATE,
);
let mut can: Twai<_, Async> = can_config.start();
let rx_data = can.receive_async().await;
match rx_data {
Ok(frame) => {
defmt::info!("Received a frame:");
print_frame(&frame);
}
Err(e) => {
defmt::error!("Receive error: {:?}", defmt::Debug2Format(&e));
}
} |
I tried whatever I can to debug this issue, the most like cause is the register blocks are not correctly configured. |
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The TWAI peripheral does not work both with blocking and async mode.
Nothing is transmitted and received, transmitting always "succeed" even without nothing on the bus, which under normal TWAI mode should be a bus error.
The text was updated successfully, but these errors were encountered: