STM32G474 FDCAN TX buffer cancellation finish IRQ does not trigger
Hello Everyone
I am struggling to get STM32G474 FDCAN working, especially error handling.
Normal transmission works fine. I use TXQueue (not TXFifo) mode. I can write messages to each of the 3 message buffers. Messages are sent, I get a Transmit Occured Interrupt, I know that the message is successfully sent. All fine.
If I disconnect the bus (no peer) messages are not acknowledged by another CAN node, the message is NOT sent properly (all fine).
I am working in "auto Retransmission = disable) (DAR) mode.
When I put a message into a tx buffer, the message is sent with an error and disappears from that txbuffer
There are two registers:
FDCAN_TXBRP (transmit buffer request pending)
FXCAN_TXBCF (cancellation finished)
I can see FDCAN_TXBRP [TRP] is cleared (because the message no longer pending, because it was faulty, and no retry -> done sending, but faulty, transmit request is cleared)
I can see FDCAN_TXBCF[CF] is set (!) Transmit cancellation is finished. Obviously the hardware has canceled the faulty transmission and has set TXBCF.
I have FDCAN_ID [TCFE] (Transmit Cancellation finish interrupt enable) enabled
This interrupt never triggers despite the fact, that FDCAN_TXBCF is set
How to reproduce this:
- enable FDCAN
- use DAR (auto retransmission disable)
- use TXQUEUE mode (not TX Fifo)
- enable FDCAN_IE[TCFE] transmit cancel finish interrupt enable
- enable FDCAN_TXBCIE transmit cancellation finished interrupt enable register for each transmit buffer
- use an open CAN-Bus (no peer)
- try to send messages by copying them into the message buffer
- add a transmission request by setting the appropriate bit in FDCAN_TXBAR
- observe FDCAN_TXBRP, see that the request pending bit is 1 and then switches to 0
- observe FDCAN_TXBCF, see that transmit cancellation finish bit is set
- IRQ never triggered.
Have anyone experienced the same? Is there no way to get an IRQ on a message which are not sent becaue of errors and automatically disappear from the TXBuffer?
At the moment I only get IRQs on successful message sent, but not on failed tx attempts.
Johannes
