s32k144 can demo

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

s32k144 can demo

Jump to solution
4,253 Views
kalajiao
Contributor II

Run the official routine, but press the button and there is no response, I wonder if the physical connection is wrong? Do I need to connect two wires to go out and connect a CAN module or something?1624850025003_pro.jpg

0 Kudos
Reply
1 Solution
4,244 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

you need to connect board to CAN bus on J13, so either communicate to second board or to some CAN tool. This is written in example docs, e.g. 
c:\NXP\S32DS_ARM_v2.2\S32DS\software\S32SDK_S32K1xx_RTM_3.0.0\examples\S32K144\driver_examples\communication\can_pal\Doxygen\can_pal.dox

This way, with nothing connected, you can just inspect CAN lines with scope or CAN analyzer to see message transmitted still.

BR, Petr 

View solution in original post

7 Replies
3,914 Views
QES
Contributor I

I have spent some time looking at this. It does not work for me.

If I set the CanCom1 configuration into loop back mode, the demo works as expected, so I think the application code and CanCom1 are ok. What is puzzling me, is that there is no set up of the SBC (UJA1169TK/F). Even with external supply to provide 'Batt' signal for SBC, CAN does not get through. Therefore no activity on the digital lines going to SBC. Reading data sheet for SBC, it seems clear to me that CAN is off by default and the CAN control register needs 'CMC' to be set. I find it puzzling that no code for the SBC is provided in the shipped SDK example, or the Example posted by @PetrS  yet both are stated as working? The wording in each example is ambiguous regarding the SBC too - ' In the first part, the application will setup the board clocks, pins and other system functions such as SBC if the board uses this module as a CAN transceiver.'.

https://community.nxp.com/t5/S32K-Knowledge-Base/Example-S32K144-FlexCAN-TX-RX-Error-ISR-test-S32DS2...

Previously when I used a 5744P dev board, the CAN was enabled in the SBC without need for configuration, but I do not believe this is the case for S32K144EVB-Q100.

Please tell me if I am missing something.

Meanwhile I set up the SPI.

0 Kudos
Reply
3,911 Views
QES
Contributor I

As expected, you need to set up the SBC, then the demo works. Can NXP make this clearer please?

Why is this code missing from the demo!

The SBC can be imported as a component, its worth a quick read of the data sheet to determine the configuration of the SBC. Then call code to init the SPI and then the SBC.

Added to BoardInit :

LPSPI_DRV_MasterInit(LPSPICOM1, &lpspiCom1State, &lpspiCom1_MasterConfig0);
SBC_InitDriver(LPSPICOM1);
SBC_InitDevice(&sbc_uja116x1_InitConfig0);
SBC_SetCanConfig(&(sbc_uja116x1_InitConfig0.can));

0 Kudos
Reply
4,245 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

you need to connect board to CAN bus on J13, so either communicate to second board or to some CAN tool. This is written in example docs, e.g. 
c:\NXP\S32DS_ARM_v2.2\S32DS\software\S32SDK_S32K1xx_RTM_3.0.0\examples\S32K144\driver_examples\communication\can_pal\Doxygen\can_pal.dox

This way, with nothing connected, you can just inspect CAN lines with scope or CAN analyzer to see message transmitted still.

BR, Petr 

4,198 Views
kalajiao
Contributor II

In your previous reply, you said that if the official CAN routine is to be realized, two S32K144 can be used for CAN communication. Is the first MCU still connected like me and downloaded the official routine into it? Is the second board also connected like the first MCU, and then the TX and RX of CAN of the two MCU are all right? Can you tell me more about it? I'm sorry for the trouble,because I'm a little weak at this.

0 Kudos
Reply
4,187 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

as the example documentation suggests those demo applications will use two boards, one configured as master and the other one configured as slave (see MASTER/SLAVE defines in application code).
So same SW is loaded to the MCU, just one built as master, second as slave. Boards will be connected through CAN lines (CANH-CANH, CANL-CANL, GND-GND).

BR, Petr 

 

4,172 Views
kalajiao
Contributor II

I see. Thank you for your help

0 Kudos
Reply
4,233 Views
kalajiao
Contributor II

thank you for your help

0 Kudos
Reply