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.
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
2025-05-30 10:02 AM
2025-05-30 10:39 AM
Please attach your ioc file.
2025-05-30 11:29 AM
2025-05-30 11:30 AM
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?
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 |