STM32 FDCAN node sees nothing on bus when CAN-to-USB adapter removed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2025-05-29 1:55 PM - last edited on 2025-05-29 1:59 PM by mƎALLEm
Board & Setup:
-
STM32H563RGT6 running FDCAN2 in Normal mode (HAL_FDCAN_Init, Mode=FDCAN_MODE_NORMAL)
-
SN65HVD230 transceiver in silent mode (Rs pin connected to 3.3V) (120 Ω intergrated) wired with a single 120 Ω terminator at the far end
-
No other pull-up/down or termination changes when the USB–CAN dongle is unplugged
-
Filters configured (Reading the data from the BMS of a custom battery):
-
FIFO0 → IDs 0x1E0 (BMS_STATE), 0x1E2 (PACK_MINMAX), 0x1E3 (PACK_AVG)
-
FIFO1 → ID 0x1E1 (PACK_VALUES)
-
Symptom:
-
With the USB–CAN adapter or another node on the bus, everything works: the real BMS sends all four messages, our STM32 ACKs them, and they appear in Cangaroo.
-
As soon as the USB–CAN dongle is unplugged (or if our transceiver is switched to any other mode -> Slope control or High speed (no slope control)), no messages are observed on the bus—even though the BMS should still be broadcasting at 1 Hz (it constantly spits out data at a 1 Hz rate) and our STM32 is in Normal mode.
What I need:
-
Keep the SN65HVD230 in Normal (ACK-capable) mode—tie its RS pin LOW (or drive it low in GPIO init).
-
Still “ignore” any frames I transmit (because I’m not sending any), so that I only see the BMS frames.
How do I ensure my SN65HVD230 is always in normal, ACK-capable mode (so the BMS sees at least one ACK and keeps talking), while my STM32 itself continues to filter out any of its own (non-existent) messages so I only capture IDs 0x1E0–0x1E3?
***My STM32CubeIDE "main.c" is given in attachments.
Solved! Go to Solution.
- Labels:
-
FDCAN
-
STM32H5 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2025-05-30 9:33 AM
Your seg2 is almost the same as seg1. So your sampling point is almost in the middle. You want to sample close to 87% give or take
If the FDCAN clock is 50MHz, then try these values
TimerCallback tutorial! | UART and DMA Idle with multiple UART instances tutorial!
If you find my solution useful, please click the Accept as Solution so others see the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2025-05-30 10:02 AM
I changed to the typedef union which is practical, but does not eliminate the problem of the communication. Also I changed to HSE clock which is 12 MHz in my case so I now have different parameters for the same bitrate (250 kbits/s), but it does not seem to be the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2025-05-30 10:39 AM
Please attach your ioc file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2025-05-30 11:29 AM
I'm using my 12 MHz HSE with these parameters.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2025-05-30 11:30 AM
Here's my .ioc file as of now.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2025-05-30 12:14 PM
If you are using HSE for the FDCAN, do you actually have an external oscillator? If so, what frequency?
TimerCallback tutorial! | UART and DMA Idle with multiple UART instances tutorial!
If you find my solution useful, please click the Accept as Solution so others see the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2025-05-30 12:27 PM - edited 2025-05-30 12:28 PM
Assuming you have an external clock at 12MHz, try the attached IOC changed to use 66MHz and use the values below. I have values for 12MHz as well
Baud 250000 bit/s | |||
FDCAN clock freq(kHz) | seg1 | seg2 | prescaler |
12000 | 39 | 8 | 1 |
66000 | 219 | 44 | 1 |
TimerCallback tutorial! | UART and DMA Idle with multiple UART instances tutorial!
If you find my solution useful, please click the Accept as Solution so others see the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2025-06-02 6:57 AM
The problem was a semi faulty connector. Thanks for all the help, I learned a lot on the way CAN works on STM32.

- « Previous
- Next »