-->
Page 1 of 1

Custom OTA for apps to big for espressif ota

PostPosted: Fri May 01, 2015 3:32 pm
by Patriko
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! :)

Re: Custom OTA for apps to big for espressif ota

PostPosted: Sat May 23, 2015 2:30 am
by tve
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!

Re: Custom OTA for apps to big for espressif ota

PostPosted: Sun May 24, 2015 5:12 pm
by projectgus
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?