Commit graph

17 commits

Author SHA1 Message Date
Angus Gratton
3dfcc312c8 ota_ops: Fix get_selected_boot_partition() in case there is no factory partition
get_selected_boot_partition() now follows the same basic logic as the bootloader to find the
default boot partition.
2017-09-04 17:37:28 +10:00
Angus Gratton
17adb40ca8 bootloader: Calculate SHA256 hash of image on every boot
Makes app image booting more reliable (256-bit rather than 8-bit verification.)

Some measurements, time to boot a 655KB app.bin file and run to app_main() execution.

(All for rev 1 silicon, ie no 340ms spurious WDT delay.)

80MHz QIO mode:
before = 300ms
after = 140ms

40MHz DIO mode:
before = 712ms
after = 577ms

40MHz DIO mode, secure boot enabled
before = 1380ms
after = 934ms

(Secure boot involves two ECC signature verifications (partition table, app) that take approx 300ms each with 80MHz CPU.)
2017-07-19 18:31:59 +10:00
Angus Gratton
0c8888d68f bootloader: Combine loading from flash & verifying to save boot time
Still needs updating to account for secure boot.
2017-07-19 18:25:17 +10:00
Deomid Ryabkov
516c708fc7 Enable checks for encrypted flash in OTA
Even if firmware is compiled without CONFIG_FLASH_ENCRYPTION_ENABLED
Rayionale: CONFIG_FLASH_ENCRYPTION_ENABLED controls whether boot loader
generates keys for encryption or not, but flash encryption can be
configured externally. With this change, it's possible to have boot
loader not generate keys but still have encryption working.

Also fix use of it->part
2017-04-11 19:10:26 +08:00
Tian Zhong Xing
c3d5f8e766 app_update: fix logic error when update ota info 2017-02-22 10:26:04 +11:00
Angus Gratton
080350a745 ota ops: Rewrite esp_ota_get_next_update_partition() to be more predictable, add unit tests 2017-02-22 10:26:04 +11:00
Angus Gratton
902382f622 ota ops: Verify partition argument passed to esp_ota_begin() 2017-02-22 10:26:04 +11:00
Angus Gratton
25f739c183 ota ops: Add new functions esp_ota_get_next_update_partition / esp_ota_get_running_partition
* Update OTA example to use these.
* Refactor esp_ota_begin() to return ESP_ERR_OTA_PARTITION_CONFLICT as documented
2017-02-22 10:24:42 +11:00
Angus Gratton
1f3a2e900c docs: Improve/clarify partition, OTA & SPI flash docs
Related to #313 https://github.com/espressif/esp-idf/issues/313
2017-02-20 15:31:42 +11:00
Angus Gratton
2d5162dc3c OTA: Always clean up OTA handle regardless of esp_ota_end() result
As reported on forum: http://esp32.com/viewtopic.php?f=14&t=1093
2017-02-03 10:07:30 +11:00
Angus Gratton
eea2788f5a OTA: Fix issues with encrypted OTA
- OTA source can write non-16-byte multiples of data
- Assumption that empty ota_data is 0xFFFFFFFF untrue when encrypted
2017-01-26 18:52:35 +11:00
Angus Gratton
67336672bd OTA: Improve verification of OTA image before writing, incl. secure boot
Verify 0xE9 magic byte on first write, verify entire image before
switching.

Enable verification for secure boot signature (was using invalid ifdef
guard)
2017-01-26 16:20:06 +11:00
Angus Gratton
813395adcb OTA: Fall back to factory partition if ota data partition is invalid 2017-01-26 16:20:06 +11:00
Chen Wu
d0fccbce15 examples: Add OTA demo 2016-12-29 17:37:17 +08:00
tzx
25e4e21226 app_update: clean up warning log when compile any project 2016-12-07 13:49:53 -08:00
tzx
2092d14e45 app_update: fix inconsistency between bootloader and OTA code 2016-12-01 13:46:02 +08:00
Tian Zhong Xing
72422b32dc feature/fota_ops_api: add ota core api implement 2016-11-28 17:12:57 +08:00