Skip to content

Commit e22c5f3

Browse files
committed
mcuboot: loader: use flash rom functions
Modify the loader to use only flash ROM functions. This allows mcuboot stage not to depend on multithreading or spi flash driver. Signed-off-by: Sylvio Alves <[email protected]>
1 parent 5527588 commit e22c5f3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

zephyr/port/boot/esp_image_loader.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@
6262
static int load_segment(const struct flash_area *fap, uint32_t data_addr,
6363
uint32_t data_len, uint32_t load_addr)
6464
{
65-
const uint32_t *data = (const uint32_t *)bootloader_mmap((fap->fa_off + data_addr), data_len);
65+
const uint32_t *data = (const uint32_t *)bootloader_mmap_rom((fap->fa_off + data_addr), data_len);
6666
if (!data) {
6767
BOOT_LOG_ERR("%s: Bootloader mmap failed", __func__);
6868
return -1;
6969
}
7070
memcpy((void *)load_addr, data, data_len);
71-
bootloader_munmap(data);
71+
bootloader_munmap_rom(data);
7272
return 0;
7373
}
7474

@@ -88,11 +88,11 @@ void esp_app_image_load(int image_index, int slot,
8888
BOOT_LOG_INF("Loading image %d - slot %d from flash, area id: %d",
8989
image_index, slot, area_id);
9090

91-
const uint32_t *data = (const uint32_t *)bootloader_mmap((fap->fa_off + hdr_offset),
91+
const uint32_t *data = (const uint32_t *)bootloader_mmap_rom((fap->fa_off + hdr_offset),
9292
sizeof(esp_image_load_header_t));
9393
esp_image_load_header_t load_header = {0};
9494
memcpy((void *)&load_header, data, sizeof(esp_image_load_header_t));
95-
bootloader_munmap(data);
95+
bootloader_munmap_rom(data);
9696

9797
if (load_header.header_magic != ESP_LOAD_HEADER_MAGIC) {
9898
BOOT_LOG_ERR("Load header magic verification failed. Aborting");

0 commit comments

Comments
 (0)