feat(ota): Add command to generate OTA bin and add ota example for 1MB flash

"$(PROJECT_NAME).app1.bin", "$(PROJECT_NAME).app2.bin" and "$(PROJECT_NAME).ota.bin" at "build" directory.

Only upload "$(PROJECT_NAME).ota.bin" to the server.

Select the target flash and input "make ota flash" or "make ota flash monitor".

Update the OTA README.md for 1 MB flash.
This commit is contained in:
Dong Heng
2018-10-18 19:37:20 +08:00
parent 3de759602a
commit 5e1b8a0b10
16 changed files with 717 additions and 6 deletions

View File

@ -31,6 +31,7 @@
#include "internal/esp_wifi_internal.h"
#define FLASH_MAP_ADDR 0x40200000
#define FLASH_MAP_SIZE 0x00100000
extern void chip_boot(size_t start_addr);
extern int rtc_init(void);
@ -84,7 +85,7 @@ void call_user_start(size_t start_addr)
extern int _bss_start, _bss_end;
esp_image_header_t *head = (esp_image_header_t *)(FLASH_MAP_ADDR + CONFIG_PARTITION_TABLE_CUSTOM_APP_BIN_OFFSET);
esp_image_header_t *head = (esp_image_header_t *)(FLASH_MAP_ADDR + (start_addr & (FLASH_MAP_SIZE - 1)));
esp_image_segment_header_t *segment = (esp_image_segment_header_t *)((uintptr_t)head + sizeof(esp_image_header_t));
for (i = 0; i < 3; i++) {