Need MCAL working CAN Configuration for S32K388 EVB bench

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Need MCAL working CAN Configuration for S32K388 EVB bench

450 次查看
nitins25
Contributor III

Hello NXP team,

Can you please share a working software for S32K388 EVB CAN with needed MCAL configuration(FlexCAN driver config, TJA1153 Secured HS-CAN Transceiver config etc)

We are currently blocked with an issue where FlexCAN_Init is returning FLEXCAN_STATUS_TIMEOUT.

(Not sure if there is any HW setting to ensure CAN is initialized)

0 项奖励
回复
3 回复数

257 次查看
AlexTriana
NXP Employee
NXP Employee

Hi Nitin, I hope you are well

I was doing a CAN example code and I just wanted to share it in case you need it for reference in the future.

Here is an example that uses RTD to configure the FlexCAN module using the MCAL layer, including a function to initialize the TJA1153/TJA1043 PHYs on the evaluation board. The code is configured for 8-byte CAN Classic at 500 Kbps + TJA1153/TJA1043 PHY setup.

You should have one S32K388 connected as follows.

AlexTriana_0-1722538408480.jpeg

There is a macro to choose between the TJA1153 and the TJA1043 PHY

AlexTriana_1-1722538408482.png

An extra consideration is that every time you update the project, you need to add the following code to the file: generate -> include -> CanIf_Cfg.h

/*==================================================================================================

*                                    FUNCTION PROTOTYPES

==================================================================================================*/

#define CANIF_START_SEC_CODE

#include "CanIf_MemMap.h"

extern void CanIf_Tx_Callback (void);

extern void CanIf_Rx_Callback (void);

#define CANIF_STOP_SEC_CODE

#include "CanIf_MemMap.h"

AlexTriana_2-1722538408488.png

Once you flash the board, you must restart (Power off and Power on) the boards. Then, you will be able to see the green LEDs blinking every 1000 frames sent/received.

You can connect the scope to CAN_H or CAN_L to see the signals as shown below.

AlexTriana_3-1722538408491.png

Best Regards,

Alejandro Flores Triana

0 项奖励
回复

417 次查看
nitins25
Contributor III

Added the issue screenshot for NXP team reference.

0 项奖励
回复

370 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

simple K388 example is given within S32DS RTD demos, refer to Can_Example_S32K388 one.
It is an CAN HLD driver component LoopBack example, but you can test passing init function.
The reason why it hangs on SW reset could be missing CAN protocol clock, so check that.

BR, Petr

0 项奖励
回复