FDCAN receive errors with STM32G491 on long run.
Hello,
We are experiencing an intermittent CAN-FD issue in our system and would appreciate any advice from the community.
We have developed seven new I/O modules based on the STM32G491VETx with an external 20 MHz crystal.
All have the same CAN configuration using ISO1042BDWVR.
The CANopenNode stack with the CANopenNodeSTM32 driver is implemented on all electronic units.
See https://github.com/CANopenNode/CanOpenSTM32
The CAN bus operates at 250 and 500 kbit. All electronic units occasionally experience the problem that the NodeGuarding or heartbeat (set to 3s!!!) stops responding after 24 hours to 5 days. SDOs do not respond either, whilst TPDOs continue to operate.
We have set up over 10 networks, each with 4 different nodes (all G491), and all exhibit the same behaviour sporadically. We can rule out hardware faults.
The electronic runs for about 48 hours with no Problem on 500k an low bus load (about 2%, Nodeguarding and some TPDO/RPDO).
Suddenly FIXFDCAN RF0 FIFO FULL and RX NEW MESSAGE bit but NO CALLBACK RX
00:39:13:960| ERR: RX NEW MESSAGE: NO CALLBACK RX -> FIXERR: RX NEW MESSAGE: NO CALLBACK RX -> FIXERR: RX NEW MESSAGE: NO CALLBACK RX -> FIXFDCAN RF0 FIFO FULL
00:39:14:961| FDCAN RF0 FIFO FULL
This is in main loop 1s bevor the Nodeguarding (3000 ms runout)
Try to Clear IR Errors ELO, BO, EP, EW, PEA, PED, ARA, MRAF, WDI, TOO, RF0L,RF1L,
00:39:15:477| NMT state; CANnormal; CANerrorStatus; RXF0 fill; RXF0 lost; RXF0 get_idx; RXF0 put_idx; FDCAN IE; FDCAN ILE; FDCAN IR; FDCAN PSR; FDCAN ECR; FIFO FULL
00:39:15:489| 5; 1; 0x0000; 0; 0; 2; 2; 0x006E0289; 0x00000003; 0x00000000; 0x0000070F; 0x00000000; 0
00:39:15:503| 5; 1; 0x0000; 0; 0; 2; 2; 0x006E0289; 0x00000003; 0x00000000; 0x0000070F; 0x00000000; 0
00:39:15:515| 5; 1; 0x0000; 0; 0; 2; 2; 0x006E0289; 0x00000003; 0x00000000; 0x0000070F; 0x00000000; 0
00:39:15:529| 5; 1; 0x0000; 0; 0; 2; 2; 0x006E0289; 0x00000003; 0x00000000; 0x0000070F; 0x00000000; 0
00:39:15:542| 5; 1; 0x0000; 0; 0; 2; 2; 0x006E0289; 0x00000003; 0x00000000; 0x0000070F; 0x00000000; 0
00:39:15:554| 5; 1; 0x0000; 0; 0; 2; 2; 0x006E0289; 0x00000003; 0x00000000; 0x0000070F; 0x00000000; 0
00:39:15:567| 5; 1; 0x0000; 0; 0; 2; 2; 0x006E0289; 0x00000003; 0x00000000; 0x0000070F; 0x00000000; 0
00:39:15:581| 5; 1; 0x0000; 0; 0; 2; 2; 0x006E0289; 0x00000003; 0x00000000; 0x0000070F; 0x00000000; 0
00:39:15:594| 5; 1; 0x0000; 0; 0; 2; 2; 0x006E0289; 0x00000003; 0x00000000; 0x0000070F; 0x00000000; 0
00:39:15:607| 5; 1; 0x0000; 0; 0; 2; 2; 0x006E0289; 0x00000003; 0x00000000; 0x0000070F; 0x00000000; 0
00:39:15:621| ERRORS CLEARD! 5; 1; 0x0000; 0; 0; 2; 2; 0x006E0289; 0x00000003; 0x00000000; 0x0000070F; 0x00000000; 0
00:39:15:634| 5; 1; 0x0000; 0; 0; 2; 2; 0x006E0289; 0x00000003; 0x00000000; 0x0000070F; 0x00000000; 0
00:39:15:648| ERRORS CLEARD! 5; 1; 0x0000; 0; 0; 2; 2; 0x006E0289; 0x00000003; 0x00000000; 0x0000070F; 0x00000000; 0
00:39:15:661| 5; 1; 0x0000; 0; 0; 2; 2; 0x006E0289; 0x00000003; 0x00000000; 0x0000070F; 0x00000000; 0
00:39:15:675| ERRORS CLEARD! 5; 1; 0x0000; 0; 0; 2; 2; 0x006E0289; 0x00000003; 0x00000000; 0x0000070F; 0x00000000; 0
00:39:15:688| 5; 1; 0x0000; 0; 0; 2; 2; 0x006E0289; 0x00000003; 0x00000000; 0x0000070F; 0x00000000; 0
00:39:15:703| ERRORS CLEARD! 5; 1; 0x0000; 0; 0; 2; 2; 0x006E0289; 0x00000003; 0x00000000; 0x0000070F; 0x00000000; 0
00:39:15:717| ERRORS CLEARD! 5; 1; 0x0000; 0; 0; 2; 2; 0x006E0289; 0x00000003; 0x00000000; 0x0000070F; 0x00000000; 0
00:39:15:732| ERRORS CLEARD! 5; 1; 0x0000; 0; 0; 2; 2; 0x006E0289; 0x00000003; 0x00000000; 0x0000070F; 0x00000000; 0
00:39:15:747| ERRORS CLEARD! 5; 1; 0x0000; 0; 0; 2; 2; 0x006E0289; 0x00000003; 0x00000000; 0x0000070F; 0x00000000; 0
00:39:15:762| ERRORS CLEARD! 5; 1; 0x0000; 0; 0; 2; 2; 0x006E0289; 0x00000003; 0x00000000; 0x0000070F; 0x00000000; 0
00:39:15:777| ERRORS CLEARD! 5; 1; 0x0000; 0; 0; 2; 2; 0x006E0289; 0x00000003; 0x00000000; 0x0000070F; 0x00000000; 0
00:39:15:792| ERRORS CLEARD! 5; 1; 0x0000; 0; 0; 2; 2; 0x006E0289; 0x00000003; 0x00000000; 0x0000070F; 0x00000000; 0
00:39:15:807| ERRORS CLEARD! 5; 1; 0x0000; 0; 0; 2; 2; 0x006E0289; 0x00000003; 0x00000000; 0x0000070F; 0x00000000; 0
00:39:15:822| ERRORS CLEARD! 5; 1; 0x0000; 0; 0; 2; 2; 0x006E0289; 0x00000003; 0x00000000; 0x0000070F; 0x00000000; 0
00:39:15:836| ERRORS CLEARD! 5; 1; 0x0000; 0; 0; 2; 2; 0x006E0289; 0x00000003; 0x00000000; 0x0000070F; 0x00000000; 0
00:39:15:850| ERRORS CLEARD! 5; 1; 0x0000; 0; 0; 2; 2; 0x006E0289; 0x00000003; 0x00000000; 0x0000070F; 0x00000000; 0
00:39:15:865| ERRORS CLEARD! 5; 1; 0x0000; 0; 0; 2; 2; 0x006E0289; 0x00000003; 0x00000000; 0x0000070F; 0x00000000; 0
00:39:15:880| ERRORS CLEARD! 5; 1; 0x0000; 0; 0; 2; 2; 0x006E0289; 0x00000003; 0x00000000; 0x0000070F; 0x00000000; 0
00:39:15:895| ERRORS CLEARD! 5; 1; 0x0000; 0; 0; 2; 2; 0x006E0289; 0x00000003; 0x00000000; 0x0000070F; 0x00000000; 0
00:39:15:910| ERRORS CLEARD! 5; 1; 0x0000; 0; 0; 2; 2; 0x006E0289; 0x00000003; 0x00000000; 0x0000070F; 0x00000000; 0
00:39:15:925| ERRORS CLEARD! 5; 1; 0x0000; 0; 0; 2; 2; 0x006E0289; 0x00000003; 0x00000000; 0x0000070F; 0x00000000; 0
00:39:15:940| ERRORS CLEARD! 5; 1; 0x0000; 0; 0; 2; 2; 0x006E0289; 0x00000003; 0x00000000; 0x0000070F; 0x00000000; 0
00:39:15:955| ERRORS CLEARD! 5; 1; 0x0000; 0; 0; 2; 2; 0x006E0289; 0x00000003; 0x00000000; 0x0000070F; 0x00000000; 0
00:39:15:971| ERRORS CLEARD! 5; 1; 0x0000; 0; 0; 2; 2; 0x006E0289; 0x00000003; 0x00000000; 0x0000070F; 0x00000000; 0
00:39:15:974| FDCAN RF0 FIFO FULL
00:39:15:988| ERRORS CLEARD! 5; 1; 0x0000; 0; 0; 1; 1; 0x006E0289; 0x00000003; 0x00000000; 0x0000070F; 0x00000000; 0
00:39:16:540| BO; EP; WARN; TEC; REC; LEC; Err; ACK; BIT; CRC; STF; FRM; CO_ErrorRegister; FDCAM!.IR
00:39:16:548| 0; 0; 0; 0; 0; 0; 2; 2; 0; 0; 0; 0; 0x10; 0x00000000
07:18:26:325| ERR: RX NEW MESSAGE: NO CALLBACK RX -> FIXBO; EP; WARN; TEC; REC; LEC; Err total; ACK; BIT; CRC; STF; FRM; CO_ErrorRegister; FDCAM!.IR
07:18:26:333| 0; 0; 0; 0; 0; 0; 2; 2; 0; 0; 0; 0; 0x10; 0x00000000
07:18:27:355| BO; EP; WARN; TEC; REC; LEC; Err total; ACK; BIT; CRC; STF; FRM; CO_ErrorRegister; FDCAM!.IR
07:18:27:363| 0; 0; 0; 0; 0; 0; 2; 2; 0; 0; 0; 0; 0x10; 0x00000000
Our interpretation:
What definitely does NOT happen: The CAN bus itself has no problem:
CANnormal = 1
CANerrorStatus = 0x0000
PSR = 0x0000070F
ECR = 0x00000000
BO = 0
EP = 0
WARN = 0
TEC = 0
REC = 0
So:
✅ no bus-off
✅ no passive error
✅ no warning error
✅ no ACK errors on the bus
✅ no bit, CRC, stuff or form errors
The CAN controller considers the bus to be completely healthy.
What happens?
Firstly: ERR: RX NEW MESSAGE: NO CALLBACK RX, multiple times.
This means: RF0N = set but RX callback is not running
Then: FDCAN RF0 FIFO FULL, shoud never happen, due to read out FIFO completly in RX callback.
Sequence:
Message arrives
↓ RF0N is set
↓ ISR is not running
↓ FIFO is not emptied
↓ further messages
↓ FIFO full
↓ RF0F
What’s particularly interesting is that just 500 ms later in the log:
RXF0 fill = 0
RXF0 lost = 0
get_idx = 2
put_idx = 2
and: IR = 0
This means:
FIFO empty
no lost messages
no pending interrupt
So the recovery apparently worked.
FGI == FPI means: FIFO empty
So the FIFO is not stuck.
Even more importantly: Only RF0F but never RF0L
i.e. FIFO FULL but no MESSAGE LOST: The fault was detected before any telegrams were actually lost.
The error counters
Later:
Err total = 2
ACK = 2
so:
2 ACK errors
but at the same time:
TEC = 0
REC = 0
BO = 0
EP = 0
These are presumably historical CANopen counters.
They are not related to the RF0N problem.
The most striking thing. The same error reappears:
00:39:13... ERR: RX NEW MESSAGE: NO CALLBACK RX
and later:
07:18:26 ERR: RX NEW MESSAGE: NO CALLBACK RX
Almost 7 hours later.
So, not a sporadic bus error, not a start-up problem, not a one-off overflow, but a recurring condition.
Assessment
Very high probability:
The FDCAN is receiving correctly,
RF0N is set, the message is in the FIFO, but the interrupt path is not being processed at times:
ISR is not running
Probability: medium:
Interrupts are being temporarily blocked somewhere:
C__disable_irq() or CBASEPRI ≠ 0 and not reset properly.
That is precisely why your new log shows:
Probability: low:
Fault in the CAN bus.
There are no signs of this: TEC, REC, BO, EP, WARN, CRC, BIT and FORM are all 0.
From the current log, it looks to me as though it is not the CAN controller that is hanging, but rather that the FDCAN interrupt is occasionally not being processed, even though messages are being received correctly.
Here ist the HAL_FDCAN_RxFifo0Callback code, it puts the message in a SW FIFO :
volatile uint32_t isrFifo0Cnt = 0;
void FDCAN_GetMessageFIFO0(void){
isrFifo0Cnt++;
FDCAN_HandleTypeDef *hfdcan =
((CANopenNodeSTM32*) CANModule_local->CANptr)->CANHandle;
/* ✅ HW FIFO komplett leerziehen */
while (HAL_FDCAN_GetRxFifoFillLevel(hfdcan, FDCAN_RX_FIFO0) > 0)
{
FDCAN_RxHeaderTypeDef rx_hdr;
uint32_t tmpData[2]; // ✅ aligned buffer
CO_CANrxMsg_t rcvMsg = {0}; // ✅ wichtig: jedes Frame neu!
/* ✅ Nachricht lesen (immer FIFO0!) */
if (HAL_FDCAN_GetRxMessage(hfdcan, FDCAN_RX_FIFO0, &rx_hdr, (uint8_t*)tmpData) != HAL_OK){
return;
}
/* ✅ Identifier korrekt (11-bit!) */
rcvMsg.ident =
(rx_hdr.Identifier & CANID_MASK) |
(rx_hdr.RxFrameType == FDCAN_REMOTE_FRAME ? FLAG_RTR : 0);
/* DLC */
switch (rx_hdr.DataLength) {
case FDCAN_DLC_BYTES_0: rcvMsg.dlc = 0; break;
case FDCAN_DLC_BYTES_1: rcvMsg.dlc = 1; break;
case FDCAN_DLC_BYTES_2: rcvMsg.dlc = 2; break;
case FDCAN_DLC_BYTES_3: rcvMsg.dlc = 3; break;
case FDCAN_DLC_BYTES_4: rcvMsg.dlc = 4; break;
case FDCAN_DLC_BYTES_5: rcvMsg.dlc = 5; break;
case FDCAN_DLC_BYTES_6: rcvMsg.dlc = 6; break;
case FDCAN_DLC_BYTES_7: rcvMsg.dlc = 7; break;
case FDCAN_DLC_BYTES_8: rcvMsg.dlc = 8; break;
default: rcvMsg.dlc = 0; break;
}
/* ✅ DATA IMMER ALS LETZTES kopieren! */
memcpy(rcvMsg.data, tmpData, 8);
/* ✅ nur gültige Frames reinlassen */
if ((rcvMsg.ident & ~(CANID_MASK | FLAG_RTR)) == 0 && rcvMsg.dlc <= 8){
rb_push(&rcvMsg);
}
}
}Hardware

Clocks




We’re just about to start mass production and urgently need help. Any idea what might be causing this?
What tests could we carry out to get closer to identifying the cause?
