add information to OTA

made some changes to the OTA firmware udpate
This commit is contained in:
gijsio
2020-09-04 15:49:27 +02:00
parent 031e344677
commit d2cf956789
2 changed files with 12 additions and 1 deletions

View File

@@ -193,6 +193,7 @@ with open(APPIMG, "rb") as f:
Instead of reading the data to be written from a file, it can obviously also be received from a server using any suitable protocol, without the need to store it in the devices file system.
> For more information about the OTA process, go [here](/updatefirmware/OTA/)
### pycom.diff_update_enabled()
Provides the status of the differential update feature. Returns `True` if differential update is enabled and `False` otherwise. `DIFF_UPDATE_ENABLED` build flag can be used to enable the differential update feature.
@@ -201,4 +202,4 @@ Provides the status of the differential update feature. Returns `True` if differ
## Constants
`pycom.LittleFS`, `pycom.FACTORY`,`pycom.FAT`, `pycom.OTA_0`
`pycom.LittleFS`, `pycom.FAT`, `pycom.FACTORY`, `pycom.OTA_0`

View File

@@ -14,6 +14,16 @@ Pycom modules come with the ability to update the devices firmware, while it is
2. Click on the configuration tab
3. Use the OTA firmware update tool there
Before we talk about OTA, we need to first discuss the inner workings of the `bootmgr` and partitioning. The (modern) Pycom devices all have 16MB flash, divided across different partitions:
| Factory () | Firmware (~3MB) | OTA () | Python code () | Free () |
|------|--------------|-----|-------|----|
Using the function `pycom.bootmgr()`, we can switch between the different boot partitions. This way, we can upload a new firmware to the device and then reboot, with the boot partition switched from `pycom.FACTORY` to `pycom.OTA_0` to load the updated firmware. We can do this using the functions:
`pycom.ota_start()` `pycom.ota_write()`, `pycom.ota_finish()` and `pycom.ota_verify()`.
## Method A
Here we will describe one possible update methodology you could use that is implemented by this example.