2025-08-22 12:28 PM
I'm experiencing FDCAN Memory Access Failures on the STM32H503KBUX during CAN Rx.
I am also experiencing intermittent CAN Rx message drops (every 1 in a 200), and I believe the two are related since no others errors are firing. I know the drops are happening on the STM32 because I can see the messages on the bus with my CAN debugger and there are no error frames.
I'm struggling to understand why this Memory access error is happening and how to proceed with solving it. The only info I can find is in rm0492. However, it doesnt really say what might cause these events to happen.
Other relevant info:
- Using internal clock
- Freertos
- Using to `HAL_FDCAN_RxFifo0Callback` to read from FIFO
- Config
hfdcan1.Instance = FDCAN1;
hfdcan1.Init.ClockDivider = FDCAN_CLOCK_DIV1;
hfdcan1.Init.FrameFormat = FDCAN_FRAME_CLASSIC;
hfdcan1.Init.Mode = FDCAN_MODE_NORMAL;
hfdcan1.Init.AutoRetransmission = ENABLE;
hfdcan1.Init.TransmitPause = ENABLE;
hfdcan1.Init.ProtocolException = ENABLE;
hfdcan1.Init.NominalPrescaler = 16;
hfdcan1.Init.NominalSyncJumpWidth = 128;
hfdcan1.Init.NominalTimeSeg1 = 13;
hfdcan1.Init.NominalTimeSeg2 = 2;
hfdcan1.Init.DataPrescaler = 1;
hfdcan1.Init.DataSyncJumpWidth = 16;
hfdcan1.Init.DataTimeSeg1 = 1;
hfdcan1.Init.DataTimeSeg2 = 1;
hfdcan1.Init.StdFiltersNbr = 1;
hfdcan1.Init.ExtFiltersNbr = 1;
hfdcan1.Init.TxFifoQueueMode = FDCAN_TX_FIFO_OPERATION;
- Using a filter
void can_setupFilter(void) {
FDCAN_FilterTypeDef sFilterConfig;
sFilterConfig.IdType = FDCAN_EXTENDED_ID;
sFilterConfig.FilterIndex = 0;
sFilterConfig.FilterType = FDCAN_FILTER_RANGE;
sFilterConfig.FilterConfig = FDCAN_FILTER_TO_RXFIFO0;
sFilterConfig.FilterID1 = 0;
sFilterConfig.FilterID2 = 0x1FFFFFFF;
if (HAL_FDCAN_ConfigFilter(canPtr, &sFilterConfig) != HAL_OK) {
Error_Handler();
}
}
Happy to share additional details upon request.
Any ideas on how to debug or fix this issue?
Best,
Daniel