Flex CAN Can't Receive

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

Flex CAN Can't Receive

781 Views
Turtledove
Contributor II

I have an S32K148 board, and I am running S32K148 Flex CAN code on S32 IDE for ARM.  I can check the data on the PCAN monitor, but if I am sending data from PCAN to code, I can't receive it. Kindly help me out. How to check the data in real-time expression and what to send using PCAN and check on real-time expression. 

0 Kudos
Reply
1 Reply

746 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @Turtledove,

Are you using the provided examples with S32DS ARM (bare metal) or an example from the SDK (ProcessorExpert)?

Snag_989d5cd.pngSnag_989de0a.png

If you are using the bare metal approach, you can refer to AN5413, which provides software examples. Specifically, section 2.9 and 2.10 both provide FlexCAN 2.0 & FlexCAN FD routines.

If you are using the SDK, you can follow the description.txt file from the imported example.

1. Import the example to the workspace and generate the ProcessorExpert code through the "Components" view.

Snag_98dfe8f.png

2. "Generated_Code" folder should be present under the project directory. Next, build the project.

3. This specific "can_pal_s32k148" example is setup to work with two EVBs, one as node A and the other one as node B. You can change this by defining either MASTER or SLAVE in the defines.

But, since you are using a PCAN-USB, you can simply run the application on the S32K148EVB and connect J11 to your PCAN. After this, setup CAN FD bit timing as the example (500kpbs/1000kpbs & 87.5%/75% sample point).

Snag_a409b1b.png

4. After configuration and connections, you will receive a CAN frame when pressing either SW3 or SW4, and EVB will toggle LED0 and LED1 depending on data[0] for the sent frame:

Snag_a42fc4d.png

For Real-Time Expressions, please refer to this post: Solved: How do I enable Live View for variables when debugging? - NXP Community.

Best regards,
Julián

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2205057%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EFlex%20CAN%20Can't%20Receive%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2205057%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI%20have%20an%20S32K148%20board%2C%20and%20I%20am%20running%20S32K148%20Flex%20CAN%20code%20on%20S32%20IDE%20for%20ARM.%26nbsp%3B%20I%20can%20check%20the%20data%20on%20the%20PCAN%20monitor%2C%20but%20if%20I%20am%20sending%20data%20from%20PCAN%20to%20code%2C%20I%20can't%20receive%20it.%20Kindly%20help%20me%20out.%20How%20to%20check%20the%20data%20in%20real-time%20expression%20and%20what%20to%20send%20using%20PCAN%20and%20check%20on%20real-time%20expression.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2205414%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Flex%20CAN%20Can't%20Receive%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2205414%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%2F256892%22%20target%3D%22_blank%22%3E%40Turtledove%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3EAre%20you%20using%20the%20provided%20examples%20with%20S32DS%20ARM%20(bare%20metal)%20or%20an%20example%20from%20the%20SDK%20(ProcessorExpert)%3F%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Snag_989d5cd.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Snag_989d5cd.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F365743i406E2EC72A444074%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Snag_989d5cd.png%22%20alt%3D%22Snag_989d5cd.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Snag_989de0a.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Snag_989de0a.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F365744iC12AEBAA741B85FE%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Snag_989de0a.png%22%20alt%3D%22Snag_989de0a.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EIf%20you%20are%20using%20the%20bare%20metal%20approach%2C%20you%20can%20refer%20to%20%3CA%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fdocs%2Fen%2Fapplication-note%2FAN5413.pdf%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3EAN5413%3C%2FA%3E%2C%20which%20provides%20software%20examples.%20Specifically%2C%20section%202.9%20and%202.10%20both%20provide%20FlexCAN%202.0%20%26amp%3B%20FlexCAN%20FD%20routines.%3C%2FP%3E%0A%3CP%3EIf%20you%20are%20using%20the%20SDK%2C%20you%20can%20follow%20the%20description.txt%20file%20from%20the%20imported%20example.%3C%2FP%3E%0A%3CP%3E1.%20Import%20the%20example%20to%20the%20workspace%20and%20generate%20the%20ProcessorExpert%20code%20through%20the%20%22Components%22%20view.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Snag_98dfe8f.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Snag_98dfe8f.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F365745i916EF728D7FDB052%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Snag_98dfe8f.png%22%20alt%3D%22Snag_98dfe8f.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E2.%20%22Generated_Code%22%20folder%20should%20be%20present%20under%20the%20project%20directory.%20Next%2C%20build%20the%20project.%3C%2FP%3E%0A%3CP%3E3.%20This%20specific%20%22can_pal_s32k148%22%20example%20is%20setup%20to%20work%20with%20two%20EVBs%2C%20one%20as%20node%20A%20and%20the%20other%20one%20as%20node%20B.%20You%20can%20change%20this%20by%20defining%20either%20MASTER%20or%20SLAVE%20in%20the%20defines.%3C%2FP%3E%0A%3CP%3EBut%2C%20since%20you%20are%20using%20a%20PCAN-USB%2C%20you%20can%20simply%20run%20the%20application%20on%20the%20S32K148EVB%20and%20connect%20J11%20to%20your%20PCAN.%20After%20this%2C%20setup%20CAN%20FD%20bit%20timing%20as%20the%20example%20(500kpbs%2F1000kpbs%20%26amp%3B%2087.5%25%2F75%25%20sample%20point).%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Snag_a409b1b.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Snag_a409b1b.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F365753i676F483C3098F8DC%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Snag_a409b1b.png%22%20alt%3D%22Snag_a409b1b.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E4.%20After%20configuration%20and%20connections%2C%20you%20will%20receive%20a%20CAN%20frame%20when%20pressing%20either%20SW3%20or%20SW4%2C%20and%20EVB%20will%20toggle%20LED0%20and%20LED1%20depending%20on%20data%5B0%5D%20for%20the%20sent%20frame%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Snag_a42fc4d.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Snag_a42fc4d.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F365754iFFEF1459EE9E83AE%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Snag_a42fc4d.png%22%20alt%3D%22Snag_a42fc4d.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EFor%20Real-Time%20Expressions%2C%20please%20refer%20to%20this%20post%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32-Design-Studio%2FHow-do-I-enable-Live-View-for-variables-when-debugging%2Fm-p%2F669271%23%3A~%3Atext%3DSimply%2520Go%2520to%2520menu%2520Window%2520-%253E%2520%2522Show%2520View%2522%2CYou%2520should%2520observe%2520the%2520variable%2520is%2520being%2520updated.%22%20target%3D%22_blank%22%3ESolved%3A%20How%20do%20I%20enable%20Live%20View%20for%20variables%20when%20debugging%3F%20-%20NXP%20Community%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3EBest%20regards%2C%3CBR%20%2F%3EJuli%C3%A1n%3C%2FP%3E%3C%2FLINGO-BODY%3E