Commit graph

16 commits

Author SHA1 Message Date
Henrik Brix Andersen 45cf142c3a canbus: canopen: fix reference to CAN in Automation draft standard
Fix the reference to the CAN in Automation (CiA) draft standard for
program download (302-3, not 303-2).

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-06-29 14:10:56 -04:00
Kumar Gala a1b77fd589 zephyr: replace zephyr integer types with C99 types
git grep -l 'u\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/u\(8\|16\|32\|64\)_t/uint\1_t/g"
	git grep -l 's\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/s\(8\|16\|32\|64\)_t/int\1_t/g"

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-08 08:23:57 -05:00
Henrik Brix Andersen 4e4139cf9e canbus: canopen: program: add missing include for FLASH_AREA
Add missing include after the conversion from DT_FLASH_AREA to
FLASH_AREA.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-05-25 13:26:28 +02:00
Kumar Gala ff579a3af3 flash: Convert DT_FLASH_AREA to FLASH_AREA macros
Convert with a combo of scripts and by hand fixups:

git grep -l DT_FLASH_AREA_.*_ID | \
 xargs sed -i -r 's/DT_FLASH_AREA_(.*)_ID/FLASH_AREA_ID(\L\1)/'

git grep -l DT_FLASH_AREA_.*_OFFSET | \
 xargs sed -i -r 's/DT_FLASH_AREA_(.*)_OFFSET/FLASH_AREA_OFFSET(\L\1)/'

git grep -l DT_FLASH_AREA_.*_SIZE | \
 xargs sed -i -r 's/DT_FLASH_AREA_(.*)_SIZE/FLASH_AREA_SIZE(\L\1)/'

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-13 21:22:53 +02:00
Henrik Brix Andersen bbc1928dd1 canbus: canopen: add program download support
Add program download (firmware update) support according to the CAN in
Automation (CiA) 302-3 draft standard proposal v4.1.0.

The implementation supports a Zephyr specific vendor command allowing
external confirmation of a newly booted firmware image. If this is not
desired, the application can confirm the image by other means.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-05-08 10:53:42 +02:00
Alexander Wachter 464f135ce6 canbus: Convert canbus driver and subsys to new timeout API
Convert all canbus related API/samples/tests/subsys
to the new timeout API with k_timeout_t.

Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
2020-05-06 10:19:13 +02:00
Peter Bigot 52885d0576 coccinelle: run ms_timeout conversion semantic patch
Substitute integral constants where call sites passed named constants
that have timeout values as arguments to parameters that expect
millisecond durations.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-04-30 18:26:26 +02:00
Peter Bigot ecf3bdb5b3 coccinelle: re-run timeout conversion semantic patch
Run the int_literal_to_timeout Coccinelle script to fix places where
it is clear that an integer duration is being passed where a timeout
value is required.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-04-02 19:47:51 +03:00
Joakim Andersson ecf3bcf747 canopen: Use ssize_t for the return value of read_cb
Use ssize_t for the return value of read_cb.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-04-02 19:39:28 +03:00
Alexander Wachter fd9733e2d9 canopen: CO_driver: Fix Coverity issues (NULL deref, dead code)
There were two dereference after NULL check and logical dead code.

Fixes #22434
Fixes #22443
Fixes #22435
Coverity-CID: 207978
Coverity-CID: 207977
Coverity-CID: 207964

Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
2020-02-06 09:58:46 +02:00
Henrik Brix Andersen 6b702888e5 canbus: canopen: process RPDOs in real-time thread
Add processing of RPDOs to the high-priority CANopen processing
thread.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-02-05 14:36:05 -06:00
Ulf Magnusson 11eb3b6c4f canbus: canopen: Fix broken CANOPEN_STORAGE_HANDLER_ERASES_EEPROM ref.
Missing CONFIG_ prefix in #ifdef, leading to some dead code.

Found by scripts/kconfig/lint.py, which flagged it as unused.

Piggyback removal of a redundant 'default n'.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-25 08:15:53 -05:00
Henrik Brix Andersen 5ecc6698b9 samples: canbus: add CANopen sample
Add sample demonstrating the integration of CANopenNode in Zephyr to
support the CANopen protocol.

This fixes #15278.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-01-20 17:17:23 +01:00
Henrik Brix Andersen 308f204952 canbus: canopen: add LED indicator support
Add support for CANopen LED indicators according to the CAN in
Automation (CiA) 303-3 specification.

This fixes #15278.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-01-20 17:17:23 +01:00
Henrik Brix Andersen 2dcbd8bbc1 canbus: canopen: add object dictionary storage
Add support for storing the CANopen object dictionary to non-volatile
storage.

This fixes #15278.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-01-20 17:17:23 +01:00
Henrik Brix Andersen 56f74da757 canbus: canopen: add zephyr driver layer for CANopenNode
Add a Zephyr driver and abstraction layer for use by the 3rd party
CANopenNode module.

CANopenNode depends on the CO_driver.h file for platform-specific type
definitions, locking primitives, and CAN bus driver API.

This fixes #15278.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-01-20 17:17:23 +01:00