diff --git a/README.md b/README.md index df9f2f2..4a132b8 100644 --- a/README.md +++ b/README.md @@ -17,14 +17,14 @@ To try out this example app: ```bash mkdir zephyr-workspace cd zephyr-workspace - west init -m https://github.com/memfault/stm32h7b3i_dk + west init -m https://github.com/memfault/zephyr-stm32h7b0-example west update ``` 3. Build the example app: ```bash - west build stm32h7b3i_dk --sysbuild + west build --sysbuild --board stm32h7b3i_dk --pristine=always zephyr-stm32h7b0-example ``` `--sysbuild` will build the MCUboot image as well, which will also get @@ -42,7 +42,7 @@ To try out this example app: ```bash # select the correct serial port for your system - pyserial-miniterm --raw /dev/serial/by-id/TODO 115200 + pyserial-miniterm --raw /dev/serial/by-id/usb-STMicroelectronics_STLINK-V3_002000353331510933323639-if02 115200 uart:~$ mflt get_device_info [00:09:21.911,000] mflt: S/N: DEMOSERIAL diff --git a/boards/stm32h7b0.conf b/boards/stm32h7b0.conf deleted file mode 100644 index a72fdf3..0000000 --- a/boards/stm32h7b0.conf +++ /dev/null @@ -1,11 +0,0 @@ -CONFIG_WIFI=y - -CONFIG_NETWORKING=y -CONFIG_NET_L2_ETHERNET=y - -CONFIG_NET_IPV6=n -CONFIG_NET_IPV4=y -CONFIG_NET_DHCPV4=y -CONFIG_ESP32_WIFI_STA_AUTO_DHCPV4=y - -CONFIG_NET_LOG=y diff --git a/boards/stm32h7b0.overlay b/boards/stm32h7b0.overlay deleted file mode 100644 index b417db0..0000000 --- a/boards/stm32h7b0.overlay +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&wifi { - status = "okay"; -}; - -&coretemp { - status = "okay"; -}; diff --git a/boards/stm32h7b3i_dk.conf b/boards/stm32h7b3i_dk.conf new file mode 100644 index 0000000..e69de29 diff --git a/boards/stm32h7b3i_dk.overlay b/boards/stm32h7b3i_dk.overlay new file mode 100644 index 0000000..72ddf98 --- /dev/null +++ b/boards/stm32h7b3i_dk.overlay @@ -0,0 +1,55 @@ + / { + chosen { + zephyr,code-partition = &slot0_partition; + }; + aliases { + die-temp0 = &die_temp; + }; +}; + +&die_temp { + status = "okay"; +}; + +&adc2 { + pinctrl-0 = <&adc2_inp0_pc2_c>; + pinctrl-names = "default"; + st,adc-clock-source = ; + st,adc-prescaler = <4>; + status = "okay"; +}; + +&flash0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x00000000 0x00010000>; + read-only; + }; + /* + * The flash starting at 0x00010000 and ending at + * 0x0001ffff (sectors 16-31) is reserved for use + * by the application. + */ + storage_partition: partition@1e000 { + label = "storage"; + reg = <0x0001e000 0x00002000>; + }; + slot0_partition: partition@20000 { + label = "image-0"; + reg = <0x00020000 0x00060000>; + }; + slot1_partition: partition@80000 { + label = "image-1"; + reg = <0x00080000 0x00060000>; + }; + scratch_partition: partition@e0000 { + label = "image-scratch"; + reg = <0x000e0000 0x00020000>; + }; + }; +}; diff --git a/partition.overlay b/partition.overlay new file mode 100644 index 0000000..e69de29 diff --git a/src/main.c b/src/main.c index 5c941c2..cf5b144 100644 --- a/src/main.c +++ b/src/main.c @@ -46,7 +46,6 @@ int main(void) { printk("\n" MEMFAULT_BANNER_COLORIZED); memfault_device_info_dump(); - memfault_zephyr_port_install_root_certs(); return 0; } diff --git a/sysbuild.conf b/sysbuild.conf new file mode 100644 index 0000000..92042e4 --- /dev/null +++ b/sysbuild.conf @@ -0,0 +1,4 @@ +# Sysbuild configuration file. + +# Enable MCUboot per default for this sample. +SB_CONFIG_BOOTLOADER_MCUBOOT=y diff --git a/sysbuild/mcuboot.conf b/sysbuild/mcuboot.conf deleted file mode 100644 index 8d40ef2..0000000 --- a/sysbuild/mcuboot.conf +++ /dev/null @@ -1,2 +0,0 @@ -# Enable debug logs for testing -CONFIG_MCUBOOT_LOG_LEVEL_DBG=y diff --git a/sysbuild/mcuboot/boards/stm32h7b3i_dk.overlay b/sysbuild/mcuboot/boards/stm32h7b3i_dk.overlay new file mode 100644 index 0000000..ffe847b --- /dev/null +++ b/sysbuild/mcuboot/boards/stm32h7b3i_dk.overlay @@ -0,0 +1,7 @@ +#include "../../../boards/stm32h7b3i_dk.overlay" + +/ { + chosen { + zephyr,code-partition = &boot_partition; + }; +}; diff --git a/sysbuild/mcuboot/prj.conf b/sysbuild/mcuboot/prj.conf new file mode 100644 index 0000000..f39df06 --- /dev/null +++ b/sysbuild/mcuboot/prj.conf @@ -0,0 +1,9 @@ +# Enable debug logs for testing +CONFIG_MCUBOOT_LOG_LEVEL_DBG=y + +CONFIG_MCUBOOT_IMG_MANAGER=y +CONFIG_IMG_MANAGER=y +CONFIG_FLASH=y +CONFIG_FLASH_PAGE_LAYOUT=y +CONFIG_FLASH_MAP=y +CONFIG_STREAM_FLASH=y diff --git a/west.yml b/west.yml index 19670ea..cf88851 100644 --- a/west.yml +++ b/west.yml @@ -8,7 +8,7 @@ manifest: name-allowlist: - cmsis - hal_stm32 - # - mbedtls + - mbedtls - mcuboot - picolibc