Write to flash from 2nd stage bootloader

bewatermyfriendxd
Posts: 21
Joined: Wed Apr 03, 2019 1:29 pm

Write to flash from 2nd stage bootloader

Postby bewatermyfriendxd » Wed Jul 03, 2019 2:32 pm

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


ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: Write to flash from 2nd stage bootloader

Postby ESP_Angus » Thu Jul 04, 2019 12:21 am

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

Who is online

Users browsing this forum: Baidu [Spider], Google [Bot] and 194 guests