Hello again,
After pulling in the latest commits from the upstream git repository, my modified firmware (with SoftUART functionality) seems to cause the `.irom0.text` section to overflow when linking:
Code: Select all
LINK build/firmware.elf
xtensa-lx106-elf-ld: build/firmware.elf section `.irom0.text' will not fit in region `irom0_0_seg'
xtensa-lx106-elf-ld: region `irom0_0_seg' overflowed by 976 bytes
make: *** [build/firmware.elf] Error 1
Here is the MEMORY section of `esp8266.ld`:
Code: Select all
MEMORY
{
dport0_0_seg : org = 0x3ff00000, len = 0x10
dram0_0_seg : org = 0x3ffe8000, len = 0x14000
iram1_0_seg : org = 0x40100000, len = 0x8000
irom0_0_seg : org = 0x40209000, len = 0x87000
}
I tried to boost the size of this section ` irom0_0_seg : org = 0x40209000, len = 0x88000` and was able to compile and load the firmware. However, when entering the REPL I get this error message:
Code: Select all
The FAT filesystem starting at sector 144 with size 875 sectors appears to
be corrupted. If you had important data there, you may want to make a flash
snapshot to try to recover it. Otherwise, perform factory reprogramming
of MicroPython firmware (completely erase flash, followed by firmware
programming).
I suppose now I'm bumping up against the file system. Where and how can this be configured? Thanks.
EDIT:
So I think I found a possible solution. It turns out that `0x40209000 + 0x88000 = 0x40291000` is the new end of the firmware and the user flash space must come after that address. And according to `modesp.c` line
639:
Code: Select all
STATIC mp_obj_t esp_flash_user_start(void) {
if (IS_OTA_FIRMWARE()) {
return MP_OBJ_NEW_SMALL_INT(0x3c000 + 0x90000);
} else {
return MP_OBJ_NEW_SMALL_INT(0x90000);
}
}
It seems that these addresses are all relative to 0x40200000; so, I just changed 0x90000 to 0x91000, compiled and reloaded the firmware, and now the REPL seems to work! Is this safe or am I tampering with something that will bite me down the road?