1
0
Fork 0
Commit graph

792 commits

Author SHA1 Message Date
Janez
9b8beed836 Better organize CO_EM_RPDO_TIME_OUT detection. #618, #626
Move RPDO related code from CANopen.c into PDO.c, remove additional for loop.
Introduce new optional argument bool_t* timeoutState into CO_RPDO_process().
2026-07-10 16:17:46 +02:00
Frab012
5a97d2d209 Add missing RPDO timeout error handling in LED processing 2026-07-10 08:25:16 +02:00
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
aineoae86-sys
bc79a5c87d docs: clarify blank CAN pointer placeholder
Generated-by: OpenAI Codex
Signed-off-by: aineoae86-sys <ai.neo.ae86@gmail.com>
2026-07-08 08:00:49 +02:00
CISSOIDjmr
44183ee4b8 Add ability to override OD_readOriginal and OD_writeOriginal #634
With `CO_OVERRIDE_OD_READ_ORIGINAL` and `CO_OVERRIDE_OD_WRITE_ORIGINAL`
2026-07-03 14:22:33 +02:00
Janez
8c09a433ef Fix CANopen terminology: “CAN messages” are actually “CAN frames”
Fix all documentation and comments according to CiA proposals:
https://www.can-cia.org/services/publications/can-community-news/05-2025

CANopenNode was using "CAN message" in many places, but actually such
term is incorrect. No code or variable names was changed.
2026-06-26 10:23:01 +02:00
Janez
891852ce39
Merge pull request #627 from BitConcepts/fix/gateway-lss-activate-bitrate-buffer
fix: gateway tok[20] too small — lss_activate_bitrate always fails
2026-06-24 16:33:56 +02:00
Janez
542b0ca20f Example: CO_CANsend should not increase CANtxCount if buffer is full already
See https://github.com/CANopenNode/CanOpenSTM32/pull/85
2026-06-24 15:44:15 +02:00
Tristen Pierson
cf85a4c677 fix: gateway tok[20] too small for lss_activate_bitrate command
The command string "lss_activate_bitrate" is exactly 20 characters.
CO_fifo_readToken() is called with count=sizeof(tok)=20. When exactly
20 characters are read, tokenSize==count which triggers the overflow
guard: *err=true and the token is discarded. The command therefore
always fails with a syntax error.

The buffer needs at least 21 bytes (20 chars + null terminator) to
successfully parse this command.

Fixes #623.
2026-05-31 16:40:29 -04:00
Janez
ac2140717c Mention bitwise PDO mapping in readme. 2025-11-22 12:40:47 +01:00
Janez
eba31e3a71
Merge pull request #572 from Sl-Alex/feature/pdo_bitwise_mapping
Implement PDO bitwise mapping

