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 <hebad@vestas.com>
This commit is contained in:
parent
6ac281887c
commit
c0fb33ab8d
|
@ -4,9 +4,6 @@ cmake_minimum_required(VERSION 3.20.0)
|
|||
|
||||
macro(app_set_runner_args)
|
||||
board_runner_args(canopen "--node-id=${CONFIG_CANOPEN_NODE_ID}")
|
||||
board_runner_args(dfu-util "--dfuse-modifiers=force:mass-erase")
|
||||
board_runner_args(pyocd "--erase")
|
||||
board_runner_args(nrfjprog "--erase")
|
||||
endmacro()
|
||||
|
||||
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
|
||||
|
|
|
@ -394,48 +394,33 @@ Building and Running for FRDM-K64F
|
|||
The sample can be rebuilt with MCUboot and program download support
|
||||
for the FRDM-K64F as follows:
|
||||
|
||||
#. Build and flash MCUboot by following the instructions in the
|
||||
:ref:`mcuboot` documentation page.
|
||||
|
||||
#. Rebuild the CANopen sample with MCUboot support:
|
||||
#. Build the CANopenNode sample with MCUboot support:
|
||||
|
||||
.. zephyr-app-commands::
|
||||
:zephyr-app: samples/modules/canopennode
|
||||
:tool: west
|
||||
:app: samples/modules/canopennode
|
||||
:board: frdm_k64f
|
||||
:goals: build
|
||||
:gen-args: -DCONFIG_BOOTLOADER_MCUBOOT=y
|
||||
:west-args: --sysbuild
|
||||
:compact:
|
||||
|
||||
#. Sign the newly rebuilt CANopen sample binary (using either the
|
||||
demonstration-only RSA key from MCUboot or any other key used when
|
||||
building MCUboot itself):
|
||||
#. Flash the newly built MCUboot and CANopen sample binaries using west:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
west sign -t imgtool --bin --no-hex -- --key mcuboot/root-rsa-2048.pem \
|
||||
--version 1.0.0
|
||||
|
||||
#. Flash the newly signed CANopen sample binary using west:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
west flash --skip-rebuild --bin-file zephyr/zephyr.signed.bin
|
||||
west flash --skip-rebuild
|
||||
|
||||
#. Confirm the newly flashed firmware image using west:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
west flash --skip-rebuild --runner canopen --confirm-only
|
||||
west flash --skip-rebuild --domain canopennode --runner canopen --confirm-only
|
||||
|
||||
#. Finally, resign the CANopen sample binary with a new version number
|
||||
and perform a program download over CANopen:
|
||||
#. Finally, perform a program download via CANopen:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
west sign -t imgtool --bin --no-hex -- --key mcuboot/root-rsa-2048.pem \
|
||||
--version 1.0.1
|
||||
west flash --skip-rebuild --bin-file zephyr/zephyr.signed.bin \
|
||||
--runner canopen
|
||||
west flash --skip-rebuild --domain canopennode --runner canopen
|
||||
|
||||
Modifying the Object Dictionary
|
||||
*******************************
|
||||
|
|
|
@ -18,14 +18,9 @@ tests:
|
|||
CONFIG_FLASH_HAS_DRIVER_ENABLED
|
||||
platform_exclude: nucleo_h723zg nucleo_h743zi nucleo_h745zi_q nucleo_h753zi
|
||||
sample.modules.canopennode.program_download:
|
||||
build_only: true
|
||||
platform_exclude: native_posix native_posix_64 rcar_h3ulcb_cr7 qemu_x86 qemu_x86_64
|
||||
filter: dt_label_with_parent_compat_enabled("slot0_partition", "fixed-partitions") and
|
||||
dt_label_with_parent_compat_enabled("slot1_partition", "fixed-partitions") and
|
||||
dt_label_with_parent_compat_enabled("storage_partition", "fixed-partitions") and
|
||||
dt_chosen_enabled("zephyr,flash-controller") and
|
||||
CONFIG_FLASH_HAS_DRIVER_ENABLED
|
||||
extra_configs:
|
||||
- CONFIG_BOOTLOADER_MCUBOOT=y
|
||||
sysbuild: True
|
||||
platform_allow: frdm_k64f twr_ke18f
|
||||
integration_platforms:
|
||||
- frdm_k64f
|
||||
sample.modules.canopennode.no_storage:
|
||||
extra_args: CONF_FILE=prj_no_storage.conf
|
||||
|
|
1
samples/modules/canopennode/sysbuild.conf
Normal file
1
samples/modules/canopennode/sysbuild.conf
Normal file
|
@ -0,0 +1 @@
|
|||
SB_CONFIG_BOOTLOADER_MCUBOOT=y
|
Loading…
Reference in a new issue