Can_Init failed on S32K344 when can bus is not idle

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

Can_Init failed on S32K344 when can bus is not idle

Jump to solution
571 Views
LewisThin
Contributor III

hello experts,

i met an issue of Can_Init on my S32K344 ecu.

the RTD is 2.0 ,but the code of FlexCAN_EnterFreezeMode is the same as the one in RTD 6.0

the issue is, the FRZACK bit can not be 1 when FRZ and HALT became 1, which lead to the can_init call failed. 

LewisThin_0-1763013051390.png

 

the problem is very simple to reissue by following the next steps:

1. in normal commication state, sending 3 canfd frames(64 bytes) to the ecu every 5ms using the tester and there is no other can node on the can bus;

2.reset the ecu by calling Mcu_PerformReset. do not stop the canfd fames, due to the reset process makes the s32k3 CANnode disabled, the can tester will rise can error  frame, which makes the can tester re-send the frames in very high frequecy.

3.when the mcu reset, it executes the Can_Init process, at this time, the can bus is very likely in the busy state, which may lead the Can_Init failed.

4.repeat 1~3 until the Can_Init call is in fail.

5.if failed, re-calling Can_Init can not work withou reset

6.if failed, stop sending the canfd frames, and the re-calling Can_Init can not work withou reset either;

LewisThin_1-1763013572396.png

can any body give me some advice?

 

thanks.

 

Tags (2)
0 Kudos
Reply
1 Solution
469 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @LewisThin

Thank you for the additional info. 

Just to make sure the issue is not related to the frame reception, have you tested this same routine, but stopping the frames when issuing a 11 01 to reset?

When failing the initialization, instead of calling Can_Init() again, can you try asserting a soft reset through MCR.SOFTRST? This should have the same effect as a chip-level soft reset.

Best regards,
Julián

View solution in original post

0 Kudos
Reply
5 Replies
532 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @LewisThin,

If I understand correctly, you are using RTD 2.0.0 and only receiving frames for now, correct? 

I made a simple test with S32K344EVB-T172 by sending some frames with a PCAN-USB every 5ms, however I could not replicate your issue.

Which transceiver are you using? You can try to keep it out of the arbitration process by setting it to standby or listen-only and enabling it after setting the controller to START.

Best regards,
Julián

0 Kudos
Reply
502 Views
LewisThin
Contributor III

hi, Julián_AragónM

thanks for your replay.

in fact, this is an UDS durability test. i can reissue the problem stablely in about 800~1000 reset tests.

the tester send 3 canfd frames (the data fileds are all 0)cyclicly and then send  10 02 to enter bootloader and send 11 01 to perform reset and go back applicaiton.

as you mentioned, i have changed the transceiver to offline mode before calling Can_Init but the problem exsited still. maybe the problem is not caused by the busy can bus.

do you have any other advice?

Best regards

Tags (2)
0 Kudos
Reply
470 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @LewisThin

Thank you for the additional info. 

Just to make sure the issue is not related to the frame reception, have you tested this same routine, but stopping the frames when issuing a 11 01 to reset?

When failing the initialization, instead of calling Can_Init() again, can you try asserting a soft reset through MCR.SOFTRST? This should have the same effect as a chip-level soft reset.

Best regards,
Julián

0 Kudos
Reply
258 Views
LewisThin
Contributor III
hi, Julián_AragónM
thanks for your help. i use MCR.SOFTRST to reset can before calling Can_Init and it works. I think it is better to add the operation in the RTD code
Best regards
0 Kudos
Reply
342 Views
LewisThin
Contributor III

hi, Julián_AragónM,

i made a mistake, the transciever is NXP TJA 1145. the TJA1145 can not enter offline mode when the  CAN bus is busy, so the config was not work, the transceiver is in operation mode still.

LewisThin_2-1763349397881.png

 

i have tested for about ten thousand times for reset without canfd frames reception, the ECU can work normally and can_init performs as expected.

the can soft reset operation by SOFTRST bit  is done in FlexCan_Init, this does nothing for the issue.  

LewisThin_1-1763349158462.png

 

LewisThin_0-1763349070799.png

i tried to call mcu_performreset when can_init failed and test reset with canfd frames reception for ten thousand times, the ECU can work normally.

LewisThin_3-1763349638011.png

based on the information above, i could confirm that the issue is cause by can frame reception during can_init.

also, I have compared the codes of RTD6.0 and RTD2.0 and no specical changes found for the Can_Init operation.

do you have any other advice?

Best regards

 

 

