CAN is busy when transmit

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

CAN is busy when transmit

Jump to solution
1,960 Views
Johnson97
Contributor II

Hi NXP Community,

I redirected the CanIf_RxIndication function. When setting the CAN module to the loopback mode, the test was successful and the transmitted and received data were consistent.

However, when I exited the loopback mode, I was unable to send the message and the Can_43_FLEXCAN_Write function returned 0x02 (busy).

The tx pin of the MCU was synchronized with the rx pin data and was not the expected data to be sent. The rx data was approximately 130ns slower than the tx data and was continuously occurring (it should send one frame roughly every second).

The transceiver is TJA1043. I have set the STB and EN pins to high. CANH and CANL have remained unchanged.

The following is the information of the ESR register. Please help to troubleshoot what the possible cause might be.

Thank you very much!

Johnson97_2-1767016016038.png

Johnson97_3-1767016132618.png

 

 

Tags (3)
0 Kudos
Reply
1 Solution
1,893 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@Johnson97

In the project you provided, your clock configuration is completely wrong.

Your FXOSC clock is 20MHz

Senlent_0-1767076783748.png

The MFI your setting is 120,ODIV2 is 4, which is out of range of PLL VCO output  frequency(240)

Senlent_3-1767076930306.png

Senlent_2-1767076869206.png

 You must follow the requirement in the reference manual:

Senlent_4-1767077918366.png

for your reference:

Senlent_5-1767077948858.pngSenlent_6-1767077983979.pngSenlent_7-1767078011090.png

Finally, don't forget to reconfigure FlexCan's baudrate settings.

 

 

View solution in original post

0 Kudos
Reply
6 Replies
1,894 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@Johnson97

In the project you provided, your clock configuration is completely wrong.

Your FXOSC clock is 20MHz

Senlent_0-1767076783748.png

The MFI your setting is 120,ODIV2 is 4, which is out of range of PLL VCO output  frequency(240)

Senlent_3-1767076930306.png

Senlent_2-1767076869206.png

 You must follow the requirement in the reference manual:

Senlent_4-1767077918366.png

for your reference:

Senlent_5-1767077948858.pngSenlent_6-1767077983979.pngSenlent_7-1767078011090.png

Finally, don't forget to reconfigure FlexCan's baudrate settings.

 

 

0 Kudos
Reply
1,868 Views
Johnson97
Contributor II

Thank you very much. The problem has been solved.

Apart from the aforementioned issues, the configuration of the CAN baud rate-related registers also does not match the valid values specified in the manual.

The waveform of the tx pin of the MCU has met the expectations. The subsequent issues should be related to the transceiver.

Thank you again!

0 Kudos
Reply
1,916 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@Johnson97

Please share your project, and I will take some time to review it for you.

0 Kudos
Reply
1,908 Views
Johnson97
Contributor II

Please check the attached file.The version of the RTD package is SW32K3_S32M27x_RTD_R21-11_4.0.0_P19_D2403

0 Kudos
Reply
1,903 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@Johnson97

