Error when sending CAN message on MPC5746R

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

Error when sending CAN message on MPC5746R

463 Views
fedotech
Contributor II

Hi,

When I call 'CAN_Send(&canMon_instance, TX_MB_PHY, &TxMsg)' by FlexCAN2 to send message,  a error happened.  The code was executed on Core0 of MPC5746R.

I traced the code, I found that this error appeared when executed '*flexcan_mb |= flexcan_mb_config;'.

fedotech_0-1657297580923.png

The error was as below:

fedotech_1-1657297622237.png

Could anyone help me to fix this strange issue? 

Thanks!

 

 

0 Kudos
3 Replies

444 Views
fedotech
Contributor II

Hi,

After call CAN_Init(), MDIS bit enabled the FlexCAN module, and clock sets in PCTL81 are as following: 

fedotech_2-1657726410864.pngfedotech_3-1657726445873.png

But, after error happened, the PCTL81 changed to all zero as following. ☹

fedotech_4-1657726522424.png

The clock is set as following:

fedotech_5-1657726967859.pngfedotech_6-1657727002036.png

Is it the clock setting problem?

 

Thanks!

0 Kudos

426 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

seems clock setting is right. Could this be due to ECC enabled on FlexCAN? If enabled (by default) is all required memory area initialized as mentioned in RM chapter 47.5.13 Detection and Correction of Memory Errors?

BR, Petr

0 Kudos

452 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi.

*flexcan_mb |= flexcan_mb_config is updating MB CS word, from addresses it should be MB26 on CAN2.
It should work, check if module is clocked (in MC_ME module) and enabled (MDIS bit).

BR, Petr

0 Kudos