S32K118 calls FLEXCAN_FIFO functions, even though FIFO feature is disabled

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32K118 calls FLEXCAN_FIFO functions, even though FIFO feature is disabled

525 Views
ArushThomas
Contributor II

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

0 Kudos
Reply
3 Replies

477 Views
PetrS
NXP TechSupport
NXP TechSupport

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

0 Kudos
Reply

519 Views
ArushThomas
Contributor II

Screenshot of relevant registers attached

0 Kudos
Reply

524 Views
ArushThomas
Contributor II

Here's screenshots from the debug procedure, by which I came to the conclusion it's crashing in the FlexCAN driver library

0 Kudos
Reply