Sming - Open Source framework for high efficiency native ESP8266 development

User avatar
By anakod
#17481 Sming OTA update is different:
    * Format spiffs area
    * Download all requried files in that place
    * Copy from that area to main program space in special RAM located method

On bigger flash it can be simple changed. But we can't write direct to program memory while it in usage anyway.
User avatar
By piontec
#17499
Markus Gritsch wrote:What is a slot 0 or slot 1 firmware? I've never heard of something like that.


As a default solution, espressif suggest to split flash in half, run the software from one of them allowing for the write/upgrade of the other one. Than, a flag is set in the bootloader so the next boot runs the firmware from the other slot. Here you have the default memory map for such situation https://github.com/esp8266/esp8266-wiki/wiki/Memory-Map. You can find more in official docs titled "OTA upgrades" or something like that.
User avatar
By piontec
#17501
anakod wrote:Sming OTA update is different:
    * Format spiffs area
    * Download all requried files in that place
    * Copy from that area to main program space in special RAM located method


Thanks for your reply, but could you explain the process a little bit more? Is the bootloader involved in the process or even needed? What in the case of failed upgrade - the way I understand it: you're screwed, there's no other version you can even try to rollback to.
What about using the spiffs for upgrade? The way I see it, i want to keep my files (html, configs) and just update the binary part. Loosing the spiffs data is in my opinion not an option - I need to store data about my user or some other preferences somewhere... Is it possible to use the watchdog and dual binary image idea to build something at least a little bit error-proof? Like run one binary file, upgrade the other, restart the device and if the watchdog won't signal that the software is working, restart and go back to the previous version? I think something like that would awesome :)

One more thing: @anakod, did you think about using some small size mobile frameworks for web (like http://purecss.io/ - 4kB zip and http://zeptojs.com/)? This could spare a few kB on spiffs.
User avatar
By j0hncc
#17502
esp03madness wrote:Hello friends, just seeing this thread for the first time. I looked around a little, the project looks good and I have a couple of questions:

1. What is the difference between Sming and using the Espressif SDK directly? What exactly is abstracted?

I can't tell you "exactly what was abstracted", that is far too big a question.

But I can tell you, Sming had me at:
Code: Select allpinMode( 4, OUTPUT)  // note: 4 is GPIO4, what a concept
digitalWrite( 4, HIGH)

instead of
Code: Select all         WRITE_PERI_REG(PAD_XPD_DCDC_CONF,
                     (READ_PERI_REG(PAD_XPD_DCDC_CONF) & 0xffffffbc) | (uint32)0x1);    

         WRITE_PERI_REG(RTC_GPIO_CONF,
                     (READ_PERI_REG(RTC_GPIO_CONF) & (uint32)0xfffffffe) | (uint32)0x0);   

         WRITE_PERI_REG(RTC_GPIO_ENABLE,
                     (READ_PERI_REG(RTC_GPIO_ENABLE) & (uint32)0xfffffffe) | (uint32)0x1);
      GPIO_REG_WRITE((((val != 0) ? GPIO_OUT_W1TS_ADDRESS : GPIO_OUT_W1TC_ADDRESS)), (1<<pin));