mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 23:40:19 +08:00
risc-v/esp32h2: Fix getting the flash mappings by openocd-esp32
This adds new fields to the metadata section used by MCUBoot. The openocd-esp32 project requires these fields to properly map the flash segments and enable using SW breakpoints and flash through openocd-esp32. Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
This commit is contained in:
committed by
Xiang Xiao
parent
cb25b45d92
commit
956915ff97
@@ -74,7 +74,7 @@ MEMORY
|
|||||||
* signing of firmware image.
|
* signing of firmware image.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
metadata (RX) : org = CONFIG_ESPRESSIF_APP_MCUBOOT_HEADER_SIZE, len = 0x20
|
metadata (RX) : org = CONFIG_ESPRESSIF_APP_MCUBOOT_HEADER_SIZE, len = 0x60
|
||||||
ROM (RX) : org = ORIGIN(metadata) + LENGTH(metadata),
|
ROM (RX) : org = ORIGIN(metadata) + LENGTH(metadata),
|
||||||
len = FLASH_SIZE - ORIGIN(ROM)
|
len = FLASH_SIZE - ORIGIN(ROM)
|
||||||
#elif defined (CONFIG_ESPRESSIF_SIMPLE_BOOT)
|
#elif defined (CONFIG_ESPRESSIF_SIMPLE_BOOT)
|
||||||
|
|||||||
@@ -31,6 +31,11 @@ SECTIONS
|
|||||||
#ifdef CONFIG_ESPRESSIF_BOOTLOADER_MCUBOOT
|
#ifdef CONFIG_ESPRESSIF_BOOTLOADER_MCUBOOT
|
||||||
.metadata :
|
.metadata :
|
||||||
{
|
{
|
||||||
|
/* The following metadata refers to the to MCUboot's struct
|
||||||
|
* esp_image_load_header defined at the following commit:
|
||||||
|
* https://github.com/mcu-tools/mcuboot/blob/cd22b693da426826e0255f8ee5b18d7360d9bc8f/boot/espressif/hal/include/esp_mcuboot_image.h
|
||||||
|
*/
|
||||||
|
|
||||||
/* Magic for load header */
|
/* Magic for load header */
|
||||||
|
|
||||||
LONG(0xace637d3)
|
LONG(0xace637d3)
|
||||||
@@ -58,6 +63,46 @@ SECTIONS
|
|||||||
LONG(ADDR(.dram0.data))
|
LONG(ADDR(.dram0.data))
|
||||||
LONG(LOADADDR(.dram0.data))
|
LONG(LOADADDR(.dram0.data))
|
||||||
LONG(SIZEOF(.dram0.data))
|
LONG(SIZEOF(.dram0.data))
|
||||||
|
|
||||||
|
/* RTC_IRAM metadata:
|
||||||
|
* - Destination address (VMA) for RTC_IRAM region
|
||||||
|
* - Flash offset (LMA) for start of RTC_IRAM region
|
||||||
|
* - Size of RTC_IRAM region
|
||||||
|
*/
|
||||||
|
|
||||||
|
LONG(ADDR(.rtc.text))
|
||||||
|
LONG(LOADADDR(.rtc.text))
|
||||||
|
LONG(SIZEOF(.rtc.text))
|
||||||
|
|
||||||
|
/* RTC_DRAM metadata:
|
||||||
|
* - Destination address (VMA) for RTC_DRAM region
|
||||||
|
* - Flash offset (LMA) for start of RTC_DRAM region
|
||||||
|
* - Size of RTC_DRAM region
|
||||||
|
*/
|
||||||
|
|
||||||
|
LONG(ADDR(.rtc.data))
|
||||||
|
LONG(LOADADDR(.rtc.data))
|
||||||
|
LONG(SIZEOF(.rtc.data))
|
||||||
|
|
||||||
|
/* IROM metadata:
|
||||||
|
* - Destination address (VMA) for IROM region
|
||||||
|
* - Flash offset (LMA) for start of IROM region
|
||||||
|
* - Size of IROM region
|
||||||
|
*/
|
||||||
|
|
||||||
|
LONG(ADDR(.flash.text))
|
||||||
|
LONG(LOADADDR(.flash.text))
|
||||||
|
LONG(SIZEOF(.flash.text))
|
||||||
|
|
||||||
|
/* DROM metadata:
|
||||||
|
* - Destination address (VMA) for DROM region
|
||||||
|
* - Flash offset (LMA) for start of DROM region
|
||||||
|
* - Size of DROM region
|
||||||
|
*/
|
||||||
|
|
||||||
|
LONG(ADDR(.flash.rodata))
|
||||||
|
LONG(LOADADDR(.flash.rodata))
|
||||||
|
LONG(LOADADDR(.flash.rodata) + SIZEOF(.flash.rodata) - LOADADDR(.flash.rodata))
|
||||||
} >metadata
|
} >metadata
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user