Skip to content

Commit

Permalink
Place Memfault reboot tracking in backup SRAM
Browse files Browse the repository at this point in the history
This should ensure the reboot tracking structure stays in the same
location through an OTA, where the zephyr `.noinit` region can move
(since the `.noinit` structure is placed after `.bss` / `.data`, which
can change in size from version to version). Note that an absolute
address, via DTS overlay, would be required if other data is placed into
the `BACKUP_SRAM` output section, to avoid accidentally relocating the
structure.
  • Loading branch information
noahp committed Aug 4, 2024
1 parent ceb5459 commit b6153a9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
5 changes: 5 additions & 0 deletions boards/stm32h7b3i_dk.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Enable backup SRAM for storing reboot reason
CONFIG_STM32_BACKUP_SRAM=y

# Place the reboot reason structure in the backup SRAM output section
CONFIG_MEMFAULT_REBOOT_TRACKING_REGION="BACKUP_SRAM"
6 changes: 6 additions & 0 deletions boards/stm32h7b3i_dk.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
status = "okay";
};

/* Enable backup SRAM to store reboot reason through OTA- the location of the
reboot reason structure should be fixed from version to version */
&backup_sram {
status = "okay";
};

&adc2 {
pinctrl-0 = <&adc2_inp0_pc2_c>;
pinctrl-names = "default";
Expand Down
5 changes: 0 additions & 5 deletions config/memfault_platform_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@
extern "C" {
#endif

#if defined(CONFIG_SOC_FAMILY_ESP32)
#define ZEPHYR_DATA_REGION_START _data_start
#define ZEPHYR_DATA_REGION_END _data_end
#endif

#ifdef __cplusplus
}
#endif

0 comments on commit b6153a9

Please sign in to comment.