Option 1: Patch flexe (Recommended — fixes the emulator)
Add a check in loader_parse_image() to skip BSS segments. Since flexe already calls mem_reset() which zeroes all SRAM before loading, the BSS is already initialized.
In flexe/src/loader.c, around the mem_load call:
/* BSS segment: addr 0 means zero-initialize 'length' bytes in DRAM.
flexe's mem_reset() already zeroed all SRAM, so we can skip it. */
int is_bss = (load_addr == 0x00000000u);
if (!(skip_drom && is_drom) && !is_bss && mem_load(mem, load_addr, buf, data_len) != 0) {
/* ... existing error handling ... */
}
This is a one-line change that makes flexe correctly handle standard ESP32 app images produced by both esptool.py and espflash.
Note: confirmed working on espflash-generated binary.
Option 1: Patch flexe (Recommended — fixes the emulator)
Add a check in loader_parse_image() to skip BSS segments. Since flexe already calls mem_reset() which zeroes all SRAM before loading, the BSS is already initialized.
In flexe/src/loader.c, around the mem_load call:
This is a one-line change that makes flexe correctly handle standard ESP32 app images produced by both esptool.py and espflash.
Note: confirmed working on espflash-generated binary.