S32K118 calls FLEXCAN_FIFO functions, even though FIFO feature is disabled
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
I am interfacing with a CAN bus, using the S32K118 microcontroller. I'm using the can_pal, and have installed Rx and Tx callbacks with the CAN_InstallEventCallback() function.
on Rx Interrupt, I am enqueueing the received message to a Queue, for future parsing. To transmit, I enqueue my messages to a different queue, and send from the queue on a Tx Interrupt.
This system works exactly as expected for extended periods of time, despite disturbances on the bus, excess spam, etc. However, the system does crash on occasion, entering a HardFault_Handler.
Using debugger features and following the method specified here I observe that the code crashes in the FLEXCAN_IRQHandler, or the FLEXCAN_RxFIFO_Handler I don't understand why it might crash here, considering the FIFO feature is not enabled.
I'm attaching screenshots of the CAN0 register values at the time of the crash. Please do help in solving this problem


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
this looks weird, if FREN is 0 then code would not go to that line to call FLEXCAN_RxFIFO_Handler as FLEXCAN_IsRxFifoEnabled is checking this bit..
Try to step through the interrupt routine subroutines to check it in deep.
Check if there is no memory/stack overflow or things like that.
BR, Petr
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Screenshot of relevant registers attached
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here's screenshots from the debug procedure, by which I came to the conclusion it's crashing in the FlexCAN driver library
