I'm trying without success to perform CAN bus communication between an microcontroller and the host (my computer). My question does not depend on the microcontroller, but on the CAN Bus (classic CAN).
My application tries to send a frame each (5 ms, 10 ms, 100 ms). I have a simple scheduler that execute tasks where I call the function can_write(HwObject,Frame) to write the frame to the bus.
However, the first frame returns OK and it's received at the host, but after that (and for all the following frames) the function returns busy, and I keep seeing the error counter increasing without any frame arriving at the host. Finally the node seems to go into bus off mode.
I want to know what are the main reasons for that: I'm using the same baudrate, 1 Mbit/s, on both sides, but I also tried different ones, but without success to see any results. I have looked around registers to see what could be the issue. For example I get:
- The bus detects a transmit abort request.
- The channel enters to halt mode after bus off.
- The bus is in passive mode.
- A channel bus error is detected.
- Error warning is detected.
- Overload is detected.
- A bit stuff error is detected.
PSS: I'm following the AUTOSAR Standard: The CAN specification can be found at: https://www.scribd.com/document/160011317/Autosar-Sws-Candriver
But I can't find what causes this issue. I think it is due to bad synchronization!