Please fill the info fields, it helps to get you faster support ;)
If you have a Guru Meditation Error, please decode it:
https://github.com/me-no-dev/EspExceptionDecoder
----------------------------- Remove above -----------------------------
Board: ESP32 Dev Module
Core Installation/update date: 11/jul/2017
IDE name: Arduino IDE
Flash Frequency: 40Mhz
Upload Speed: 115200
Hi,
I have been using Arduino IDE for ESP32. As per my search, ESP32 core for Arduino has been compiled with 240 Mhz clock. I have never used IDF before. Can someone tell the basics steps how to compile a new arduino core for esp32 with 80Mhz clock.
Thanks
You just set it in the options of the board in the IDE.
Isn't that option for flash frequency?
As per discussions in this issue thread https://github.com/espressif/arduino-esp32/issues/487 . I need to recompile the core at 80Mhz. Wanna know how. Thanks.
1) Install arduino-esp32 as per instructions (https://github.com/espressif/arduino-esp32)
2) Install esp-idf as per instructions (https://github.com/espressif/esp-idf)
3) Get esp-idf in line with arduino-esp32. Looks through the commit log for the latest IDF update (I search for IDF). Use git log to get the full uuid for that commit and then git checkout that version.
4) Follow the instructions to install arduino as an esp-idf component (https://github.com/espressif/arduino-esp32/blob/master/docs/esp-idf_component.md). You can use any project. I use the blink example.
5) Copy the sdkconfig from arduino-esp32/tools/sdk/sdkconfig into your project.
6) Run make menuconfig and set the cpu speed (or whatever change you want). Save that sdkconfig.
7) Make the project
8) Copy build/esp32/libesp32.a into arduino-esp32/tools/sdk/lib/ .
9) Profit??
When I copied the file and tried to load the sketch through the Arduino Ide, an error was displayed:
D:/ESPRESSIF/esp-idf/components/esp32/panic.c:648: undefined reference to `xPortInterruptedFromISRContext'
collect2.exe: error: ld returned 1 exit status
exit status 1
How to compare esp-idf versions?
hello Ilberstone
when I do....
- Make the project
then i get this error:
$ make
CXX build/arduino/libraries/BLE/src//BLEServer.o
C:/msys32/home/esp/hello_world/components/arduino/libraries/BLE/src/BLEServer.cpp:21:22: fatal error: gatt_api.h: No such file or directory
compilation terminated.
make[1]: * [/home/esp/esp-idf/make/component_wrapper.mk:286: libraries/BLE/src//BLEServer.o] Fehler 1
make: * [c:/msys32/home/esp/esp-idf/make/project.mk:467: component-arduino-build] Fehler 2
Return to step 3 and try again. You must do a git checkout <version> in esp-idf to match the \
ok thanks! but i didnt unterstand it completely.
how do i know which arduino core version is currently installed ?
did i unterstand it right that git checkout <version>
will change the IDF to the newer or older commit (version) ?
larryb@larryb-EZpad:~/arduino-1.8.5/hardware/espressif/esp32$ git log | grep -i idf | head -1
Update IDF to f586f5e (#1296)
larryb@larryb-EZpad:~/arduino-1.8.5/hardware/espressif/esp32$ cd ~/esp32/esp-idf/
larryb@larryb-EZpad:~/esp32/esp-idf$ git log | grep f586f5e
commit f586f5e690e687f8db219a8b509bbf483fc416d6
larryb@larryb-EZpad:~/esp32/esp-idf$ git checkout f586f5e690e687f8db219a8b509bbf483fc416d6
M components/bt/lib
M components/esp32/lib
HEAD is now at f586f5e6 Merge branch 'feature/get-started-20180130' into 'master'
thank you man! <3
Hi, this seems to take the menuconfig back to the previous menu system without all the new bluetooth error and memory system... any ideas how to keep the new menus , while using ESPIDF as a component or can we not do that just yet?
sdkconfig is just a text file that defines those menus. If you diff the sdkconfig.defaults with the sdkconfig in arduino-esp32, it is not hard to pick out what you need to set.
Hi, I've followed these instructions carefully (both the 23rd Feb and 14th May posts) and I THINK I've done things correctly.
However I get a build error, as follows:
/home/robert/esp/blink/components/arduino/libraries/SD_MMC/src//SD_MMC.cpp: In member function 'bool fs::SDMMCFS::begin(const char, bool)':
/home/robert/esp/blink/components/arduino/libraries/SD_MMC/src//SD_MMC.cpp:56:26: error: 'sdmmc_host_io_int_enable' was not declared in this scope
.io_int_enable = sdmmc_host_io_int_enable,
^
/home/robert/esp/blink/components/arduino/libraries/SD_MMC/src//SD_MMC.cpp:57:24: error: 'sdmmc_host_io_int_wait' was not declared in this scope
.io_int_wait = sdmmc_host_io_int_wait,
^
/home/robert/esp/blink/components/arduino/libraries/SD_MMC/src//SD_MMC.cpp:59:5: error: 'sdmmc_host_t' has no non-static data member named 'io_int_enable'
};
^
/home/robert/esp/esp-idf/make/component_wrapper.mk:273: recipe for target 'libraries/SD_MMC/src//SD_MMC.o' failed
make[1]: [libraries/SD_MMC/src//SD_MMC.o] Error 1
/home/robert/esp/esp-idf/make/project.mk:453: recipe for target 'component-arduino-build' failed
make: * [component-arduino-build] Error 2
I have deselected "Autostart Arduino setup and loop on boot". My blink.cpp file is down to:
extern "C" void app_main()
extern "C" void app_main()
{
initArduino();
}
I'm running on Ubuntu.
There is no need to edit blink.c. It should definitely not include Arduino.h. If you will be using the libraries in Arduino IDE, you need to autostart Arduino setup and loop. Maybe you should explain what you are trying to achieve by making these changes.
The reason why I am trying this is that I have a lot of Arduino code that I would like to convert to C++, but I don't have the time to do it manually. So if I could run the code in the way described here:
https://github.com/espressif/arduino-esp32/blob/master/docs/esp-idf_component.md
it would allow me to do the migration bit by bit.
The document gives 2 options, both of which have an include "Arduino.h". I've selected the 2nd option, which is to have an app_main, as this is moving in the right C++ direction.
My main program needs to be a .cpp as I will be developing in c++ on Eclipse.
Please open a separate issue instead of hijacking this thread, which is pretty clearly about recompiling the libraries for 80MHz.
I'm sorry ... I had no intention of hijacking this thread, but it is referenced in the https://github.com/espressif/arduino-esp32/blob/master/docs/esp-idf_component.md document re Build errors, which is what I am having.
I have started a new thread here: https://github.com/espressif/arduino-esp32/issues/1840
I very much hope that you will give me some help because I have been trying to get help on this with no luck (for instance on the Espressif forum, here: https://www.esp32.com/viewtopic.php?p=30044#p30044).
https://github.com/espressif/arduino-esp32/issues/1142#issuecomment-388913018
What are these steps ? I did not understand anything.
- Install arduino-esp32 as per instructions (https://github.com/espressif/arduino-esp32)
- Install esp-idf as per instructions (https://github.com/espressif/esp-idf)
- Get esp-idf in line with arduino-esp32. Looks through the commit log for the latest IDF update (I search for IDF). Use git log to get the full uuid for that commit and then git checkout that version.
- Follow the instructions to install arduino as an esp-idf component (https://github.com/espressif/arduino-esp32/blob/master/docs/esp-idf_component.md). You can use any project. I use the blink example.
- Copy the sdkconfig from arduino-esp32/tools/sdk/sdkconfig into your project.
- Run make menuconfig and set the cpu speed (or whatever change you want). Save that sdkconfig.
- Make the project
- Copy build/esp32/libesp32.a into arduino-esp32/tools/sdk/lib/ .
- Profit??
Does anyone know how to "align" the esp-idf with platformio to make it work? I'd like to change the config CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL and need to compile a libesp32.a for that matter?
I tried by using .platformio/packages/framework-arduinoespressif32/tools/sdk/sdkconfig, running make in esp-idf with the hello_world example and using the generated libesp32.a in platformio. (Compiling esp-idf asks a lot of questions in the terminal and seems to adapt the sdkconfig)
Unfortunately I get compiling errors when building the arduino example (which works with the origin libesp32.a):
.pioenvs/esp32dev/libFrameworkArduino.a(esp32-hal-misc.c.o):(.iram1.12.literal+0x4): undefined reference to `esp_timer_get_time'
.pioenvs/esp32dev/libFrameworkArduino.a(esp32-hal-misc.c.o): In function `millis':
esp32-hal-misc.c:(.iram1.12+0x3): undefined reference to `esp_timer_get_time'
/Users/denis/.platformio/packages/framework-arduinoespressif32/tools/sdk/lib/libesp32.a(cpu_start.o):(.iram1.23.literal+0x3c): undefined reference to `esp_timer_init'
/Users/denis/.platformio/packages/framework-arduinoespressif32/tools/sdk/lib/libesp32.a(cpu_start.o):(.iram1.23.literal+0x40): undefined reference to `esp_dbg_stubs_init'
/Users/denis/.platformio/packages/framework-arduinoespressif32/tools/sdk/lib/libesp32.a(cpu_start.o):(.iram1.23.literal+0x44): undefined reference to `esp_coex_adapter_register'
/Users/denis/.platformio/packages/framework-arduinoespressif32/tools/sdk/lib/libesp32.a(cpu_start.o): In function `start_cpu0_default':
/www/esp-idf/components/esp32/cpu_start.c:357: undefined reference to `esp_timer_init'
/www/esp-idf/components/esp32/cpu_start.c:357: undefined reference to `esp_dbg_stubs_init'
/www/esp-idf/components/esp32/cpu_start.c:377: undefined reference to `esp_coex_adapter_register'
/Users/denis/.platformio/packages/framework-arduinoespressif32/tools/sdk/lib/libesp32.a(esp_adapter.o):(.iram1.31.literal+0x0): undefined reference to `ets_timer_arm_us'
/Users/denis/.platformio/packages/framework-arduinoespressif32/tools/sdk/lib/libesp32.a(esp_adapter.o):(.literal.timer_setfn_wrapper+0x0): undefined reference to `ets_timer_setfn'
/Users/denis/.platformio/packages/framework-arduinoespressif32/tools/sdk/lib/libesp32.a(esp_adapter.o):(.literal.timer_done_wrapper+0x0): undefined reference to `ets_timer_done'
/Users/denis/.platformio/packages/framework-arduinoespressif32/tools/sdk/lib/libesp32.a(esp_adapter.o):(.iram1.30.literal+0x0): undefined reference to `ets_timer_disarm'
/Users/denis/.platformio/packages/framework-arduinoespressif32/tools/sdk/lib/libesp32.a(esp_adapter.o): In function `timer_arm_us_wrapper':
/www/esp-idf/components/esp32/esp_adapter.c:253: undefined reference to `ets_timer_arm_us'
/Users/denis/.platformio/packages/framework-arduinoespressif32/tools/sdk/lib/libesp32.a(esp_adapter.o): In function `timer_setfn_wrapper':
/www/esp-idf/components/esp32/esp_adapter.c:253: undefined reference to `ets_timer_setfn'
/Users/denis/.platformio/packages/framework-arduinoespressif32/tools/sdk/lib/libesp32.a(esp_adapter.o): In function `timer_done_wrapper':
/www/esp-idf/components/esp32/esp_adapter.c:253: undefined reference to `ets_timer_done'
/Users/denis/.platformio/packages/framework-arduinoespressif32/tools/sdk/lib/libesp32.a(esp_adapter.o): In function `timer_disarm_wrapper':
/www/esp-idf/components/esp32/esp_adapter.c:253: undefined reference to `ets_timer_disarm'
/Users/denis/.platformio/packages/framework-arduinoespressif32/tools/sdk/lib/libesp32.a(esp_adapter.o):(.data.g_coex_adapter_funcs+0x4c): undefined reference to `esp_timer_get_time'
/Users/denis/.platformio/packages/framework-arduinoespressif32/tools/sdk/lib/libesp32.a(ipc.o): In function `esp_ipc_init':
/www/esp-idf/components/esp32/ipc.c:99: undefined reference to `__stack_chk_fail'
/Users/denis/.platformio/packages/framework-arduinoespressif32/tools/sdk/lib/libesp32.a(system_api.o):(.iram1.24.literal+0x2c): undefined reference to `rtc_wdt_flashboot_mode_enable'
/Users/denis/.platformio/packages/framework-arduinoespressif32/tools/sdk/lib/libesp32.a(system_api.o): In function `esp_restart_noos':
/www/esp-idf/components/esp32/system_api.c:238: undefined reference to `rtc_wdt_flashboot_mode_enable'
/Users/denis/.platformio/packages/framework-arduinoespressif32/tools/sdk/lib/libnewlib.a(time.o):(.literal.get_time_since_boot+0x4): undefined reference to `esp_timer_get_time'
/Users/denis/.platformio/packages/framework-arduinoespressif32/tools/sdk/lib/libnewlib.a(time.o): In function `get_time_since_boot':
/Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/newlib/time.c:220: undefined reference to `esp_timer_get_time'
/Users/denis/.platformio/packages/framework-arduinoespressif32/tools/sdk/lib/libnewlib.a(time.o): In function `esp_set_time_from_rtc':
/Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/newlib/time.c:251: undefined reference to `esp_timer_get_time'
/Users/denis/.platformio/packages/framework-arduinoespressif32/tools/sdk/lib/libesp32.a(panic.o):(.literal.commonErrorHandler_dump+0x0): undefined reference to `__stack_chk_guard'
/Users/denis/.platformio/packages/framework-arduinoespressif32/tools/sdk/lib/libesp32.a(panic.o):(.literal.commonErrorHandler_dump+0x34): undefined reference to `esp_ota_get_app_elf_sha256'
/Users/denis/.platformio/packages/framework-arduinoespressif32/tools/sdk/lib/libesp32.a(panic.o):(.literal.commonErrorHandler_dump+0x38): undefined reference to `__stack_chk_fail'
/Users/denis/.platformio/packages/framework-arduinoespressif32/tools/sdk/lib/libesp32.a(panic.o):(.literal.esp_error_check_failed_print+0x14): undefined reference to `esp_err_to_name'
/Users/denis/.platformio/packages/framework-arduinoespressif32/tools/sdk/lib/libesp32.a(panic.o): In function `commonErrorHandler_dump':
/www/esp-idf/components/esp32/panic.c:715: undefined reference to `esp_ota_get_app_elf_sha256'
/www/esp-idf/components/esp32/panic.c:715: undefined reference to `__stack_chk_fail'
/Users/denis/.platformio/packages/framework-arduinoespressif32/tools/sdk/lib/libesp32.a(panic.o): In function `esp_error_check_failed_print':
/www/esp-idf/components/esp32/panic.c:715: undefined reference to `esp_err_to_name'
/Users/denis/.platformio/packages/framework-arduinoespressif32/tools/sdk/lib/libfreertos.a(tasks.o): In function `vTaskStartScheduler':
/Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/freertos/tasks.c:4590: undefined reference to `__stack_chk_fail'
.pioenvs/esp32dev/libFrameworkArduino.a(Print.cpp.o):(.literal._ZN5Print6printfEPKcz+0x0): undefined reference to `__stack_chk_guard'
.pioenvs/esp32dev/libFrameworkArduino.a(Print.cpp.o):(.literal._ZN5Print6printfEPKcz+0x4): undefined reference to `__stack_chk_fail'
.pioenvs/esp32dev/libFrameworkArduino.a(Print.cpp.o): In function `Print::printf(char const*, ...)':
Print.cpp:(.text._ZN5Print6printfEPKcz+0x86): undefined reference to `__stack_chk_fail'
.pioenvs/esp32dev/libFrameworkArduino.a(Print.cpp.o): In function `Print::printNumber(unsigned long, unsigned char)':
Print.cpp:(.text._ZN5Print11printNumberEmh+0x5e): undefined reference to `__stack_chk_fail'
/Users/denis/.platformio/packages/framework-arduinoespressif32/tools/sdk/lib/libmdns.a(mdns.o):(.literal._mdns_stop_timer+0x0): undefined reference to `esp_timer_stop'
/Users/denis/.platformio/packages/framework-arduinoespressif32/tools/sdk/lib/libmdns.a(mdns.o):(.literal._mdns_stop_timer+0x4): undefined reference to `esp_timer_delete'
/Users/denis/.platformio/packages/framework-arduinoespressif32/tools/sdk/lib/libmdns.a(mdns.o): In function `_mdns_stop_timer':
/Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/mdns/mdns.c:4456: undefined reference to `esp_timer_stop'
/Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/mdns/mdns.c:4456: undefined reference to `esp_timer_delete'
/Users/denis/.platformio/packages/framework-arduinoespressif32/tools/sdk/lib/libnvs_flash.a(nvs_storage.o): In function `nvs::Storage::populateBlobIndices(intrusive_list<nvs::Storage::BlobIndexNode>&)':
/Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/nvs_flash/src/nvs_storage.cpp:57: undefined reference to `__stack_chk_fail'
/Users/denis/.platformio/packages/framework-arduinoespressif32/tools/sdk/lib/libnvs_flash.a(nvs_storage.o): In function `nvs::Storage::eraseOrphanDataBlobs(intrusive_list<nvs::Storage::BlobIndexNode>&)':
/Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/nvs_flash/src/nvs_storage.cpp:85: undefined reference to `__stack_chk_fail'
/Users/denis/.platformio/packages/framework-arduinoespressif32/tools/sdk/lib/libnvs_flash.a(nvs_storage.o): In function `nvs::Storage::init(unsigned int, unsigned int)':
/Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/nvs_flash/src/nvs_storage.cpp:129: undefined reference to `__stack_chk_fail'
/Users/denis/.platformio/packages/framework-arduinoespressif32/tools/sdk/lib/libnvs_flash.a(nvs_page.o): In function `nvs::Page::initialize()':
/Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/nvs_flash/src/nvs_page.cpp:849: undefined reference to `__stack_chk_fail'
/Users/denis/.platformio/packages/framework-arduinoespressif32/tools/sdk/lib/libnvs_flash.a(nvs_page.o): In function `nvs::Page::eraseEntryAndSpan(unsigned int)':
/Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/nvs_flash/src/nvs_page.cpp:849: undefined reference to `__stack_chk_fail'
/Users/denis/.platformio/packages/framework-arduinoespressif32/tools/sdk/lib/libnvs_flash.a(nvs_page.o):/Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/nvs_flash/src/nvs_page.cpp:849: more undefined references to `__stack_chk_fail' follow
collect2: error: ld returned 1 exit status
*** [.pioenvs/esp32dev/firmware.elf] Error 1
Anyone having an idea?
I was having a similar issue and got it working - so I thought I'd share my process which adds to the advice from @lbernstone. I could make this shorter and give the answers, but I think it is important to know the process.
git log --all | grep a8916daebgit checkout <branchname>It took me a while so I hope this post saves someone the hassle.
If you want 80MHz nowadays, all you need to do is setCpuFrequencyMhz(80);
Maybe I should have specified, but my issue was unrelated to CPU frequency. Your posts helped in fixing some incompatibility issues I was having with Arduino as an ESP-IDF component.
@lbernstone , setCpuFrequencyMhz(80); returns true but I still got 240 MHz from ESP.getCpuFreqMhz(); but getCpuFrequencyMhz() returns 80 MHz.
Is the frequency actually changed?
Yes. That old function should just call the new one. I'll put in a PR. https://github.com/espressif/arduino-esp32/pull/3007
Hi!
Just tried this with the latest version of the idf sdk and it does not work.
I know that I should roll back to a more stable version but the latest idf sdk has a lot of new features and bug fixes, is there any plans to make this compatible with a newer idf version?
Please correct me if I got anything wrong.
@ionini I'm not sure what you are referring to with IDF issues. This issue is not about IDF but an Arduino provided API.
As for IDF 4.0 (aka master of esp-idf), it should mostly work but there are a couple areas which may not. I'd suggest opening a different issue to cover compatibility issues for IDF and not hijack this one for that
for the record, it's ESP.getCpuFreqMHz() .. note the double-caps in MHz.
Most helpful comment
1) Install arduino-esp32 as per instructions (https://github.com/espressif/arduino-esp32)
2) Install esp-idf as per instructions (https://github.com/espressif/esp-idf)
3) Get esp-idf in line with arduino-esp32. Looks through the commit log for the latest IDF update (I search for IDF). Use git log to get the full uuid for that commit and then git checkout that version.
4) Follow the instructions to install arduino as an esp-idf component (https://github.com/espressif/arduino-esp32/blob/master/docs/esp-idf_component.md). You can use any project. I use the blink example.
5) Copy the sdkconfig from arduino-esp32/tools/sdk/sdkconfig into your project.
6) Run make menuconfig and set the cpu speed (or whatever change you want). Save that sdkconfig.
7) Make the project
8) Copy build/esp32/libesp32.a into arduino-esp32/tools/sdk/lib/ .
9) Profit??