1
0
Fork 0
CANopenNode/301
Tristen Pierson a36ab57e4e fix: CO_EM_RPDO_TIME_OUT incorrectly cleared when multiple RPDOs monitored
CO_EM_RPDO_TIME_OUT is a single shared error bit for all RPDO instances.
CO_RPDO_process() called CO_errorReset() for this bit the moment any one
RPDO recovered from timeout, even if other RPDOs were still timed out.

Scenario that exposes the bug:
  node-2 and node-3 are RPDO producers with deadline monitoring.
  Both go pre-operational -> CO_EM_RPDO_TIME_OUT set -> error register 0x10.
  node-2 comes back -> CO_RPDO_process() calls CO_errorReset() ->
  CO_EM_RPDO_TIME_OUT cleared -> error register 0x00.
  node-3 is still timed out: the error register is now incorrect.

Fix: remove CO_errorReset() from CO_RPDO_process(). Instead, add a
post-loop check in CO_process_RPDO() (CANopen.c) that iterates all RPDO
instances. CO_errorReset() is only called when none of them remains in
timeout (timeoutTimer > timeoutTime_us). CO_process_RPDO() has access
to the full co->RPDO[] array and is therefore the correct place to make
this cross-RPDO decision. CO_errorReset() is a no-op when the error bit
is already clear, so calling it every cycle when no timeout is active is
safe and efficient.
2026-07-10 08:20:05 +02:00
..
CO_config.h Fix CANopen terminology: “CAN messages” are actually “CAN frames” 2026-06-26 10:23:01 +02:00
CO_driver.h Fix CANopen terminology: “CAN messages” are actually “CAN frames” 2026-06-26 10:23:01 +02:00
CO_Emergency.c Fix CANopen terminology: “CAN messages” are actually “CAN frames” 2026-06-26 10:23:01 +02:00
CO_Emergency.h Fix CANopen terminology: “CAN messages” are actually “CAN frames” 2026-06-26 10:23:01 +02:00
CO_fifo.c Format comments in the .c files. 2024-07-06 21:48:21 +02:00
CO_fifo.h Format comments in the .h files. 2024-07-09 00:17:15 +02:00
CO_HBconsumer.c Fix CANopen terminology: “CAN messages” are actually “CAN frames” 2026-06-26 10:23:01 +02:00
CO_HBconsumer.h Format comments in the .h files. 2024-07-09 00:17:15 +02:00
CO_NMT_Heartbeat.c Fix CANopen terminology: “CAN messages” are actually “CAN frames” 2026-06-26 10:23:01 +02:00
CO_NMT_Heartbeat.h Format comments in the .h files. 2024-07-09 00:17:15 +02:00
CO_Node_Guarding.c Fix CANopen terminology: “CAN messages” are actually “CAN frames” 2026-06-26 10:23:01 +02:00
CO_Node_Guarding.h Fix CANopen terminology: “CAN messages” are actually “CAN frames” 2026-06-26 10:23:01 +02:00
CO_ODinterface.c Add ability to override OD_readOriginal and OD_writeOriginal #634 2026-07-03 14:22:33 +02:00
CO_ODinterface.h Make OD_requestTPDO() more clear, remove OD_getFlagsPDO(). 2024-10-19 12:42:36 +02:00
CO_PDO.c fix: CO_EM_RPDO_TIME_OUT incorrectly cleared when multiple RPDOs monitored 2026-07-10 08:20:05 +02:00
CO_PDO.h Fix CANopen terminology: “CAN messages” are actually “CAN frames” 2026-06-26 10:23:01 +02:00
CO_SDOclient.c Fix CANopen terminology: “CAN messages” are actually “CAN frames” 2026-06-26 10:23:01 +02:00
CO_SDOclient.h Fix CANopen terminology: “CAN messages” are actually “CAN frames” 2026-06-26 10:23:01 +02:00
CO_SDOserver.c Fix CANopen terminology: “CAN messages” are actually “CAN frames” 2026-06-26 10:23:01 +02:00
CO_SDOserver.h Fix CANopen terminology: “CAN messages” are actually “CAN frames” 2026-06-26 10:23:01 +02:00
CO_SYNC.c Fix CANopen terminology: “CAN messages” are actually “CAN frames” 2026-06-26 10:23:01 +02:00
CO_SYNC.h Fix and update doxygen documentation. 2024-08-07 00:17:39 +02:00
CO_TIME.c Fix CANopen terminology: “CAN messages” are actually “CAN frames” 2026-06-26 10:23:01 +02:00
CO_TIME.h Fix CANopen terminology: “CAN messages” are actually “CAN frames” 2026-06-26 10:23:01 +02:00
crc16-ccitt.c Format the .c files using clang-format v15. 2024-07-06 19:57:06 +02:00
crc16-ccitt.h Format comments in the .h files. 2024-07-09 00:17:15 +02:00