Skip to content

Commit

Permalink
boot: main: avoid unused build warning
Browse files Browse the repository at this point in the history
In case ESP32 SoC is used, *start will get
build warning as it is not used.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
  • Loading branch information
sylvioalves committed Aug 12, 2024
1 parent 6fe259b commit 75a3d74
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions boot/zephyr/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,23 +277,23 @@ static void copy_img_to_SRAM(int slot, unsigned int hdr_offset)
*/
static void do_boot(struct boot_rsp *rsp)
{
void *start;

BOOT_LOG_INF("br_image_off = 0x%x\n", rsp->br_image_off);
BOOT_LOG_INF("ih_hdr_size = 0x%x\n", rsp->br_hdr->ih_hdr_size);

#ifdef CONFIG_SOC_FAMILY_ESPRESSIF_ESP32
int slot = (rsp->br_image_off == IMAGE0_PRIMARY_START_ADDRESS) ?
PRIMARY_SLOT : SECONDARY_SLOT;
/* Load memory segments and start from entry point */
start_cpu0_image(IMAGE_INDEX_0, slot, rsp->br_hdr->ih_hdr_size);
#else
#ifndef CONFIG_SOC_FAMILY_ESPRESSIF_ESP32
void *start;

/* Copy from the flash to HP SRAM */
copy_img_to_SRAM(0, rsp->br_hdr->ih_hdr_size);

/* Jump to entry point */
start = (void *)(SRAM_BASE_ADDRESS + rsp->br_hdr->ih_hdr_size);
((void (*)(void))start)();
#else
int slot = (rsp->br_image_off == IMAGE0_PRIMARY_START_ADDRESS) ?
PRIMARY_SLOT : SECONDARY_SLOT;
/* Load memory segments and start from entry point */
start_cpu0_image(IMAGE_INDEX_0, slot, rsp->br_hdr->ih_hdr_size);
#endif /* CONFIG_SOC_FAMILY_ESPRESSIF_ESP32 */
}

Expand Down

0 comments on commit 75a3d74

Please sign in to comment.