CAN receive issue in debug mode

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

CAN receive issue in debug mode

926 Views
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 Kudos
Reply
4 Replies

871 Views
Jaga123
Contributor I

Jaga123_0-1732696179027.png

here CAN error register data just after CAN communication stopped.

0 Kudos
Reply

836 Views
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 Kudos
Reply

876 Views
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 Kudos
Reply

871 Views
Jaga123
Contributor I
No, there is no error in CAN registers.
0 Kudos
Reply