Hi,
I am now trying to work out a solution to migrate existing ESP32 devices with Arduino based firmware to the ESP-IDF based firmware.
It has to be done in the OTA method since there are already several devices in the field and it is quite difficult to collect them and update the firmware manually.
My first trial was quite naïve, simple use the OTA method to update the new binary, and it bricked my device.
And I found out that the Arduino bootloader is not compatible with the ESP-IDF based application.
Then I read the source code of the Update related part in the Arduino environment, and it seemed to be impossible to update the bootloader (location at 0x1000) with the existing API.
So I am now thinking another way to do so:
Keep the Arduino bootloader(@0x1000), and since the Arduino bootloader would jump to application binary at 0x10000, flash the ESP-IDF bootloader to 0x10000. So the Arduino bootloader would execute the ESP-IDF bootloader.
And in the partition table of the ESP-IDF based project, set the 'real' application binary location to 0x150000, and also flash the ESP-IDF based firmware binary to this location. So the ESP-IDF bootloader should be able to find it and execute the application.
Did someone already tried this way? Or is it feasible?
Every suggestion would be highly appreciated.
Thanks!
Migrate from Arduino to ESP-IDF
-
- Posts: 4
- Joined: Sun Apr 03, 2022 11:56 am
Re: Migrate from Arduino to ESP-IDF
After directly flash the ESP-IDF app into the device which has Arduino bootloader.
The app hangs after APP cpu up
After some investigation, it hangs in ESP-IDF cpu_start.c:
If I mark these four lines, and rebuild the app. Then the ESP-IDF app could successfully boot up with the Arduino SPL.
Could someone suggest if it is safe to do so?
The app hangs after APP cpu up
After some investigation, it hangs in ESP-IDF cpu_start.c:
Code: Select all
#if CONFIG_IDF_TARGET_ESP32
#if !CONFIG_SPIRAM_BOOT_INIT
// If psram is uninitialized, we need to improve some flash configuration.
bootloader_flash_clock_config(&fhdr);
bootloader_flash_gpio_config(&fhdr);
bootloader_flash_dummy_config(&fhdr);
bootloader_flash_cs_timing_config();
#endif //!CONFIG_SPIRAM_BOOT_INIT
#endif //CONFIG_IDF_TARGET_ESP32
Could someone suggest if it is safe to do so?
Re: Migrate from Arduino to ESP-IDF
Hi did u found a solution for this problem i facing the same atm and looking for someone with experiance here.
Who is online
Users browsing this forum: Baidu [Spider] and 118 guests