Disabled by default. Enable with CO_CONFIG_PDO_BITWISE_MAPPING configuration macro.
2025-11-22 12:34:46 +01:00
Benjamin Klaric
d3ca0e9d95
doc: deviceSupport: updated Zephyr RTOS links (#611)
As stated, updated the Zephyr RTOS section links.
The references are correct now.

Signed-off-by: Benjamin Klaric <benjamin.klaric01@gmail.com>
2025-11-19 11:13:23 +01:00
Janez
ef9ac3a227 CO_gateway_ascii: function CO_GTWA_log_print() fixed. "log" inquiry now works. 2025-08-04 18:01:26 +02:00
Stefan Tauner
b6e9107a9a
Refine #585 (#593)
In MR #585 the initialization of HBcons has been protected from dereferencing stream if it's NULL.
However, the logic is now twisted enough to provoke a maybe-uninitialized warning in GCC 13.
While this is strictly a false positive since the generated code would never dereference HBcons if stream == NULL
this patch refines the code to be easier to read for compilers and humans alike by returning early if stream == NULL.
2025-07-29 15:12:44 +02:00
Janez
c804f7de47
Update example/main_blank.c, fix problems with LSS.
Other microcontrollers should fix this too, see https://github.com/CANopenNode/CanOpenSTM32/pull/67
2025-07-27 01:00:04 +02:00
Cory Van Beek
c7a4d26b38
Fix dereference before NULL check (#585)
You are right, thank you.
2025-07-15 15:00:55 +02:00
Tilen Majerle
6dfd4ed7f2
define variable before it is being assigned (#582) 2025-06-08 17:43:26 +02:00
Janez
145a15d944
Update CANopen.c (#577), Issue #576 2025-05-07 09:39:51 +02:00
Sl-Alex
ed36e44f28 Bitwise PDO implementation 2025-04-05 23:53:45 +02:00
Sl-Alex
039827c7a2 Mention that *_OD_IO_ACCESS is mandatory for bitwise PDO mapping 2025-04-04 15:13:21 +02:00
Sl-Alex
38c329e87d Check the maximum mapped objects for the PDO 2025-04-04 15:13:21 +02:00
Sl-Alex
006e3e3503 Use PDO bitwise mapping with *_OD_IO_ACCESS 2025-04-04 15:13:21 +02:00
Sl-Alex
cdc8cb872a Add a config option for PDO bitwise mapping 2025-04-04 15:13:21 +02:00
temi54c1l8
f454a3d82d
change for static analysis for CO_RPDO_process function (#564) 2025-03-01 16:54:38 +01:00
temi54c1l8
a9e2b3c2b0
add conformance test adaptation for obj: 13FEh and 13FFh (#563) 2025-03-01 16:54:23 +01:00
Hannu Korhonen
6ef8956ff9
Fixed LSS master message byteswapping for big endian system (#554) 2024-11-13 08:36:17 +01:00
Janez
fbd42d46a2 Make OD_requestTPDO() more clear, remove OD_getFlagsPDO(). 2024-10-19 12:42:36 +02:00
Vincent Chatelain
9e9aaf5f8d
CO_ODinterface: fix unreachable statement (#548)
Using a `break` after a `return` triggers warning 111 of Arm Compiler 5. To fix this warning while respecting MISRA rules, the return mechanism of OD_getSub() function was changed to only exit at the end.
2024-10-19 00:51:48 +02:00
Janez
29c5b64131 Fix example/CO_storageBlank.c.
CO_LOCK_OD(CANmodule) must not be used, because lock is already
applied by SDO server.
2024-10-10 16:08:54 +02:00
Janez
58012aae34 Fix links 2024-08-14 16:49:01 +02:00
Janez
05931a6b76 Fix and update doxygen documentation. 2024-08-07 00:17:39 +02:00
Janez
076557a485
Update README.md
Description for Object Dictionary Editor - binaries
2024-08-05 22:35:06 +02:00
Janez
835bae5664 CO_SYNC: bugfix, if CO_CONFIG_FLAG_OD_DYNAMIC is disabled. 2024-07-13 15:29:58 +02:00
Janez
e85410e923 CO_PDO.c: additional safety check. 2024-07-12 15:56:19 +02:00
Janez
0554268182
Merge pull request #528 from CANopenNode/code_reformatting
Code reformatting
2024-07-12 15:10:18 +02:00
Janez
f41bfdcb5d Format comments in the .h files. 2024-07-09 00:17:15 +02:00
Janez
f46f1e2733 clang-format: ReflowComments: true 2024-07-07 01:05:10 +02:00
Janez
b87fad2195 Format the .h files using clang-format v15. 2024-07-06 21:54:59 +02:00
Janez
82c95a2bc9 Format comments in the .c files. 2024-07-06 21:48:21 +02:00
Janez
95c1705e76 Format the .c files using clang-format v15. 2024-07-06 19:57:06 +02:00
Janez
0d016a0019 Remove /*********...*/ comment delimiters. 2024-07-06 18:53:40 +02:00
Janez
2857d749be .clang-format: do not SortIncludes 2024-07-06 13:05:43 +02:00
Janez
f064eeaa40 Format the license information in files. 2024-07-06 13:03:00 +02:00
Janez
fcd89f87de Remove comments from arguments in CO_CANrxBufferInit and CO_CANtxBufferInit 2024-07-05 18:38:01 +02:00
Janez
7db21c1f91 CO_SDO_server.c fix missing "bufShifted" 2024-07-05 11:14:37 +02:00
Janez
371e89d30d
Merge pull request #522 from temi54c1l8/static_analysis
Static analysis
2024-07-05 10:47:12 +02:00
temi54c1l8
cf6885b23e
Merge pull request #2 from temi54c1l8/fix_srdo_verified_on_operational_change
Fix SRDO problem with PCL Codesys on configuration runtime without reset
2024-07-04 13:53:13 +02:00
temi54c1l8
07a978aec6
Merge pull request #1 from temi54c1l8/fix_srdo_frame_time
Fix timing message, cycleTimer is only managed by the normal message …
2024-07-04 13:52:25 +02:00
temi54c1l8
28d3c1f372 Fix SRDO problem with PCL Codesys on configuration runtime without reset 2024-07-04 09:55:39 +02:00
temi54c1l8
240dd588fc Fix timing message, cycleTimer is only managed by the normal message to avoid mail loop losses 2024-07-01 11:40:44 +02:00