stm32 canbus loopback working but normal mode Bit timing Error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-11-07 3:05 AM
hello I today trying can communication loopback mode working but normal mode bit LEC register showing timing error.
Solved! Go to Solution.
- Labels:
-
CAN
-
STM32F4 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-11-07 5:12 AM - edited ‎2023-11-07 5:14 AM
Indeed.. CAN is not UART nor SPI to test it in standalone. In Normal mode you should have at least two nodes on the bus for acknowledgement mechanism and listening of the bus. Otherwise use loopback mode for standalone config.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-11-07 3:15 AM
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-11-07 3:22 AM - edited ‎2023-11-07 3:23 AM
Hello,
- What kind of HW you are using?
- Are you using a CAN transceiver in Normal mode?
- Do you have another CAN node on the bus?
- Are you using HSE or HSI as system clock source?
Also, the values of BS1 and BS2 are not good to me. Please increase BS1 and BS2 as much as possible and decrease the prescaler as much as possible to match your 500kb/s knowing that BS1 must be between 70% and 80% of the bit time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-11-07 3:41 AM - edited ‎2023-11-07 3:42 AM
@Tesla DeLorean : thank you for pointing this thread out.
@Sergen , please don't duplicate a thread on the community.
Now seeing the previous one. I don't have the visibility of all your environment but I have to add:
- Check RS pin of SN65HVD230 transceiver: connect it to GND.
- In normal mode you have to have at least two nodes on the bus.
- The two STM32 (nodes) have to be clocked with HSE with an external crystal not with HSI. The two nodes have to have the exact bitrate.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-11-07 4:13 AM
I checked the RS pin, there was no problem, then I solved the bit timing problem by editing the time segment quanta and prescaler values, but the only thing I'm curious about is that when my device is not connected to any node, something like this picture appears as a frame from my CAN TX output.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-11-07 5:12 AM - edited ‎2023-11-07 5:14 AM
Indeed.. CAN is not UART nor SPI to test it in standalone. In Normal mode you should have at least two nodes on the bus for acknowledgement mechanism and listening of the bus. Otherwise use loopback mode for standalone config.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-11-07 5:17 AM
Thanks your support
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-12-27 1:38 AM
Hi @Sergen @mÆŽALLEm @Tesla DeLorean after using two nodes also i am getting the same waveform.
