Page 1 of 1

Write to flash from 2nd stage bootloader

Posted: Wed Jul 03, 2019 2:32 pm
by bewatermyfriendxd
Hello guys,

I would like to know if its possible to write to flash from 2nd stage Bootloader.
I tried using the spi_write_flash methods, but this module is compiled differently when used in bootloader-module, so all writes go into some kind of emulator instead of physical memory.

Is there another way Im not aware of?

I'll appreciate any help,
Thanks for the support

Re: Write to flash from 2nd stage bootloader

Posted: Wed Jul 03, 2019 5:13 pm
by WiFive

Re: Write to flash from 2nd stage bootloader

Posted: Thu Jul 04, 2019 12:21 am
by ESP_Angus
Hi,

You can call the functions declared in bootloader_flash.h from inside the bootloader:
https://github.com/espressif/esp-idf/bl ... lash.h#L78

Note that there are restrictions of length & alignment on these functions which are not present in the normal SPI flash API. See the comments in the header for full details.

Angus