Discuss here different C compiler set ups, and compiling executables for the ESP8266

User avatar
By Patriko
#16222 Hi!

Is it possible to use a small app that is flashed into begining of user application space (according to this memory map: https://github.com/esp8266/esp8266-wiki/wiki/Memory-Map) and it just check for an update (e.g. from http server), downloads it and writes from specified sectors (acting like a bootloader) and if e.g. checksum is correct, starts the app?

The problem with OTA provided by espressif is that it divides memory into two equal size areas and bigger apps doesn't fit there.

Thanks for any suggestions! :)
User avatar
By tve
#18221 Assuming that your code fits into one partition and you need the extra space for data that you access from flash explicitly, not memory-mapped, the the following scheme might work:
    start with the core part of your app in partition 1 and the extra data in partition 2
    step 1 of the upgrade is to flash the new version of your app into partition 2, your app continues to run but in "upgrade mode" where it has limited functionality due to the now missing extra data
    restart the esp8266 into the new code in partition 2, it comes up in "upgrade mode" since the extra data isn't there
    upload the extra data into partition 1, now your new app is fully functional
It's a bit convoluted but could be made to work... Good luck!
User avatar
By projectgus
#18347
Patriko wrote:Is it possible to use a small app that is flashed into begining of user application space (according to this memory map: https://github.com/esp8266/esp8266-wiki/wiki/Memory-Map) and it just check for an update (e.g. from http server),


How large/complex is your app? Just the wifi+IP+SSL (assuming you want secure updates) stacks are all pretty sizable, so any wireless bootloader may be quite large by itself?

Larger flash sizes seem to be quite common with ESP now, is that another way to solve the problem?