Skip to content

Commit

Permalink
bootloader_support: Adds API to detect Factory reset has happened
Browse files Browse the repository at this point in the history
  • Loading branch information
KonstantinKondrashov committed Mar 21, 2023
1 parent c52b175 commit 3c2e83c
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 14 deletions.
6 changes: 4 additions & 2 deletions components/esp_system/ld/esp32/memory.ld.in
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@
#define CONFIG_BTDM_RESERVE_DRAM 0
#endif

#if CONFIG_BOOTLOADER_RESERVE_RTC_MEM
#ifdef CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC
#define ESP_BOOTLOADER_RESERVE_RTC (CONFIG_BOOTLOADER_RESERVE_RTC_SIZE + CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC_SIZE)
#elif defined(CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP)
#else
#define ESP_BOOTLOADER_RESERVE_RTC (CONFIG_BOOTLOADER_RESERVE_RTC_SIZE)
#endif // not CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC
#else
#define ESP_BOOTLOADER_RESERVE_RTC 0
#endif
#endif // not CONFIG_BOOTLOADER_RESERVE_RTC_MEM

#if defined(CONFIG_ESP32_USE_FIXED_STATIC_RAM_SIZE)

Expand Down
6 changes: 4 additions & 2 deletions components/esp_system/ld/esp32c3/memory.ld.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@
#include "sdkconfig.h"
#include "ld.common"

#if CONFIG_BOOTLOADER_RESERVE_RTC_MEM
#ifdef CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC
#define ESP_BOOTLOADER_RESERVE_RTC (CONFIG_BOOTLOADER_RESERVE_RTC_SIZE + CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC_SIZE)
#elif defined(CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP)
#else
#define ESP_BOOTLOADER_RESERVE_RTC (CONFIG_BOOTLOADER_RESERVE_RTC_SIZE)
#endif // not CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC
#else
#define ESP_BOOTLOADER_RESERVE_RTC 0
#endif
#endif // not CONFIG_BOOTLOADER_RESERVE_RTC_MEM

/**
* physical memory is mapped twice to the vritual address (IRAM and DRAM).
Expand Down
6 changes: 4 additions & 2 deletions components/esp_system/ld/esp32c6/memory.ld.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@
#include "sdkconfig.h"
#include "ld.common"

#if CONFIG_BOOTLOADER_RESERVE_RTC_MEM
#ifdef CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC
#define ESP_BOOTLOADER_RESERVE_RTC (CONFIG_BOOTLOADER_RESERVE_RTC_SIZE + CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC_SIZE)
#elif defined(CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP)
#else
#define ESP_BOOTLOADER_RESERVE_RTC (CONFIG_BOOTLOADER_RESERVE_RTC_SIZE)
#endif // not CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC
#else
#define ESP_BOOTLOADER_RESERVE_RTC 0
#endif
#endif // not CONFIG_BOOTLOADER_RESERVE_RTC_MEM

/**
* physical memory is mapped twice to the vritual address (IRAM and DRAM).
Expand Down
6 changes: 4 additions & 2 deletions components/esp_system/ld/esp32h2/memory.ld.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@
#include "sdkconfig.h"
#include "ld.common"

#if CONFIG_BOOTLOADER_RESERVE_RTC_MEM
#ifdef CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC
#define ESP_BOOTLOADER_RESERVE_RTC (CONFIG_BOOTLOADER_RESERVE_RTC_SIZE + CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC_SIZE)
#elif defined(CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP)
#else
#define ESP_BOOTLOADER_RESERVE_RTC (CONFIG_BOOTLOADER_RESERVE_RTC_SIZE)
#endif // not CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC
#else
#define ESP_BOOTLOADER_RESERVE_RTC 0
#endif
#endif // not CONFIG_BOOTLOADER_RESERVE_RTC_MEM

/**
* physical memory is mapped twice to the vritual address (IRAM and DRAM).
Expand Down
6 changes: 4 additions & 2 deletions components/esp_system/ld/esp32h4/memory.ld.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@
#include "sdkconfig.h"
#include "ld.common"

#if CONFIG_BOOTLOADER_RESERVE_RTC_MEM
#ifdef CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC
#define ESP_BOOTLOADER_RESERVE_RTC (CONFIG_BOOTLOADER_RESERVE_RTC_SIZE + CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC_SIZE)
#elif defined(CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP)
#else
#define ESP_BOOTLOADER_RESERVE_RTC (CONFIG_BOOTLOADER_RESERVE_RTC_SIZE)
#endif // not CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC
#else
#define ESP_BOOTLOADER_RESERVE_RTC 0
#endif
#endif // not CONFIG_BOOTLOADER_RESERVE_RTC_MEM

#define SRAM_IRAM_START 0x4037C000
#define SRAM_DRAM_START 0x3FC7C000
Expand Down
6 changes: 4 additions & 2 deletions components/esp_system/ld/esp32s2/memory.ld.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@
#include "sdkconfig.h"
#include "ld.common"

#if CONFIG_BOOTLOADER_RESERVE_RTC_MEM
#ifdef CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC
#define ESP_BOOTLOADER_RESERVE_RTC (CONFIG_BOOTLOADER_RESERVE_RTC_SIZE + CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC_SIZE)
#elif defined(CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP)
#else
#define ESP_BOOTLOADER_RESERVE_RTC (CONFIG_BOOTLOADER_RESERVE_RTC_SIZE)
#endif // not CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC
#else
#define ESP_BOOTLOADER_RESERVE_RTC 0
#endif
#endif // not CONFIG_BOOTLOADER_RESERVE_RTC_MEM

#ifdef CONFIG_ESP32S2_INSTRUCTION_CACHE_8KB
#define CONFIG_ESP32S2_INSTRUCTION_CACHE_SIZE 0x2000
Expand Down
6 changes: 4 additions & 2 deletions components/esp_system/ld/esp32s3/memory.ld.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@
#include "sdkconfig.h"
#include "ld.common"

#if CONFIG_BOOTLOADER_RESERVE_RTC_MEM
#ifdef CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC
#define ESP_BOOTLOADER_RESERVE_RTC (CONFIG_BOOTLOADER_RESERVE_RTC_SIZE + CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC_SIZE)
#elif defined(CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP)
#else
#define ESP_BOOTLOADER_RESERVE_RTC (CONFIG_BOOTLOADER_RESERVE_RTC_SIZE)
#endif // not CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC
#else
#define ESP_BOOTLOADER_RESERVE_RTC 0
#endif
#endif // not CONFIG_BOOTLOADER_RESERVE_RTC_MEM

/*
* 40370000 <- IRAM/Icache -> 40378000 <- D/IRAM (I) -> 403E0000
Expand Down

0 comments on commit 3c2e83c

Please sign in to comment.