esp-idf: esp_ota_get_running_partition fail on OTA slot (IDFGH-1388)
Environment
-Development Kit: esp32 devkit v1 -Module or chip used: ESP32-WROOM-32 -IDF version: v3.2-130-g8e51f7e23 -Build System: Make -Compiler version: a1.22.0-80-g6c4433a -Operating System: Linux VM on Windows host -Power Supply: USB
Problem Description
When I call the function “esp_ota_get_running_partition” when running on an OTA slot (ota_0) I get an assertion failure and the program abort. When I call the same function on the factory partition I don’t have this problem.
It seems that the “esp_partition_find” function return an empty result while executing on an OTA slot.
Debug Logs
assertion "it != NULL" failed: file "/home/anthony/esp/esp-idf-v3-2/components/app_update/esp_ota_ops.c", line 515, function: esp_ota_get_running_partition
abort() was called at PC 0x4010513f on core 1
0x4010513f: _reclaim_reent at /home/jeroen/esp8266/esp32/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/reent/../../../.././newlib/libc/reent/reent.c:89
Backtrace: 0x4008ed98:0x3ffb1e40 0x4008efc5:0x3ffb1e60 0x4010513f:0x3ffb1e80 0x401203a7:0x3ffb1eb0 0x40141894:0x3ffb1ed0 0x4013fb06:0x3ffb1f20 0x401204a7:0x3ffb1fb0 0x4008b4e5:0x3ffb1fd0
0x4008ed98: commonErrorHandler_dump at /home/anthony/esp/esp-idf-v3-2/components/esp32/panic.c:707
0x4008efc5: xPortGetCoreID at /home/anthony/esp/esp-idf-v3-2/components/esp32/panic.c:707
(inlined by) panicHandler at /home/anthony/esp/esp-idf-v3-2/components/esp32/panic.c:221
0x4010513f: _reclaim_reent at /home/jeroen/esp8266/esp32/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/reent/../../../.././newlib/libc/reent/reent.c:89
0x401203a7: uartEnd at /home/anthony/esp/factoryApp/components/arduino/cores/esp32/esp32-hal-uart.c:404
0x40141894: Best_Wifi::~Best_Wifi() at /home/anthony/esp/factoryApp/main/IOTLab_Wifi.h:23
(inlined by) volvo::OTAESP32::getThingnameFromThingworxManager(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) at /home/anthony/esp/factoryApp/main/OTA.cpp:86
0x4013fb06: StringSumHelper::StringSumHelper(char const*) at /home/anthony/esp/factoryApp/main/IOTLab_Wifi.cpp:420
(inlined by) connectToWifi(Best_Wifi, String, String, String) at /home/anthony/esp/factoryApp/main/IOTLab_Wifi.cpp:127
0x401204a7: uartWrite at /home/anthony/esp/factoryApp/components/arduino/cores/esp32/esp32-hal-uart.c:404
0x4008b4e5: vPortTaskWrapper at /home/anthony/esp/esp-idf-v3-2/components/freertos/port.c:355 (discriminator 1)
Rebooting...
Other items if possible
- sdkconfig file (attach the sdkconfig file from your project folder)
- elf file in the
buildfolder (note this may contain all the code details and symbols of your project.) - coredump (This provides stacks of tasks.)
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 17 (3 by maintainers)
When you use OTA, the partition table and the offset of table have to be the same for the bootloader, the factory_app, and ota_app. The partition table is flashed only first time and will not be updated anymore in the future. Any app/factory/bootloader have to know the offset of table.