RTOS version ESP8266 of ota online upgrade the basic processes and notes

   ESP8266 of ota upgrade as it relates to, as well as various different flash version of the old and the new space, so the process is relatively complex. I buy and sell this time there are some, though, always get things resolved. Record the following basic questions about the processes and problems encountered.

Another problem is the ota upgrade RTOS version of the above and many former is different, and this is one of the reasons I buy and sell so long.

   The basic process:

    User APP1 and User APP2 are two backup software with ⼀ parts, simply referred to as the file after user1 and user2.

    System param district saved ⼀ a flag, when running a user1 or user2 should identify when to start. Boot when running a first startup, Boot System param read area flag, determines when running a user1 or user2, and then to a position corresponding to the SPI Flash fetch.

    For example, (1) Initial state: boot.bin + region version user1.bin + System param v1.0.0 flag of flag Use user1;

       (2) server to upload the software update version v1.0.1 of user1.bin and user2.bin;

       (3) push notification server, the device reads the flag is currently Using user1, from the server to download user2.bin v1.0.1 space after SPI Flash 260KB;

       (4) the download is complete, the user can choose to restart Using the update, modify flag flag System param for Use in user2, reboot, Use of user2 v1.0.1 software.

       (5) after the next upgrade, the reference step and the stream after 2

 

   Encounter problems:

1 how the contents user2.bin copied to user1.bin?

 Configuration compile macros: CONFIG_ESP8266_BOOT_COPY_APP = y

2 how to determine which method to use to upgrade ota?

 The general principle is to be determined according to the size of the flash, followed by the actual project needs, in fact, there are a lot of different projects are different.

3 how to obtain the source code it?

  All source code I have here, you need to please reply, I sent you, if it is for commercial purposes, you need to send a red envelope.

4 know how the size of the flash?

 Shun refer to this directory may be: https://wiki.ai-thinker.com/esp8266

Guess you like

Origin www.cnblogs.com/dylancao/p/11952845.html