s32k144:FLEXCAN_IRQHandler issue

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

s32k144:FLEXCAN_IRQHandler issue

Jump to solution
2,457 Views
gumu
Contributor V

Dear Sir,

Recently, on our project, we encountered an issue related to FlexCAN interrupts. Here's a description of the phenomenon:

On CAN instance 2, we have configured 14 message buffers (MBs) for receiving messages. After a period of testing, it was discovered that the entire RTOS task scheduling had become unresponsive.

Through breakpoints, we found that the system was continuously processing the FLEXCAN_IRQHandler. Further debugging revealed that the corresponding message buffer interrupt was active, but the status of the message buffer was FLEXCAN_MB_IDLE. This resulted in the inability of FLEXCAN_IRQHandler to clear the interrupt flag for that specific message buffer, which potentially caused the continuous invocation of FLEXCAN_IRQHandler and prevented the system from handling other interrupts.

Here's an overview of how the message buffers were being used during the issue reproduction:

 
 

ad394996c7c0675e70945908d26720c.png

Could you please provide some debugging suggestions?

Thanks!

 

Tags (1)
0 Kudos
Reply
1 Solution
2,369 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

later SDK versions (from SDK4.0.x) fixed this behavior with possible trapping in ISR loop, as far as I know. Below is code from 4.0.3 version...

PetrS_0-1728373112352.png

So please update to latest SDK.

BR, Petr

View solution in original post

0 Kudos
Reply
3 Replies
2,455 Views
gumu
Contributor V

update SDK version info:

s32k144_sdk 3.0.0

0 Kudos
Reply
2,370 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

later SDK versions (from SDK4.0.x) fixed this behavior with possible trapping in ISR loop, as far as I know. Below is code from 4.0.3 version...

PetrS_0-1728373112352.png

So please update to latest SDK.

BR, Petr

0 Kudos
Reply
2,358 Views
gumu
Contributor V

Hi @PetrS ,

Thank you for your support! I just updated the code and the issue did not reoccur.

 

 

Tags (1)
0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-1968240%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3Es32k144%3AFLEXCAN_IRQHandler%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1968240%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EDear%20Sir%2C%3C%2FP%3E%3CP%3ERecently%2C%20on%20our%20project%2C%20we%20encountered%20an%20issue%20related%20to%20FlexCAN%20interrupts.%20Here's%20a%20description%20of%20the%20phenomenon%3A%3C%2FP%3E%3CP%3EOn%20CAN%20instance%202%2C%20we%20have%20configured%2014%20message%20buffers%20(MBs)%20for%20receiving%20messages.%20After%20a%20period%20of%20testing%2C%20it%20was%20discovered%20that%20the%20entire%20RTOS%20task%20scheduling%20had%20become%20unresponsive.%3C%2FP%3E%3CP%3EThrough%20breakpoints%2C%20we%20found%20that%20the%20system%20was%20continuously%20processing%20the%20FLEXCAN_IRQHandler.%20Further%20debugging%20revealed%20that%20the%20corresponding%20message%20buffer%20interrupt%20was%20active%2C%20but%20the%20status%20of%20the%20message%20buffer%20was%20FLEXCAN_MB_IDLE.%20This%20resulted%20in%20the%20inability%20of%20FLEXCAN_IRQHandler%20to%20clear%20the%20interrupt%20flag%20for%20that%20specific%20message%20buffer%2C%20which%20potentially%20caused%20the%20continuous%20invocation%20of%20FLEXCAN_IRQHandler%20and%20prevented%20the%20system%20from%20handling%20other%20interrupts.%3C%2FP%3E%3CP%3EHere's%20an%20overview%20of%20how%20the%20message%20buffers%20were%20being%20used%20during%20the%20issue%20reproduction%3A%3C%2FP%3E%3CDIV%20class%3D%22%22%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%26nbsp%3B%3C%2FDIV%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ad394996c7c0675e70945908d26720c.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ad394996c7c0675e70945908d26720c.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F303173i870CB412CB6D689B%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22ad394996c7c0675e70945908d26720c.png%22%20alt%3D%22ad394996c7c0675e70945908d26720c.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3ECould%20you%20please%20provide%20some%20debugging%20suggestions%3F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EThanks%EF%BC%81%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1968718%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20s32k144%3AFLEXCAN_IRQHandler%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1968718%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F52961%22%20target%3D%22_blank%22%3E%40PetrS%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%3CP%3E%3CSPAN%3EThank%20you%20for%20your%20support!%20I%20just%20updated%20the%20code%20and%20the%20issue%20did%20not%20reoccur.%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1968661%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20s32k144%3AFLEXCAN_IRQHandler%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1968661%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%0A%3CP%3Elater%20SDK%20versions%20(from%20SDK4.0.x)%20fixed%20this%20behavior%20with%20possible%26nbsp%3Btrapping%20in%20ISR%20loop%2C%20as%20far%20as%20I%20know.%20Below%20is%20code%20from%204.0.3%20version...%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22PetrS_0-1728373112352.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22PetrS_0-1728373112352.png%22%20style%3D%22width%3A%20270px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F303331i540689FD341FA9C7%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22PetrS_0-1728373112352.png%22%20alt%3D%22PetrS_0-1728373112352.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3ESo%20please%20update%20to%20latest%20SDK.%3C%2FP%3E%0A%3CP%3EBR%2C%20Petr%3C%2FP%3E%3C%2FLINGO-BODY%3E