MPC5642 ACKERR creation and detection

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

MPC5642 ACKERR creation and detection

ソリューションへジャンプ
1,654件の閲覧回数
ZhouYiChuan
Contributor III

Hello experts:

As the experience on MPC5746R, if no CAN node(such as CANoe) is connected the CAN port, an ACKERR (=1) can be read from the ErrorStatus Register. 

But it seems doesn't work on MPC5642, as below:

Memory_0220-ACKError.PNG

ESR register value is 0x512, the ACKERR bit is still 0. and ECR register value is 0x8700(RXECNT = 0x87)

The debugger is P&E multiLink universal , not MultiLink FX, is this the reason only general registers (r0~r12 PC etc) can be read from the debugger register window?

I can only read the FlexCAN registers via Memory window.

thanks and BR

Zhou YiChuan

0 件の賞賛
1 解決策
1,554件の閲覧回数
PetrS
NXP TechSupport
NXP TechSupport
0 件の賞賛
5 返答(返信)
1,641件の閲覧回数
PetrS
NXP TechSupport
NXP TechSupport

Hi,

so you have MPC5642A disconnected from the CAN bus and sent a message. ACK is set during message transmission and also TX error counter should increase.
Read ESR within code into variable, The CPU read action clears bits16–21.

There should be an option to display EmbSysView register window. In debuger press ALT+SHIFT+Q, then Q and search for EmbSysView.

BR, Petr

0 件の賞賛
1,635件の閲覧回数
ZhouYiChuan
Contributor III

Hi, Petr:

Yes, to test ACKERR , MPC5642A is disconnected from CAN bus. 
The code was changed like below to check the ACKERR: The SW never runs to the line with brown color .

if(0x1 == CAN_A.ESR.B.ACKERR)
{
         CanA_AckError = 0x1; //SW never run to this line
}

EmbSys Registers view is opened, there is still no FlexCAN registers . 

From memory view , the ACKERR bit is still 0 because ESR value is 0x512.

NoAckErr_0221.png

thanks and BR

Zhou YiChuan

0 件の賞賛
1,631件の閲覧回数
PetrS
NXP TechSupport
NXP TechSupport

Hi,

as written in your "bus off" thread....could you please share project you have, so I can check it.
Also share measurement of TX/RX/bus lines on MCU running given code.

BR, Petr

0 件の賞賛
1,621件の閲覧回数
ZhouYiChuan
Contributor III

Hello Petr:

Thank you very much for the following up. The Bus-off and ACKError were checked on CAN_A.

Maybe you just need to focus on CAN_Drv.c, function CAN_A_BufOffTask() and CAN_A_AckErrorTask()

thanks and BR

Zhou YiChuan

0 件の賞賛
1,555件の閲覧回数
PetrS
NXP TechSupport
NXP TechSupport
0 件の賞賛