Per Releases · espressif/esp-idf · GitHub the latest official version is 4.4-beta1, and it’s PlatformIO policy to only support stable versions – meaning with the current used 4.3.1 version, PlatformIO is still lagging behind the most recent v4.3.2 version from 6 days ago.
However, PlatformIO is adaptive. Through a platform_packages
directive you can arbitrarily modify the source of the package framework-espidf
, to e.g. point at a specific repository with ESP-IDF v4.4-beta1 with the PlatformIO-specific package.json
file. With some luck then, the current builder script logic in espidf.py
still works for the newer ESP-IDF version. (If not, things get interesting and more complicated…)
I’ve tested this out practically by creating GitHub - maxgerhardt/esp-idf at release/v4.4, which is really just the base repo plus a package.json
in the release/v4.4
branch and creating a project that uses it. Additionally, since PlatformIO currently uses version 8.4.0+2021r1 of the XTensa-GCC toolchain, but current ESP-IDF requires the 2021r2 version, an extra directive regarding this has to be added in platform_packages
, too.
After then activating the needed coredump configs through menuconfig → Component Config → Core dump, code like
#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "sdkconfig.h"
#include "esp_core_dump.h"
void app_main()
{
printf("Hello, world!\n");
esp_core_dump_init();
esp_core_dump_summary_t *summary = malloc(sizeof(esp_core_dump_summary_t));
if (summary) {
esp_err_t err = esp_core_dump_get_summary(summary);
if (err == ESP_OK) {
printf("Getting core dump summary ok.");
} else {
printf("Getting core dump summary not ok. Error: %d\n", (int) err);
printf("Probably no coredump present yet.\n");
printf("esp_core_dump_image_check() = %d\n", esp_core_dump_image_check());
}
free(summary);
}
while(1) {
vTaskDelay(1000 / portTICK_PERIOD_MS);
printf("Doing nothing...\n");
}
}
the source file compiles fine, but linking fails at a later step.
ld.exe: cannot open linker script file esp32.peripherals.ld: No such file or directory
So I’m stuck for the moment here and opened an issue at Help with ESP-IDF v4.4 linker logic · Issue #695 · platformio/platform-espressif32 · GitHub – maybe someone else can complete this.