CAN receive issue in debug mode

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

CAN receive issue in debug mode

932 次查看
Jaga123
Contributor I

Hi,

I am using LPC4357 controller and Keil mdk 5.36 software. When I am in debug mode, and everything is working fine. if I stops code using breakpoint for some seconds and then allowing code to run without any break point then I am not able to receive CAN data but before stopping code CAN receive and transmitting is working fine. But I am able to send data after resuming the code. I checked through a CAN analyzer the data is available in the bus but I am not able to read. when I reset controller then again I am able to read data. what can be issue?

0 项奖励
回复
4 回复数

877 次查看
Jaga123
Contributor I

Jaga123_0-1732696179027.png

here CAN error register data just after CAN communication stopped.

0 项奖励
回复

842 次查看
Harry_Zhang
NXP Employee
NXP Employee

Hi @Jaga123 

I think there are three more possibilities

1. CAN Controller Buffer Overrun:
While the code is paused, the CAN peripheral continues to receive messages. If these messages are not handled (processed and cleared), the receive buffer may overflow, causing the CAN controller to stop receiving new messages.
2. Interrupt Handling:
When the debug mode is paused, pending CAN interrupts may not be serviced. Upon resuming, the CAN controller may remain in a state waiting for interrupt flags to be cleared.

3. Debug Behavior Settings:
The debugger may disable peripheral clocks or interrupt handling during a pause, preventing the CAN peripheral from functioning correctly.

BR

Harry

0 项奖励
回复

882 次查看
Harry_Zhang
NXP Employee
NXP Employee

Hi @Jaga123 

Can you check if there are any error messages in the CAN TX and RX registers?

BR

Harry

0 项奖励
回复

877 次查看
Jaga123
Contributor I
No, there is no error in CAN registers.
0 项奖励
回复