乐鑫技术交流
直播中

刘超

7年用户 1447经验值
私信 关注
[问答]

将simple_ota_example移植到smart_config下,串口log提示http下载ota文件失败的原因?

将simple_ota_example移植到smart_config下,已配网ok,并成功连上路由器,此时通过按键触发,启动simple_ota_example功能,log信息提示http下载ota文件失败,完整log信息如下:

[10:24:03.833]收←◆ets Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:6944
load:0x40078000,len:15500
load:0x40080400,len:3844
entry 0x4008064c
[0;32mI (27) boot: ESP-IDF v5.0.2-dirty 2nd stage bootloader[0m
[0;32mI (27) boot: compile time 09:46:45[0m
[0;32mI (27) boot: chip revision: v1.0[0m
[0;32mI (31) boot.esp32: SPI Speed      : 40MHz[0m
[0;32mI (35) boot.esp32: SPI Mode       : DIO[0m
[0;32mI (40) boot.esp32: SPI Flash Size : 4MB[0m
[0;32mI (44) boot: Enabling RNG early entropy source...[0m
[0;32mI (50) boot: Partition Table:[0m
[0;32mI (53) boot: ## Label            Usage          Type ST Offset   Length[0m
[0;32mI (61) boot:  0 nvs              WiFi data        01 02 00009000 00004000[0m
[0;32mI (68) boot:  1 otadata          OTA data         01 00 0000d000 00002000[0m
[0;32mI (76) boot:  2 phy_init         RF data          01 01 0000f000 00001000[0m
[0;32mI (83) boot:  3 factory          factory app      00 00 00010000 00100000[0m
[0;32mI (91) boot:  4 ota_0            OTA app          00 10 00110000 00100000[0m
[0;32mI (98) boot:  5 ota_1            OTA app          00 11 00210000 00100000[0m
[0;32mI (106) boot: End of partition table[0m
[0;32mI (110) boot: Defaulting to factory image[0m
[0;32mI (115) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=37730h (227120) map[0m

[10:24:04.036]收←◆[0;32mI (205) esp_image: segment 1: paddr=00047758 vaddr=3ffb0000 size=03444h ( 13380) load[0m
[0;32mI (211) esp_image: segment 2: paddr=0004aba4 vaddr=40080000 size=05474h ( 21620) load[0m
[0;32mI (220) esp_image: segment 3: paddr=00050020 vaddr=400d0020 size=a17b4h (661428) map[0m

[10:24:04.286]收←◆[0;32mI (459) esp_image: segment 4: paddr=000f17dc vaddr=40085474 size=0fa48h ( 64072) load[0m

[10:24:04.332]收←◆[0;32mI (496) boot: Loaded app from partition at offset 0x10000[0m
[0;32mI (496) boot: Disabling RNG early entropy source...[0m
[0;32mI (508) cpu_start: Pro cpu up.[0m
[0;32mI (508) cpu_start: Starting app cpu, entry point is 0x400812e0[0m
[0;32mI (0) cpu_start: App cpu up.[0m
[0;32mI (524) cpu_start: Pro cpu start user code[0m
[0;32mI (524) cpu_start: cpu freq: 160000000 Hz[0m
[0;32mI (524) cpu_start: Application information:[0m
[0;32mI (529) cpu_start: Project name:     smart_config[0m
[0;32mI (534) cpu_start: App version:      smart_config_v1.1[0m
[0;32mI (540) cpu_start: Compile time:     Jul 12 2023 09:45:24[0m
[0;32mI (546) cpu_start: ELF file SHA256:  1b89bb15f7604350...[0m
[0;32mI (552) cpu_start: ESP-IDF:          v5.0.2-dirty[0m
[0;32mI (558) cpu_start: Min chip rev:     v0.0[0m
[0;32mI (562) cpu_start: Max chip rev:     v3.99 [0m
[0;32mI (567) cpu_start: Chip rev:         v1.0[0m
[0;32mI (572) heap_init: Initializing. RAM available for dynamic allocation:[0m
[0;32mI (579) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM[0m
[0;32mI (585) heap_init: At 3FFB7A90 len 00028570 (161 KiB): DRAM[0m
[0;32mI (591) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/
[10:24:04.457]收←◆IRAM[0m
[0;32mI (598) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM[0m
[0;32mI (604) heap_init: At 40094EBC len 0000B144 (44 KiB): IRAM[0m
[0;32mI (612) spi_flash: detected chip: generic[0m
[0;32mI (615) spi_flash: flash io: dio[0m
[0;33mW (620) timer_group: legacy driver is deprecated,
[10:24:04.489]收←◆ please migrate to `driver/gptimer.h`[0m
[0;32mI (628) cpu_start: Starting scheduler on PRO CPU.[0m
[0;32mI (0) cpu_start: Starting scheduler on APP CPU.[0m
[0;32mI (697) gpio: GPIO[2]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 [0m
[0;32mI (697) gpio: GPIO[13]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 [0m
[0;32mI (707) gpio: GPIO[15]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 [0m
[0;32mI (717) timer: Init timer with auto-reload[0m
I (737) wifi:wifi driver task: 3ffbfaa0, prio:23, stack:6656, core=0
[0;32mI (737) system_api: Base MAC address is not set[0m
[0;32mI (737) system_api: read default base MAC address from EFUSE[0m
I (757) wifi:wifi firmware version: 57982fe
I (757) wifi:wifi certification version: v7.0
I (757) wifi:config NVS flash: enabled
I (757) wifi:config nano formating: disabled
I (757) wifi:Init data frame dynamic rx buffer num: 32
I (767) wifi:Init management frame dynamic rx buffer num: 32
I (767) wifi:Init management short buffer num: 32
I (777) wifi:Init dynamic tx buffer num: 32
I (777) wifi:Init static rx buffer size: 1600
I (787) wifi:Init static rx buffer num: 10
I (787) wifi:Init dynamic rx buffer num: 32
[0;32mI (787) wifi_init: rx ba win: 6[0m
[0;32mI (797) wifi_init: tcpip mbox: 32[0m
[0;32mI (797) wifi_init: udp mbox: 6[0m
[0;32mI (807) wifi_init: tcp mbox: 6[0m
[0;32mI (807) wifi_init: tcp tx win: 5744[0m
[0;32mI (807) wifi_init: tcp rx win: 5744[0m
[0;32mI (817) wifi_init: tcp mss: 1440[0m
[0;32mI (817) wifi_init: WiFi IRAM OP enabled[0m
[0;32mI (827) wifi_init: WiFi RX IRAM OP enabled[0m
[0;32mI (827) phy_init: phy_version 4670,719f9f6,Feb 18 2021,17:07:07[0m

[10:24:04.739]收←◆I (937) wifi:mode : sta (7c:9e:bd:c0:90:48)
I (937) wifi:enable tsf
[0;32mI (937) smartconfig_example: get wifi config success[0m
[0;32mI (947) smartconfig_example: alrealy set, SSID is: SZY, start connect[0m
I (957) wifi<4,0>, old:<1,0>, ap:<255,255>, sta:<4,0>, prof:1
I (967) wifi:state: init -> auth (b0)

[10:24:04.801]收←◆I (1007) wifi:state: auth -> init (8a0)
I (1007) wifi<4,0>, old:<4,0>, ap:<255,255>, sta:<4,0>, prof:1

[10:24:07.269]收←◆I (3467) wifi<4,0>, old:<4,0>, ap:<255,255>, sta:<4,0>, prof:1
I (3467) wifi:state: init -> auth (b0)

[10:24:07.316]收←◆I (3517) wifi:state: auth -> assoc (0)

[10:24:07.347]收←◆I (3547) wifi:state: assoc -> run (10)

[10:24:07.410]收←◆I (3607) wifi:connected with SZY, aid = 2, channel 4, BW20, bssid = 40:31:3c:d9:f9:f3
I (3607) wifi:security: WPA2-PSK, phy: bgn, rssi: -48
I (3617) wifi:pm start, type: 1


[10:24:07.504]收←◆I (3697) wifi:AP's beacon interval = 102400 us, DTIM period = 1

[10:24:07.929]收←◆I (4127) wifi:idx:0 (ifx:0, 40:31:3c:d9:f9:f3), tid:0, ssn:0, winSize:64

[10:24:08.913]收←◆[0;32mI (5117) esp_netif_handlers: sta ip: 192.168.4.120, mask: 255.255.255.0, gw: 192.168.4.1[0m
[0;32mI (5117) smartconfig_example: WiFi Connected to ap[0m

[10:24:09.538]收←◆[0;31mE (5737) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time:[0m
[0;31mE (5737) task_wdt:  - IDLE (CPU 0)[0m
[0;31mE (5737) task_wdt: Tasks currently running:[0m
[0;31mE (5737) task_wdt: CPU 0: main[0m
[0;31mE (5737) task_wdt: CPU 1: IDLE[0m
[0;31mE (5737) task_wdt: Print CPU 0 (current core) backtrace[0m


Backtrace: 0x400DB853:0x3FFB1B40 0x400DB9DA:0x3FFB1B60 0x40082B85:0x3FFB1B80 0x400D7A50:0x3FFB9D30 0x400D772B:0x3FFB9D50 0x400D7811:0x3FFB9D70 0x4016FACB:0x3FFB9D90 0x4008BEC5:0x3FFB9DC0


[10:24:14.544]收←◆[0;31mE (10737) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time:[0m
[0;31mE (10737) task_wdt:  - IDLE (CPU 0)[0m
[0;31mE (10737) task_wdt: Tasks currently running:[0m
[0;31mE (10737) task_wdt: CPU 0: main[0m
[0;31mE (10737) task_wdt: CPU 1: IDLE[0m
[0;31mE (10737) task_wdt: Print CPU 0 (current core) backtrace[0m


Backtrace: 0x400DB853:0x3FFB1B40 0x400DB9DA:0x3FFB1B60 0x40082B85:0x3FFB1B80 0x400D7A77:0x3FFB9D30 0x400D772B:0x3FFB9D50 0x400D7811:0x3FFB9D70 0x4016FACB:0x3FFB9D90 0x4008BEC5:0x3FFB9DC0


[10:24:19.533]收←◆[0;31mE (15737) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time:[0m
[0;31mE (15737) task_wdt:  - IDLE (CPU 0)[0m
[0;31mE (15737) task_wdt: Tasks currently running:[0m
[0;31mE (15737) task_wdt: CPU 0: main[0m
[0;31mE (15737) task_wdt: CPU 1: IDLE[0m
[0;31mE (15737) task_wdt: Print CPU 0 (current core) backtrace[0m


Backtrace: 0x400DB853:0x3FFB1B40 0x400DB9DA:0x3FFB1B60 0x40082B85:0x3FFB1B80 0x400D780E:0x3FFB9D70 0x4016FACB:0x3FFB9D90 0x4008BEC5:0x3FFB9DC0


[10:24:20.099]收←◆key3 short press down

[10:24:21.083]收←◆key3 long press down
[0;32mI (17297) simple_ota_example: SHA-256 for bootloader: b7503c9c75f48deb88051e3a3dcc3d520d505d729d16e4065059b10c43fedef0[0m

[10:24:21.364]收←◆[0;32mI (17557) simple_ota_example: SHA-256 for current firmware:  12bfec746f9e6750c6a09c053916e5abb1d914432df87cf405fdf4646d0a6fa9[0m
I (17557) wifi:Set ps type: 0

[0;32mI (17567) simple_ota_example: Starting OTA example task[0m
[0;32mI (17567) simple_ota_example: Attempting to download update from https://edu-0101010.oss-cn-beijing.aliy ... config.bin[0m

[10:24:21.583]收←◆key3 press up

[10:24:22.145]收←◆[0;32mI (18337) esp-x509-crt-bundle: Certificate validated[0m

[10:24:23.180]收←◆[0;32mI (19387) HTTP_CLIENT: Body received in fetch header state, 0x3ffc90c7, 37[0m
[0;32mI (19387) esp_https_ota: Starting OTA...[0m
[0;32mI (19387) esp_https_ota: Writing to partition subtype 16 at offset 0x110000[0m

[10:24:24.570]收←◆[0;31mE (20717) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time:[0m
[0;31mE (20717) task_wdt:  - IDLE (CPU 0)[0m
[0;31mE (20717) task_wdt: Tasks currently running:[0m
[0;31mE (20717) task_wdt: CPU 0: ota_example_tas[0m
[0;31mE (20717) task_wdt: CPU 1: IDLE[0m
[0;31mE (20717) task_wdt: Print CPU 0 (current core) backtrace[0m


Backtrace: 0x400DB853:0x3FFB1B40 0x400DB9DA:0x3FFB1B60 0x40082B85:0x3FFB1B80 0x4000BFED:0x3FFC8880 0x4008C1BB:0x3FFC8890 0x400824BF:0x3FFC88B0 0x40083FD9:0x3FFC88D0 0x40085117:0x3FFC88F0 0x40085122:0x3FFC8910 0x40087AF9:0x3FFC8930 0x400846CB:0x3FFC8950 0x40084B6F:0x3FFC8970 0x400DAA5B:0x3FFC89B0 0x400DAE9B:0x3FFC89D0 0x400E29E5:0x3FFC89F0 0x400E2DA5:0x3FFC8A10 0x400E3009:0x3FFC8A50 0x400D80B2:0x3FFC8A80 0x4008BEC5:0x3FFC8B40


[10:24:29.610]收←◆[0;31mE (25757) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time:[0m
[0;31mE (25757) task_wdt:  - IDLE (CPU 0)[0m
[0;31mE (25757) task_wdt: Tasks currently running:[0m
[0;31mE (25757) task_wdt: CPU 0: ipc0[0m
[0;31mE (25757) task_wdt: CPU 1: IDLE[0m
[0;31mE (25757) task_wdt: Print CPU 0 (current core) backtrace[0m


Backtrace: 0x400DB853:0x3FFB1B40 0x400DB9DA:0x3FFB1B60 0x40082B85:0x3FFB1B80 0x4000BFED:0x3FFAF350 0x4008C1BB:0x3FFAF360 0x400824BF:0x3FFAF380 0x40083DE2:0x3FFAF3A0 0x40085308:0x3FFAF3C0 0x4008BEC5:0x3FFAF3E0


[10:24:34.609]收←◆[0;31mE (30807) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time:[0m
[0;31mE (30807) task_wdt:  - IDLE (CPU 0)[0m
[0;31mE (30807) task_wdt: Tasks currently running:[0m
[0;31mE (30807) task_wdt: CPU 0: main[0m
[0;31mE (30807) task_wdt: CPU 1: IDLE[0m
[0;31mE (30807) task_wdt: Print CPU 0 (current core) backtrace[0m


Backtrace: 0x400DB853:0x3FFB1B40 0x400DB9DA:0x3FFB1B60 0x40082B85:0x3FFB1B80 0x400D7A4D:0x3FFB9D50 0x400D7811:0x3FFB9D70 0x4016FACB:0x3FFB9D90 0x4008BEC5:0x3FFB9DC0


[10:24:39.615]收←◆[0;31mE (35757) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time:[0m
[0;31mE (35757) task_wdt:  - IDLE (CPU 0)[0m
[0;31mE (35757) task_wdt: Tasks currently running:[0m
[0;31mE (35757) task_wdt: CPU 0: ipc0[0m
[0;31mE (35757) task_wdt: CPU 1: IDLE[0m
[0;31mE (35757) task_wdt: Print CPU 0 (current core) backtrace[0m


Backtrace: 0x400DB853:0x3FFB1B40 0x400DB9DA:0x3FFB1B60 0x40082B85:0x3FFB1B80 0x4000BFED:0x3FFAF350 0x4008C1BB:0x3FFAF360 0x400824BF:0x3FFAF380 0x40083DE2:0x3FFAF3A0 0x40085308:0x3FFAF3C0 0x4008BEC5:0x3FFAF3E0


[10:24:44.620]收←◆[0;31mE (40817) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time:[0m
[0;31mE (40817) task_wdt:  - IDLE (CPU 0)[0m
[0;31mE (40817) task_wdt: Tasks currently running:[0m
[0;31mE (40817) task_wdt: CPU 0: main[0m
[0;31mE (40817) task_wdt: CPU 1: IDLE[0m
[0;31mE (40817) task_wdt: Print CPU 0 (current core) backtrace[0m


Backtrace: 0x400DB853:0x3FFB1B40 0x400DB9DA:0x3FFB1B60 0x40082B85:0x3FFB1B80 0x400D77E8:0x3FFB9D50 0x400D7811:0x3FFB9D70 0x4016FACB:0x3FFB9D90 0x4008BEC5:0x3FFB9DC0


/* ota 功能 key3长按触发 */
printf("key3 long press downn");
app_ota_func();


void app_ota_func(void)
{
    get_sha256_of_partitions();

    esp_wifi_set_ps(WIFI_PS_NONE);

    xTaskCreate(simple_ota_example_task, "ota_example_task", 8192, NULL, 5, NULL);
}

以上就是完整log信息和部分函数功能,ota相关的log信息到esp_https_ota: Writing to partition subtype 16 at offset 0x110000这一步后,就没有其他log信息了,请问下有没相关的排查建议,或者什么原因下会导致该现象的发生,期待您的回答。
                                                                                                                                                                     

回帖(1)

王玲

2024-6-11 17:06:26
根据您提供的日志信息,我们可以分析以下几个可能的原因导致HTTP下载OTA文件失败:

1. 网络连接问题:请确保您的设备已经成功连接到路由器,并且网络连接稳定。您可以通过ping操作来测试网络连接。

2. OTA服务器问题:请检查您的OTA服务器是否正常运行,以及服务器上的OTA文件是否可访问。您可以使用浏览器或其他工具尝试访问OTA文件的URL,确保文件可以正常下载。

3. URL错误:请检查您在代码中设置的OTA文件URL是否正确。如果URL有误,设备将无法找到并下载OTA文件。

4. HTTP请求超时:请检查您的设备是否设置了合适的HTTP请求超时时间。如果超时时间过短,可能导致设备在下载OTA文件时失败。

5. 权限问题:请确保您的设备具有访问OTA文件的权限。如果文件或服务器设置了访问限制,设备可能无法下载OTA文件。

6. 固件版本不匹配:请检查您正在尝试下载的OTA文件是否与您的设备兼容。如果固件版本不匹配,设备可能无法正常下载和升级。

为了解决这个问题,您可以尝试以下步骤:

1. 检查网络连接,确保设备已成功连接到路由器。

2. 检查OTA服务器和文件的可访问性。

3. 检查代码中的URL设置,确保URL正确无误。

4. 调整HTTP请求超时时间,确保设备有足够的时间下载OTA文件。

5. 检查权限设置,确保设备具有访问OTA文件的权限。

6. 确保OTA文件与设备兼容,避免固件版本不匹配的问题。

通过以上步骤,您应该能够找到导致HTTP下载OTA文件失败的原因,并采取相应的解决措施。
举报

更多回帖

发帖
×
20
完善资料,
赚取积分