CanOpenSTM32
CanOpenSTM32 copied to clipboard
Fix chicken-and-egg problem with LSS slave when running on bare metal:
- CO_LSS_SWITCH_STATE_GLOBAL command to go into CO_LSS_STATE_WAITING is a no-op if active node-ID is NOT equal to 0xFF (see CO_LSSslave.c)
- CO_CANopenInitPDO() returns an error if active node-ID is equal to 0xFF
- As a result, CO_CANsetNormalMode() is never called and the CAN peripheral cannot receive data
- This prevents the LSS slave from ever changing the node-ID to or from 0xFF
- Solution is to ignore that specific error code when calling CO_CANopenInitPDO()