Tags (2)
0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2204155%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ECan_Init%20failed%20on%20S32K344%20when%20can%20bus%20is%20not%20idle%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2204155%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3Ehello%20experts%2C%3C%2FP%3E%3CP%3Ei%20met%20an%20issue%20of%20Can_Init%20on%20my%20S32K344%20ecu.%3C%2FP%3E%3CP%3Ethe%20RTD%20is%202.0%20%2Cbut%20the%20code%20of%26nbsp%3BFlexCAN_EnterFreezeMode%20is%20the%20same%20as%20the%20one%20in%20RTD%206.0%3C%2FP%3E%3CP%3Ethe%20issue%20is%2C%20the%26nbsp%3BFRZACK%20bit%20can%20not%20be%201%20when%26nbsp%3BFRZ%20and%26nbsp%3BHALT%20became%201%2C%20which%20lead%20to%20the%20can_init%20call%20failed.%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22LewisThin_0-1763013051390.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22LewisThin_0-1763013051390.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F365425iD78249400FE8A8BA%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22LewisThin_0-1763013051390.png%22%20alt%3D%22LewisThin_0-1763013051390.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3Ethe%20problem%20is%20very%20simple%20to%20reissue%20by%20following%20the%20next%20steps%3A%3C%2FP%3E%3CP%3E1.%20in%20normal%20commication%20state%2C%20sending%203%20canfd%20frames(64%20bytes)%20to%20the%20ecu%20every%205ms%20using%20the%20tester%20and%20there%20is%20no%20other%20can%20node%20on%20the%20can%20bus%3B%3C%2FP%3E%3CP%3E2.reset%20the%20ecu%20by%20calling%20Mcu_PerformReset.%20do%20not%20stop%20the%20canfd%20fames%2C%20due%20to%20the%20reset%20process%20makes%20the%20s32k3%20CANnode%20disabled%2C%20the%20can%20tester%20will%20rise%20can%20error%26nbsp%3B%20frame%2C%20which%20makes%20the%20can%20tester%20re-send%20the%20frames%20in%20very%20high%20frequecy.%3C%2FP%3E%3CP%3E3.when%20the%20mcu%20reset%2C%20it%20executes%20the%20Can_Init%20process%2C%20at%20this%20time%2C%20the%20can%20bus%20is%20very%20likely%20in%20the%20busy%20state%2C%20which%20may%20lead%20the%20Can_Init%20failed.%3C%2FP%3E%3CP%3E4.repeat%201~3%20until%20the%20Can_Init%20call%20is%20in%20fail.%3C%2FP%3E%3CP%3E5.if%20failed%2C%20re-calling%20Can_Init%20can%20not%20work%20withou%20reset%3C%2FP%3E%3CP%3E6.if%20failed%2C%20stop%20sending%20the%20canfd%20frames%2C%20and%20the%20re-calling%20Can_Init%20can%20not%20work%20withou%20reset%20either%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22LewisThin_1-1763013572396.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22LewisThin_1-1763013572396.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F365429i7305F8F087A95F81%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22LewisThin_1-1763013572396.png%22%20alt%3D%22LewisThin_1-1763013572396.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3Ecan%20any%20body%20give%20me%20some%20advice%3F%3C%2FP%3E%3CBR%20%2F%3E%3CP%3Ethanks.%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2205737%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Can_Init%20failed%20on%20S32K344%20when%20can%20bus%20is%20not%20idle%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2205737%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3Ehi%2C%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F200831%22%20target%3D%22_self%22%3E%3CSPAN%20class%3D%22%22%3EJuli%C3%A1n_Arag%C3%B3nM%3C%2FSPAN%3E%3C%2FA%3E%2C%3C%2FP%3E%3CP%3Ei%20made%20a%20mistake%2C%20the%20transciever%20is%20NXP%20TJA%201145.%20the%20TJA1145%20can%20not%20enter%20offline%20mode%20when%20the%26nbsp%3B%20CAN%20bus%20is%20busy%2C%20so%20the%20config%20was%20not%20work%2C%20the%20transceiver%20is%20in%20operation%20mode%20still.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22LewisThin_2-1763349397881.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22LewisThin_2-1763349397881.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F365806iF8B60B60039F391B%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22LewisThin_2-1763349397881.png%22%20alt%3D%22LewisThin_2-1763349397881.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3Ei%20have%20tested%20for%20about%20ten%20thousand%20times%20for%20reset%20without%20canfd%20frames%20reception%2C%20the%20ECU%20can%20work%20normally%20and%20can_init%20performs%20as%20expected.%3C%2FP%3E%3CP%3Ethe%20can%20soft%20reset%20operation%20by%26nbsp%3B%3CSPAN%3ESOFTRST%20bit%26nbsp%3B%3C%2FSPAN%3E%20is%20done%20in%20FlexCan_Init%2C%20this%20does%20nothing%20for%20the%20issue.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22LewisThin_1-1763349158462.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22LewisThin_1-1763349158462.png%22%20style%3D%22width%3A%20399px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F365805i2E0661673D275CED%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22LewisThin_1-1763349158462.png%22%20alt%3D%22LewisThin_1-1763349158462.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22LewisThin_0-1763349070799.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22LewisThin_0-1763349070799.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F365803iBAD73D273CB01088%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22LewisThin_0-1763349070799.png%22%20alt%3D%22LewisThin_0-1763349070799.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3Ei%20tried%20to%20call%20mcu_performreset%20when%20can_init%20failed%20and%20test%20reset%20with%20canfd%20frames%20reception%20for%20ten%20thousand%20times%2C%20the%20ECU%20can%20work%20normally.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22LewisThin_3-1763349638011.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22LewisThin_3-1763349638011.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F365807i12F9D51658BCAB66%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22LewisThin_3-1763349638011.png%22%20alt%3D%22LewisThin_3-1763349638011.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3Ebased%20on%20the%20information%20above%2C%20i%20could%20confirm%20that%20the%20issue%20is%20cause%20by%20can%20frame%20reception%20during%20can_init.%3C%2FP%3E%3CP%3Ealso%2C%20I%20have%20compared%20the%20codes%20of%20RTD6.0%20and%20RTD2.0%20and%20no%20specical%20changes%20found%20for%20the%20Can_Init%20operation.%3C%2FP%3E%3CP%3Edo%20you%20have%20any%20other%20advice%3F%3C%2FP%3E%3CP%3E%3CSPAN%3EBest%20regards%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2205454%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Can_Init%20failed%20on%20S32K344%20when%20can%20bus%20is%20not%20idle%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2205454%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%2F210005%22%20target%3D%22_blank%22%3E%40LewisThin%3C%2FA%3E%3C%2FP%3E%0A%3CP%3EThank%20you%20for%20the%20additional%20info.%26nbsp%3B%3C%2FP%3E%0A%3CP%3EJust%20to%20make%20sure%20the%20issue%20is%20not%20related%20to%20the%20frame%20reception%2C%20have%20you%20tested%20this%20same%20routine%2C%20but%20stopping%20the%20frames%20when%20issuing%20a%2011%2001%20to%20reset%3F%3C%2FP%3E%0A%3CP%3EWhen%20failing%20the%20initialization%2C%20instead%20of%20calling%20Can_Init()%20again%2C%20can%20you%20try%20asserting%20a%20soft%20reset%20through%20MCR.SOFTRST%3F%20This%20should%20have%20the%20same%20effect%20as%20a%20chip-level%20soft%20reset.%3C%2FP%3E%0A%3CP%3EBest%20regards%2C%3CBR%20%2F%3EJuli%C3%A1n%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2204861%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Can_Init%20failed%20on%20S32K344%20when%20can%20bus%20is%20not%20idle%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2204861%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3Ehi%2C%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F200831%22%20target%3D%22_self%22%3E%3CSPAN%20class%3D%22%22%3EJuli%C3%A1n_Arag%C3%B3nM%3C%2FSPAN%3E%3C%2FA%3E%3C%2FP%3E%3CP%3Ethanks%20for%20your%20replay.%3C%2FP%3E%3CP%3Ein%20fact%2C%20this%20is%20an%20UDS%20durability%20test.%20i%20can%20reissue%20the%20problem%20stablely%20in%20about%20800~1000%20reset%20tests.%3C%2FP%3E%3CP%3Ethe%20tester%20send%203%20canfd%20frames%20(the%20data%20fileds%20are%20all%200)cyclicly%20and%20then%20send%26nbsp%3B%2010%2002%20to%20enter%20bootloader%20and%20send%2011%2001%20to%20perform%20reset%20and%20go%20back%20applicaiton.%3C%2FP%3E%3CP%3Eas%20you%20mentioned%2C%20i%20have%20changed%20the%20transceiver%20to%20offline%20mode%20before%20calling%20Can_Init%20but%20the%20problem%20exsited%20still.%20maybe%20the%20problem%20is%20not%20caused%20by%20the%20busy%20can%20bus.%3C%2FP%3E%3CP%3Edo%20you%20have%20any%20other%20advice%3F%3C%2FP%3E%3CP%3E%3CSPAN%3EBest%20regards%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2204687%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Can_Init%20failed%20on%20S32K344%20when%20can%20bus%20is%20not%20idle%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2204687%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%2F210005%22%20target%3D%22_blank%22%3E%40LewisThin%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3EIf%20I%20understand%20correctly%2C%20you%20are%20using%20RTD%202.0.0%20and%20only%20receiving%20frames%20for%20now%2C%20correct%3F%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20made%20a%20simple%20test%20with%20S32K344EVB-T172%20by%20sending%20some%20frames%20with%20a%20PCAN-USB%20every%205ms%2C%20however%20I%20could%20not%20replicate%20your%20issue.%3C%2FP%3E%0A%3CP%3EWhich%20transceiver%20are%20you%20using%3F%20You%20can%20try%20to%20keep%20it%20out%20of%20the%20arbitration%20process%20by%20setting%20it%20to%20standby%20or%20listen-only%20and%20enabling%20it%20after%20setting%20the%20controller%20to%20START.%3C%2FP%3E%0A%3CP%3EBest%20regards%2C%3CBR%20%2F%3EJuli%C3%A1n%3C%2FP%3E%3C%2FLINGO-BODY%3E