New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling core at 80Mhz #1142

Open
dvizma opened this Issue Feb 22, 2018 · 18 comments

Comments

Projects
None yet
8 participants
@dvizma
Copy link

dvizma commented Feb 22, 2018

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 -----------------------------

Hardware:

Board: ESP32 Dev Module
Core Installation/update date: 11/jul/2017
IDE name: Arduino IDE
Flash Frequency: 40Mhz
Upload Speed: 115200

Description:

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

@JacoFourie

This comment has been minimized.

Copy link

JacoFourie commented Feb 22, 2018

You just set it in the options of the board in the IDE.

@dvizma

This comment has been minimized.

Copy link
Author

dvizma commented Feb 22, 2018

Isn't that option for flash frequency?
As per discussions in this issue thread #487 . I need to recompile the core at 80Mhz. Wanna know how. Thanks.
#487

@lbernstone

This comment has been minimized.

Copy link
Contributor

lbernstone commented Feb 23, 2018

  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??
@Aalz

This comment has been minimized.

Copy link

Aalz commented Mar 26, 2018

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

@Aalz

This comment has been minimized.

Copy link

Aalz commented Mar 26, 2018

How to compare esp-idf versions?

@Buffalchill

This comment has been minimized.

Copy link

Buffalchill commented May 12, 2018

hello Ilberstone

when I do....

  1. 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

@lbernstone

This comment has been minimized.

Copy link
Contributor

lbernstone commented May 13, 2018

Return to step 3 and try again. You must do a git checkout <version> in esp-idf to match the <version> that arduino-esp32 was compiled at. That currently is git checkout f586f5e690e687f8db219a8b509bbf483fc416d6

@Buffalchill

This comment has been minimized.

Copy link

Buffalchill commented May 13, 2018

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) ?

@lbernstone

This comment has been minimized.

Copy link
Contributor

lbernstone commented May 14, 2018

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'
@Buffalchill

This comment has been minimized.

Copy link

Buffalchill commented May 15, 2018

thank you man! <3

@PhilColbert

This comment has been minimized.

Copy link

PhilColbert commented May 24, 2018

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?

@lbernstone

This comment has been minimized.

Copy link
Contributor

lbernstone commented May 24, 2018

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.

@RA5040

This comment has been minimized.

Copy link

RA5040 commented Sep 4, 2018

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()
#include <stdio.h>
#include "sdkconfig.h"
#include "Arduino.h"

extern "C" void app_main()
{
initArduino();
}

I'm running on Ubuntu.

@lbernstone

This comment has been minimized.

Copy link
Contributor

lbernstone commented Sep 4, 2018

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.

@RA5040

This comment has been minimized.

Copy link

RA5040 commented Sep 5, 2018

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.

@lbernstone

This comment has been minimized.

Copy link
Contributor

lbernstone commented Sep 5, 2018

Please open a separate issue instead of hijacking this thread, which is pretty clearly about recompiling the libraries for 80MHz.

@RA5040

This comment has been minimized.

Copy link

RA5040 commented Sep 5, 2018

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: #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).

@mehmetcanbalci

This comment has been minimized.

Copy link

mehmetcanbalci commented Sep 8, 2018

#1142 (comment)
What are these steps ? I did not understand anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment