Skip to content

skip bss loader section #1

Description

@xoviat

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions