From 382bbbd4224f65ce6c081431db735d9567a0037a Mon Sep 17 00:00:00 2001 From: "Miguel I." Date: Sun, 7 Sep 2025 14:56:46 +0200 Subject: [PATCH] Created static partitions --- CMakeLists.txt | 2 -- drivers/battery_adc/battery_adc.c | 1 + pm_static.yml | 54 +++++++++++++++++++++++++++++++ sysbuild/mcuboot.conf | 2 ++ 4 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 pm_static.yml diff --git a/CMakeLists.txt b/CMakeLists.txt index 4434419..3d46b29 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,6 +26,4 @@ target_include_directories(app PRIVATE drivers/timer_count ) -test_sysbuild() - target_sources(app PRIVATE src/main.c) \ No newline at end of file diff --git a/drivers/battery_adc/battery_adc.c b/drivers/battery_adc/battery_adc.c index 83edca5..cfbd0c0 100644 --- a/drivers/battery_adc/battery_adc.c +++ b/drivers/battery_adc/battery_adc.c @@ -30,6 +30,7 @@ int battery_adc_init(void) { if(ret){ return ret; } + return 0; } int battery_measure_mv(int32_t *mv_out) { diff --git a/pm_static.yml b/pm_static.yml new file mode 100644 index 0000000..c9dcd62 --- /dev/null +++ b/pm_static.yml @@ -0,0 +1,54 @@ +mcuboot: + address: 0x0 + end_address: 0x10000 + region: flash_primary + size: 0x10000 + +mcuboot_pad: + address: 0x10000 + end_address: 0x10200 + placement: + before: mcuboot_primary_app + region: flash_primary + size: 0x200 + +mcuboot_primary: + address: 0x10000 + end_address: 0x36000 + region: flash_primary + size: 0x26000 + +mcuboot_primary_app: + address: 0x10200 + end_address: 0x36000 + region: flash_primary + size: 0x25e00 + +mcuboot_secondary: + address: 0x36000 + end_address: 0x7c000 + span: [mcuboot_secondary_pad, mcuboot_secondary_app] + region: flash_primary + size: 0x26000 + +mcuboot_secondary_app: + address: 0x36200 + end_address: 0x7c000 + placement: + after: [mcuboot_secondary_pad] + region: flash_primary + size: 0x25e00 + +mcuboot_secondary_pad: + address: 0x36000 + end_address: 0x36200 + placement: + after: [mcuboot_primary] + region: flash_primary + size: 0x200 + +storage: + address: 0x7c000 + end_address: 0x80000 + region: flash_primary + size: 0x4000 \ No newline at end of file diff --git a/sysbuild/mcuboot.conf b/sysbuild/mcuboot.conf index 01e4528..29e9089 100644 --- a/sysbuild/mcuboot.conf +++ b/sysbuild/mcuboot.conf @@ -7,6 +7,8 @@ CONFIG_MCUBOOT_DOWNGRADE_PREVENTION=y # STEP 3.1 - Increase flash space for MCUboot child image, to fit USB drivers CONFIG_PM_PARTITION_SIZE_MCUBOOT=0x10000 +CONFIG_MCUBOOT_GENERATE_UNSIGNED_IMAGE=y + CONFIG_MCUBOOT_SERIAL=y CONFIG_BOOT_SERIAL_CDC_ACM=y CONFIG_MCUBOOT_INDICATION_LED=y