Could you update your RTD to a newer version, or modify a test routine on your S32 DS so I can check it for you? (I haven't installed that RTD version yet.)

0 Kudos
Reply
1,900 Views
Johnson97
Contributor II

Sorry, the Autosar package purchased for this project has specified the use of this version of RTD.

Therefore, I need to configure the mcal based on this version and verify that it is error-free.

Could you install this version and help me troubleshoot the issue?

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2269676%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ECAN%20is%20busy%20when%20transmit%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2269676%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20NXP%20Community%2C%3C%2FP%3E%3CP%3EI%20redirected%20the%20CanIf_RxIndication%20function.%20When%20setting%20the%20CAN%20module%20to%20the%20loopback%20mode%2C%20the%20test%20was%20successful%20and%20the%20transmitted%20and%20received%20data%20were%20consistent.%3C%2FP%3E%3CP%3EHowever%2C%20when%20I%20exited%20the%20loopback%20mode%2C%20I%20was%20unable%20to%20send%20the%20message%20and%20the%20Can_43_FLEXCAN_Write%20function%20returned%200x02%20(busy).%3C%2FP%3E%3CP%3EThe%20tx%20pin%20of%20the%20MCU%20was%20synchronized%20with%20the%20rx%20pin%20data%20and%20was%20not%20the%20expected%20data%20to%20be%20sent.%20The%20rx%20data%20was%20approximately%20130ns%20slower%20than%20the%20tx%20data%20and%20was%20continuously%20occurring%20(it%20should%20send%20one%20frame%20roughly%20every%20second).%3C%2FP%3E%3CP%3EThe%20transceiver%20is%20TJA1043.%20I%20have%20set%20the%20STB%20and%20EN%20pins%20to%20high.%20CANH%20and%20CANL%20have%20remained%20unchanged.%3C%2FP%3E%3CP%3EThe%20following%20is%20the%20information%20of%20the%20ESR%20register.%20Please%20help%20to%20troubleshoot%20what%20the%20possible%20cause%20might%20be.%3C%2FP%3E%3CP%3EThank%20you%20very%20much!%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Johnson97_2-1767016016038.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Johnson97_2-1767016016038.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Johnson97_2-1767016016038.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F371347i11D6A65898D59374%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Johnson97_2-1767016016038.png%22%20alt%3D%22Johnson97_2-1767016016038.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Johnson97_3-1767016132618.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Johnson97_3-1767016132618.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Johnson97_3-1767016132618.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F371348i78A4A78FBF2DB539%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Johnson97_3-1767016132618.png%22%20alt%3D%22Johnson97_3-1767016132618.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2269871%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20CAN%20is%20busy%20when%20transmit%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2269871%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%40%3CSPAN%3EJohnson97%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EIn%20the%20project%20you%20provided%2C%20your%20clock%20configuration%20is%20completely%20wrong.%3C%2FP%3E%0A%3CP%3EYour%20FXOSC%20clock%20is%2020MHz%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Senlent_0-1767076783748.png%22%20style%3D%22width%3A%20694px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Senlent_0-1767076783748.png%22%20style%3D%22width%3A%20694px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Senlent_0-1767076783748.png%22%20style%3D%22width%3A%20694px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F371380i7FA9971F6F6337E3%2Fimage-dimensions%2F694x366%3Fv%3Dv2%22%20width%3D%22694%22%20height%3D%22366%22%20role%3D%22button%22%20title%3D%22Senlent_0-1767076783748.png%22%20alt%3D%22Senlent_0-1767076783748.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EThe%20MFI%20your%20setting%20is%20120%2CODIV2%20is%204%2C%20which%20is%20out%20of%20range%20of%26nbsp%3BPLL%20VCO%20output%26nbsp%3B%20frequency(240)%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Senlent_3-1767076930306.png%22%20style%3D%22width%3A%20663px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Senlent_3-1767076930306.png%22%20style%3D%22width%3A%20663px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Senlent_3-1767076930306.png%22%20style%3D%22width%3A%20663px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F371384iBDFD0560FEBC22E1%2Fimage-dimensions%2F663x265%3Fv%3Dv2%22%20width%3D%22663%22%20height%3D%22265%22%20role%3D%22button%22%20title%3D%22Senlent_3-1767076930306.png%22%20alt%3D%22Senlent_3-1767076930306.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Senlent_2-1767076869206.png%22%20style%3D%22width%3A%20691px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Senlent_2-1767076869206.png%22%20style%3D%22width%3A%20691px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Senlent_2-1767076869206.png%22%20style%3D%22width%3A%20691px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F371383i7B5D3991FFA50615%2Fimage-dimensions%2F691x151%3Fv%3Dv2%22%20width%3D%22691%22%20height%3D%22151%22%20role%3D%22button%22%20title%3D%22Senlent_2-1767076869206.png%22%20alt%3D%22Senlent_2-1767076869206.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3BYou%20must%20follow%20the%20requirement%20in%20the%20reference%20manual%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Senlent_4-1767077918366.png%22%20style%3D%22width%3A%20597px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Senlent_4-1767077918366.png%22%20style%3D%22width%3A%20597px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Senlent_4-1767077918366.png%22%20style%3D%22width%3A%20597px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F371392iF14A20BA818F3E41%2Fimage-dimensions%2F597x516%3Fv%3Dv2%22%20width%3D%22597%22%20height%3D%22516%22%20role%3D%22button%22%20title%3D%22Senlent_4-1767077918366.png%22%20alt%3D%22Senlent_4-1767077918366.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3Efor%20your%20reference%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Senlent_5-1767077948858.png%22%20style%3D%22width%3A%20666px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Senlent_5-1767077948858.png%22%20style%3D%22width%3A%20666px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Senlent_5-1767077948858.png%22%20style%3D%22width%3A%20666px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F371393iC9F8D16F665109CC%2Fimage-dimensions%2F666x506%3Fv%3Dv2%22%20width%3D%22666%22%20height%3D%22506%22%20role%3D%22button%22%20title%3D%22Senlent_5-1767077948858.png%22%20alt%3D%22Senlent_5-1767077948858.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Senlent_6-1767077983979.png%22%20style%3D%22width%3A%20669px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Senlent_6-1767077983979.png%22%20style%3D%22width%3A%20669px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Senlent_6-1767077983979.png%22%20style%3D%22width%3A%20669px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F371394i311FC3A42B4FBC7A%2Fimage-dimensions%2F669x281%3Fv%3Dv2%22%20width%3D%22669%22%20height%3D%22281%22%20role%3D%22button%22%20title%3D%22Senlent_6-1767077983979.png%22%20alt%3D%22Senlent_6-1767077983979.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Senlent_7-1767078011090.png%22%20style%3D%22width%3A%20669px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Senlent_7-1767078011090.png%22%20style%3D%22width%3A%20669px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Senlent_7-1767078011090.png%22%20style%3D%22width%3A%20669px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F371395i7C290799358A1C69%2Fimage-dimensions%2F669x281%3Fv%3Dv2%22%20width%3D%22669%22%20height%3D%22281%22%20role%3D%22button%22%20title%3D%22Senlent_7-1767078011090.png%22%20alt%3D%22Senlent_7-1767078011090.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EFinally%2C%20don't%20forget%20to%20reconfigure%20FlexCan's%20baudrate%20settings.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2269761%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20CAN%20is%20busy%20when%20transmit%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2269761%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3ESorry%2C%20the%20Autosar%20package%20purchased%20for%20this%20project%20has%20specified%20the%20use%20of%20this%20version%20of%20RTD.%3C%2FP%3E%3CP%3ETherefore%2C%20I%20need%20to%20configure%20the%20mcal%20based%20on%20this%20version%20and%20verify%20that%20it%20is%20error-free.%3C%2FP%3E%3CP%3ECould%20you%20install%20this%20version%20and%20help%20me%20troubleshoot%20the%20issue%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2269757%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20CAN%20is%20busy%20when%20transmit%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2269757%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%40%3CSPAN%3EJohnson97%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3ECould%20you%20update%20your%20RTD%20to%20a%20newer%20version%2C%20or%20modify%20a%20test%20routine%20on%20your%20S32%20DS%20so%20I%20can%20check%20it%20for%20you%3F%20(I%20haven't%20installed%20that%20RTD%20version%20yet.)%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2269745%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20CAN%20is%20busy%20when%20transmit%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2269745%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EPlease%20check%20the%20attached%20file.The%20version%20of%20the%20RTD%20package%20is%20SW32K3_S32M27x_RTD_R21-11_4.0.0_P19_D2403%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2269733%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20CAN%20is%20busy%20when%20transmit%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2269733%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%40%3CSPAN%3EJohnson97%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EPlease%20share%20your%20project%2C%20and%20I%20will%20take%20some%20time%20to%20review%20it%20for%20you.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2270042%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20CAN%20is%20busy%20when%20transmit%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2270042%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EThank%20you%20very%20much.%20The%20problem%20has%20been%20solved.%3C%2FP%3E%3CP%3EApart%20from%20the%20aforementioned%20issues%2C%20the%20configuration%20of%20the%20CAN%20baud%20rate-related%20registers%20also%20does%20not%20match%20the%20valid%20values%20specified%20in%20the%20manual.%3C%2FP%3E%3CP%3EThe%20waveform%20of%20the%20tx%20pin%20of%20the%20MCU%20has%20met%20the%20expectations.%20The%20subsequent%20issues%20should%20be%20related%20to%20the%20transceiver.%3C%2FP%3E%3CP%3EThank%20you%20again!%3C%2FP%3E%3C%2FLINGO-BODY%3E