Skip to content

CANOpenNode slows down after quitting debugging session #104

Description

@zaaynn123

The issue appears when two different devices are running CANopenNode on the same CAN bus.
I have observed that the problem occurs most frequently during:

  • LSS-based scanning and node assignment
  • SDO communication

Problem behavior

Initially, it seemed that the device not being debugged was responding late. However, after further investigation, I have confirmed that the issue actually originates from the device being debugged

After debugging session is stopped while the CANopen stack is running, the following behavior is observed:

  • The debugged device starts responding very slowly or incorrectly
  • SDO communication fails
  • LSS scanning and node assignment become unreliable
  • SDO abort errors are observed (e.g., 0x06040043 – parameter incompatibility)

Once this condition occurs:

  • Retrying the request does not recover communication
  • The system remains stuck in this faulty state

Important observation

  • The issue is triggered specifically when:

    • Debugging during CANopen execution
    • Using step-over / line-by-line debugging
  • The issue does NOT occur if:

    • Debugging is performed before the CANopen stack starts
  • This problem do not occur currently when debugging session is not done for now.


Recovery methods

The only ways to recover are:

  1. Performing a full device reset, after which communication works again
  2. Performing a CANopen communication reset, which also restores operation
  3. Sometimes increasing the timeout of the SDO (time_difference_us and SDOtimeoutTime_ms) resolves the issue but the system and SDO become very slow and eventually fail as well. I am following the SDO code given here : https://canopennode.github.io/CANopenNode/group__CO__SDOclient.html

However, this issue should ideally not occur in the first place.


How to reproduce

  1. Connect two CANopenNode devices on the same bus
  2. Start normal CANopen communication
  3. Begin debugging one device
  4. Step through the firmware (step-over) while CANopen is running
  5. Stop the debugging session
  6. Now the SDO communication or LSS communication must start to let the problem occur. Also try to call them consecutively as well in a loop.

After this, the communication problem appears consistently once it starts occurring.


Similar issue

My issue seems very similar to the one reported here:
#89


Screenshots

SDO

Overall :
Image

SDO request:

Image

SDO response:

Image

Abort SDO:

Image

LSS

LSS Timed out after this:
Image

Request

I would appreciate any guidance on how to resolve this issue, as I am currently blocked by it.
I would be happy to provide any additional information if required.

Metadata

Metadata

Labels

pending-fixBug confirmed, in process to fix it.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions