Skip to content

CO_CANsend should not increase CANtxCount if buffer is full already - #85

Merged
MaJerle merged 1 commit into
CANopenNode:masterfrom
simon-spobu:master
Jun 2, 2025
Merged

CO_CANsend should not increase CANtxCount if buffer is full already #85
MaJerle merged 1 commit into
CANopenNode:masterfrom
simon-spobu:master

Conversation

@simon-spobu

Copy link
Copy Markdown
Contributor

Hi,
we had SDO Reads stall after some minutes while hammering SDO Requests with 10Hz . PDOs were still working.
Investigation in SDO-Server turned out that CANtxCount was 1 but bufferFull was still false.

HAL_FDCAN_TxBufferCompleteCallback sends buffer only once if buffer was full, so we can do CANtxCount++ only once.

MCU was STM32G473.
This took me some time. Gemini und Claude figured it out in seconds 😒

Also fixes tabs indentation.

This issues should also be fixed in CO_driver_blank.c i guess? @CANopenNode

regards Simon

…HAL_FDCAN_TxBufferCompleteCallback sends buffer only once if buffer was full).
@MaJerle

MaJerle commented May 28, 2025

Copy link
Copy Markdown
Collaborator

@HamedJafarzadeh do you agree with this?

@HamedJafarzadeh

Copy link
Copy Markdown
Collaborator

@MaJerle I would ask @CANopenNode for comment, because this is how it is implemented in original CANOpenNode sample.

@CANopenNode

Copy link
Copy Markdown
Owner

This is correct and is quite important fix. I will fix CO_driver_blank.c and other projects too.

However, it didn't show in my other projects: CANopenLinux doesn't use CANtxCount at all, CANopenPIC reads some internal registers in first if: PIC32/CO_driver.c

I suggest to merge.

Thank you.

@MaJerle
MaJerle merged commit d600693 into CANopenNode:master Jun 2, 2025
CANopenNode added a commit to CANopenNode/CANopenNode that referenced this pull request Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants