Skip to content

Commit c0fb33a

Browse files
henrikbrixandersencarlescufi
authored andcommitted
samples: modules: canopennode: convert to sysbuild
Convert the CANopenNode sample to use sysbuild for generating MCUboot + CANopenNode sample binaries instead of using manual instructions. Rework the twister sample filtering to just list the known good boards. Signed-off-by: Henrik Brix Andersen <[email protected]>
1 parent 6ac2818 commit c0fb33a

File tree

4 files changed

+14
-36
lines changed

4 files changed

+14
-36
lines changed

samples/modules/canopennode/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ cmake_minimum_required(VERSION 3.20.0)
44

55
macro(app_set_runner_args)
66
board_runner_args(canopen "--node-id=${CONFIG_CANOPEN_NODE_ID}")
7-
board_runner_args(dfu-util "--dfuse-modifiers=force:mass-erase")
8-
board_runner_args(pyocd "--erase")
9-
board_runner_args(nrfjprog "--erase")
107
endmacro()
118

129
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})

samples/modules/canopennode/README.rst

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -394,48 +394,33 @@ Building and Running for FRDM-K64F
394394
The sample can be rebuilt with MCUboot and program download support
395395
for the FRDM-K64F as follows:
396396

397-
#. Build and flash MCUboot by following the instructions in the
398-
:ref:`mcuboot` documentation page.
399-
400-
#. Rebuild the CANopen sample with MCUboot support:
397+
#. Build the CANopenNode sample with MCUboot support:
401398

402399
.. zephyr-app-commands::
403-
:zephyr-app: samples/modules/canopennode
400+
:tool: west
401+
:app: samples/modules/canopennode
404402
:board: frdm_k64f
405403
:goals: build
406-
:gen-args: -DCONFIG_BOOTLOADER_MCUBOOT=y
404+
:west-args: --sysbuild
407405
:compact:
408406

409-
#. Sign the newly rebuilt CANopen sample binary (using either the
410-
demonstration-only RSA key from MCUboot or any other key used when
411-
building MCUboot itself):
412-
413-
.. code-block:: console
414-
415-
west sign -t imgtool --bin --no-hex -- --key mcuboot/root-rsa-2048.pem \
416-
--version 1.0.0
417-
418-
#. Flash the newly signed CANopen sample binary using west:
407+
#. Flash the newly built MCUboot and CANopen sample binaries using west:
419408

420409
.. code-block:: console
421410
422-
west flash --skip-rebuild --bin-file zephyr/zephyr.signed.bin
411+
west flash --skip-rebuild
423412
424413
#. Confirm the newly flashed firmware image using west:
425414

426415
.. code-block:: console
427416
428-
west flash --skip-rebuild --runner canopen --confirm-only
417+
west flash --skip-rebuild --domain canopennode --runner canopen --confirm-only
429418
430-
#. Finally, resign the CANopen sample binary with a new version number
431-
and perform a program download over CANopen:
419+
#. Finally, perform a program download via CANopen:
432420

433421
.. code-block:: console
434422
435-
west sign -t imgtool --bin --no-hex -- --key mcuboot/root-rsa-2048.pem \
436-
--version 1.0.1
437-
west flash --skip-rebuild --bin-file zephyr/zephyr.signed.bin \
438-
--runner canopen
423+
west flash --skip-rebuild --domain canopennode --runner canopen
439424
440425
Modifying the Object Dictionary
441426
*******************************

samples/modules/canopennode/sample.yaml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,9 @@ tests:
1818
CONFIG_FLASH_HAS_DRIVER_ENABLED
1919
platform_exclude: nucleo_h723zg nucleo_h743zi nucleo_h745zi_q nucleo_h753zi
2020
sample.modules.canopennode.program_download:
21-
build_only: true
22-
platform_exclude: native_posix native_posix_64 rcar_h3ulcb_cr7 qemu_x86 qemu_x86_64
23-
filter: dt_label_with_parent_compat_enabled("slot0_partition", "fixed-partitions") and
24-
dt_label_with_parent_compat_enabled("slot1_partition", "fixed-partitions") and
25-
dt_label_with_parent_compat_enabled("storage_partition", "fixed-partitions") and
26-
dt_chosen_enabled("zephyr,flash-controller") and
27-
CONFIG_FLASH_HAS_DRIVER_ENABLED
28-
extra_configs:
29-
- CONFIG_BOOTLOADER_MCUBOOT=y
21+
sysbuild: True
22+
platform_allow: frdm_k64f twr_ke18f
23+
integration_platforms:
24+
- frdm_k64f
3025
sample.modules.canopennode.no_storage:
3126
extra_args: CONF_FILE=prj_no_storage.conf
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SB_CONFIG_BOOTLOADER_MCUBOOT=y

0 commit comments

Comments
 (0)