I'm trying to get the OTA to work over BLE.
I created 2 characteristics (1 for control and 1 for data), modified the Partition table to 'Factory app, two OTA definitions', build the project, wrote a simple script in JS (noble) script and sent the binary file over BLE. I added logs to see what data is being received and the compared it with the data from the binary file to make sure that the data is being sent in the correct order.
Code: Select all
I (696102) esp_image: reading image header @ 0x110000
I (696112) esp_image: image header: 0xe9 0x09 0x02 0x02 40081034
I (696112) esp_image: loading segment header 0 at offset 0x110018
I (696122) esp_image: segment data length 0x1c0c4 data starts 0x110020
I (696132) esp_image: segment 0 map_segment 1 segment_data_offs 0x110020 load_addr 0x3f400020
I (696142) esp_image: segment 0: paddr=0x00110020 vaddr=0x3f400020 size=0x1c0c4 (114884) map
I (696152) esp_image: free data page_count 0x0000003e
I (696212) esp_image: loading segment header 1 at offset 0x12c0e4
I (696212) esp_image: segment data length 0x33c4 data starts 0x12c0ec
I (696212) esp_image: segment 1 map_segment 0 segment_data_offs 0x12c0ec load_addr 0x3ffc0000
I (696222) esp_image: segment 1: paddr=0x0012c0ec vaddr=0x3ffc0000 size=0x033c4 ( 13252)
I (696232) esp_image: free data page_count 0x0000003e
I (696242) esp_image: loading segment header 2 at offset 0x12f4b0
I (696242) esp_image: segment data length 0x0 data starts 0x12f4b8
I (696252) esp_image: segment 2 map_segment 0 segment_data_offs 0x12f4b8 load_addr 0x3ffc33c4
I (696262) esp_image: segment 2: paddr=0x0012f4b8 vaddr=0x3ffc33c4 size=0x00000 ( 0)
I (696272) esp_image: free data page_count 0x0000003e
I (696272) esp_image: loading segment header 3 at offset 0x12f4b8
I (696282) esp_image: segment data length 0x400 data starts 0x12f4c0
I (696292) esp_image: segment 3 map_segment 0 segment_data_offs 0x12f4c0 load_addr 0x40080000
0x40080000: _iram_start at /Users/gaborgabriel/Documents/Kano/SpeakerKit_ESP32/esp-idf/components/freertos/xtensa_vectors.S:1685
I (696292) esp_image: segment 3: paddr=0x0012f4c0 vaddr=0x40080000 size=0x00400 ( 1024)
0x40080000: _iram_start at /Users/gaborgabriel/Documents/Kano/SpeakerKit_ESP32/esp-idf/components/freertos/xtensa_vectors.S:1685
I (696302) esp_image: free data page_count 0x0000003e
I (696312) esp_image: loading segment header 4 at offset 0x12f8c0
I (696322) esp_image: segment data length 0x748 data starts 0x12f8c8
I (696322) esp_image: segment 4 map_segment 0 segment_data_offs 0x12f8c8 load_addr 0x40080400
I (696332) esp_image: segment 4: paddr=0x0012f8c8 vaddr=0x40080400 size=0x00748 ( 1864)
I (696342) esp_image: free data page_count 0x0000003e
I (696352) esp_image: loading segment header 5 at offset 0x130010
I (696352) esp_image: segment data length 0x6384c data starts 0x130018
I (696362) esp_image: segment 5 map_segment 1 segment_data_offs 0x130018 load_addr 0x400d0018
0x400d0018: _stext at ??:?
I (696372) esp_image: segment 5: paddr=0x00130018 vaddr=0x400d0018 size=0x6384c (407628) map
0x400d0018: _stext at ??:?
I (696382) esp_image: free data page_count 0x0000003e
I (696582) esp_image: loading segment header 6 at offset 0x193864
I (696582) esp_image: segment data length 0x10940 data starts 0x19386c
I (696582) esp_image: segment 6 map_segment 0 segment_data_offs 0x19386c load_addr 0x40080b48
I (696592) esp_image: segment 6: paddr=0x0019386c vaddr=0x40080b48 size=0x10940 ( 67904)
I (696602) esp_image: free data page_count 0x0000003e
I (696642) esp_image: loading segment header 7 at offset 0x1a41ac
I (696642) esp_image: segment data length 0x0 data starts 0x1a41b4
I (696642) esp_image: segment 7 map_segment 0 segment_data_offs 0x1a41b4 load_addr 0x400c0000
I (696652) esp_image: segment 7: paddr=0x001a41b4 vaddr=0x400c0000 size=0x00000 ( 0)
I (696662) esp_image: free data page_count 0x0000003e
I (696662) esp_image: loading segment header 8 at offset 0x1a41b4
I (696672) esp_image: segment data length 0x0 data starts 0x1a41bc
I (696682) esp_image: segment 8 map_segment 0 segment_data_offs 0x1a41bc load_addr 0x50000000
I (696692) esp_image: segment 8: paddr=0x001a41bc vaddr=0x50000000 size=0x00000 ( 0)
I (696702) esp_image: free data page_count 0x0000003e
I (696702) esp_image: image start 0x00110000 end of last section 0x001a41bc
I (696712) esp_image: Calculated hash: 8e2ae049
E (696712) esp_image: Image hash failed - image is corrupt
I (696722) esp_image: Expected hash: 46a7c8af
At the moment I'm using the binary from `build/{my_project}.bin`, I don't touch that file at all before I send it over BLE. I'm not sure if that's correct or if there's a different process to generated the binary for the OTA.
I'm running out of ideas, not sure what else to try to get this to work.
PS. I'm using `esp_ota_ops.h` to initialise/write/end the OTA and `esp_ota_get_next_update_partition` to get the next available partition. There are no errors logged until the end of the OTA.