Skip to content

Missing TPDO Initialization #168

@crodegast

Description

@crodegast

Describe the bug
If there are multiple TPDO defined, a special situation can occur: between initialization of TPDO1 and TPDO2, the COTmrService / COTmrProcess can interrupt the initialization and tries to send TPDO1. This will fail, including reloading the timer of TPDO1 as the nmt mode "operational" is not set yet.
As the reloading was not done, TPDO1 will not be send in this "operational" cycle. Re-sending nmt "operational" will solve this issue.

To Reproduce
Steps to reproduce the behavior:

  1. define at least two pdos with a very small event timer (e.g. 10 with a CO_TMR_TICKS_PER_SEC = 100).
  2. send NMT "operational" -> most of the time both (or all ) tpdos will be sent. If all TPDOs appears, send a NMT "reset" and retry.
  3. See missing TPDO

Expected behavior
I expect all TPDO to be send at any time.


CANopen Stack (please complete the following information):

  • Device: [e.g. STM32F429]
  • OS: [µOS]
  • Version: we are using an older version, but the actual stack seems to have the same issue.

Additional context
A solution would be to set the new nmt mode first and then initialize the TPDOs in the following method:

void CONmtSetMode(CO_NMT *nmt, CO_MODE mode)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions