feat(bootloader): Support recovery bootloader for ESP32S31 and ESP32P4

This commit is contained in:
Konstantin Kondrashov
2026-05-08 16:45:14 +03:00
parent d9cfb2908a
commit e8609f59a8
24 changed files with 159 additions and 73 deletions
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2023-2026 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -451,6 +451,30 @@ void intr_matrix_set(int cpu_no, uint32_t model_num, uint32_t intr_num);
#define ETS_MEM_BAR() asm volatile ( "" : : : "memory" )
/**
* @brief Returns the offset from which the bootloader image is used to load.
*
* The offset can point to either the PRIMARY or RECOVERY bootloader.
*
* @note The bootloader offset variable in ROM is stored in a memory that will be reclaimed by heap component.
* Read it before the heap is initialized, otherwise it may return an invalid value.
*
* @return The offset of the active bootloader.
*/
uint32_t ets_get_bootloader_offset(void);
/**
* @brief Sets the offset from which the bootloader image is used to load.
*
* The offset can point to either the PRIMARY or RECOVERY bootloader.
*
* @note The bootloader offset variable in ROM is stored in a memory that will be reclaimed by heap component.
* Setting it after the heap is initialized, may corrupt the heap memory.
*
* @param offset The offset value to set for the active bootloader.
*/
void ets_set_bootloader_offset(uint32_t offset);
/**
* @}
*/