diff options
author | xengineering <me@xengineering.eu> | 2025-04-12 11:33:07 +0200 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2025-04-12 11:33:07 +0200 |
commit | ddcf8559d4fbb9bd6942ac46d5c4970ef08b16d1 (patch) | |
tree | ee0873b4d7b0b10486a90ffab72ae4548434bf81 | |
parent | d9a9ea56e6b733a6b054e662d5d4b0ce015a219c (diff) | |
download | iot-contact-ddcf8559d4fbb9bd6942ac46d5c4970ef08b16d1.tar iot-contact-ddcf8559d4fbb9bd6942ac46d5c4970ef08b16d1.tar.zst iot-contact-ddcf8559d4fbb9bd6942ac46d5c4970ef08b16d1.zip |
fw: Add flash and erase targets
These targets are added:
- fw/erase
- fw/app/flash
- fw/btl/flash
They make it easier to perform a mass-erase, flashing of the bootloader
and flashing of the application for development.
-rw-r--r-- | fw/app/meson.build | 14 | ||||
-rw-r--r-- | fw/btl/meson.build | 14 | ||||
-rw-r--r-- | fw/meson.build | 11 |
3 files changed, 39 insertions, 0 deletions
diff --git a/fw/app/meson.build b/fw/app/meson.build index 8d84209..ddd5aa6 100644 --- a/fw/app/meson.build +++ b/fw/app/meson.build @@ -43,3 +43,17 @@ application_signed = custom_target( install: true, install_dir: '/', ) + +flash_application = custom_target( + build_always_stale: true, + build_by_default: false, + command: [ + 'st-flash', + '--connect-under-reset', + 'write', + meson.current_build_dir() / 'application.signed.bin', + '0x8040000', + ], + depends: application_signed, + output: ['flash'], +) diff --git a/fw/btl/meson.build b/fw/btl/meson.build index c22ba3c..8ca1eb3 100644 --- a/fw/btl/meson.build +++ b/fw/btl/meson.build @@ -26,3 +26,17 @@ bootloader = custom_target('bootloader', install: true, install_dir: '/', ) + +flash_bootloader = custom_target( + build_always_stale: true, + build_by_default: false, + command: [ + 'st-flash', + '--connect-under-reset', + 'write', + meson.current_build_dir() / 'bootloader.bin', + '0x8000000', + ], + depends: bootloader, + output: ['flash'], +) diff --git a/fw/meson.build b/fw/meson.build index 8194827..f61058c 100644 --- a/fw/meson.build +++ b/fw/meson.build @@ -7,3 +7,14 @@ subdir('rtos') subdir('app') subdir('btl') subdir('sim') + +erase = custom_target( + build_always_stale: true, + build_by_default: false, + command: [ + 'st-flash', + '--connect-under-reset', + 'erase', + ], + output: ['erase'], +) |