From caf416218623d6778b3d0c2fe12ee08135c2d126 Mon Sep 17 00:00:00 2001 From: xengineering Date: Sat, 24 May 2025 11:18:38 +0200 Subject: Remove installation step Using the installation step to copy selected artifacts into one folder was anyway a hack. This commit shows that the complexity can be reduced by adding copy targets. The `build/artifacts` folder contains the selected artifacts, they are always up to date, the user does not have to call the install step separately and the target definitions do not require install-related keyword arguments. --- artifacts/meson.build | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 artifacts/meson.build (limited to 'artifacts') diff --git a/artifacts/meson.build b/artifacts/meson.build new file mode 100644 index 0000000..ea6fc39 --- /dev/null +++ b/artifacts/meson.build @@ -0,0 +1,22 @@ +artifacts = [ + index_html, + css, + schematic, + bom, + simulation, + bootloader, + application_signed, +] + +foreach artifact : artifacts + custom_target( + output: [fs.name(artifact.full_path())], + command: [ + cp, + artifact.full_path(), + meson.current_build_dir(), + ], + depends: artifact, + build_by_default: true, + ) +endforeach -- cgit v1.2.3-70-g09d2 From fc3b3cbf7fecee7226f249f7b62cf36aa82a545a Mon Sep 17 00:00:00 2001 From: xengineering Date: Sat, 24 May 2025 11:20:08 +0200 Subject: Provide `factory-image.bin` with Meson This automatically creates `build/artifacts/factory-image.bin` with the Meson build system. The resulting file can simply be moved to the virtual file system of the `nucleo_f767zi` board to flash bootloader and application making the board ready for operation and remote updates. --- artifacts/meson.build | 1 + fw/btl/meson.build | 1 - fw/meson.build | 14 ++++++++++++++ tools/meson.build | 1 + 4 files changed, 16 insertions(+), 1 deletion(-) (limited to 'artifacts') diff --git a/artifacts/meson.build b/artifacts/meson.build index ea6fc39..9e14232 100644 --- a/artifacts/meson.build +++ b/artifacts/meson.build @@ -6,6 +6,7 @@ artifacts = [ simulation, bootloader, application_signed, + factory_image, ] foreach artifact : artifacts diff --git a/fw/btl/meson.build b/fw/btl/meson.build index 2ba1cf4..204fe20 100644 --- a/fw/btl/meson.build +++ b/fw/btl/meson.build @@ -22,5 +22,4 @@ bootloader = custom_target( '--binary-name', 'zephyr.bin', '--target-name', 'bootloader.bin', ], - build_by_default: true, ) diff --git a/fw/meson.build b/fw/meson.build index 8194827..8f45d5b 100644 --- a/fw/meson.build +++ b/fw/meson.build @@ -7,3 +7,17 @@ subdir('rtos') subdir('app') subdir('btl') subdir('sim') + +factory_image = custom_target( + output: ['factory-image.bin'], + command: [ + make_factory_image, + '--bootloader', bootloader, + '--application', application_signed_confirmed, + '--factory-image', '@OUTPUT@', + ], + depends: [ + bootloader, + application_signed_confirmed, + ], +) diff --git a/tools/meson.build b/tools/meson.build index 85ddbb3..f58c54b 100644 --- a/tools/meson.build +++ b/tools/meson.build @@ -1,2 +1,3 @@ configure_zephyr = meson.current_source_dir() / 'configure_zephyr.py' build_zephyr = meson.current_source_dir() / 'build_zephyr.py' +make_factory_image = meson.current_source_dir() / 'make_factory_image.py' -- cgit v1.2.3-70-g09d2 From bf8d20fe4d8d3369dd7f63e95f53613dbbfa3603 Mon Sep 17 00:00:00 2001 From: xengineering Date: Sat, 24 May 2025 11:20:28 +0200 Subject: artifacts: Provide `{factory,update}-image.bin` This presents only the `factory-image.bin` and `update-image.bin` for MCU firmware. A separate bootloader image is not available. The reason is that the `factory-image.bin` is used during production once (flashing at default boot address) to set up the device. Later only the `update-image.bin` of future versions would be required to remotely update devices. --- artifacts/meson.build | 3 +-- fw/app/meson.build | 4 ++-- web/index.html | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) (limited to 'artifacts') diff --git a/artifacts/meson.build b/artifacts/meson.build index 9e14232..278c695 100644 --- a/artifacts/meson.build +++ b/artifacts/meson.build @@ -4,8 +4,7 @@ artifacts = [ schematic, bom, simulation, - bootloader, - application_signed, + update_image, factory_image, ] diff --git a/fw/app/meson.build b/fw/app/meson.build index 27b4a41..6665fe4 100644 --- a/fw/app/meson.build +++ b/fw/app/meson.build @@ -28,8 +28,8 @@ version = '0.0.0' header_size = '0x200' slot_size = '0xc0000' -application_signed = custom_target( - output: ['application.signed.bin'], +update_image = custom_target( + output: ['update-image.bin'], command: [ imgtool, 'sign', diff --git a/web/index.html b/web/index.html index 1f23096..e5bf005 100644 --- a/web/index.html +++ b/web/index.html @@ -18,8 +18,8 @@

Firmware

-- cgit v1.2.3-70-g09d2