-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Arduino as an esp-idf Component ... build issue #1840
Comments
At the moment, there is no need to go through the "matching" routine- ESP-IDF and arduino-esp32 still seem to be in sync. So, make sure you have the latest versions of each development repo. |
@RA5040 from your project directory (~/esp/blink) try: rm -rf build In menuconfig under "SDK tool configuration->Compiler toolchain path/prefix" should be set to |
@RA5040 since you deleted your previous post, I take it you've solved your build problem. |
Copied blink example and built and flashed it: OK Followed instructions in https://github.com/espressif/arduino-esp32/blob/master/docs/esp-idf_component.md ("Autostart Arduino setup and loop on boot" off)
//#include "Arduino.h"
got
|
Youve selected a 2M flash size, in menuconfig under "Serial flasher config" set "Flash Size 4M". |
Also its finding an old version of the toolchain, you should use the version it wants. |
Thanks for your help! I went right back to the Espressif installation instructions, which is why I have an older version of the toolchain ... I guess the documentation is not up to date. CXX build/arduino/libraries/SD_MMC/src//SD_MMC.o |
In menuconfig under "Arduino Configuration" tick "Include only specific arduino libraries" and untick "Enable SD_MMC". I had the same problem here. |
THANK YOU!!! Now to try it in Eclipse ... is there anything that I need to watch out for there? Or can I just copy the project and build it? |
I dunno eclipse I just use makefiles and vi, maybe @lbernstone can help with that. Be sure to thank him as well as he also took the time to help you. |
Absolutely ... a lot of thanks to @ibernstone & @markyad. |
Here are instructions to build Arduino code in esp-idf: MAKING ARDUINO COMPONENT
#include "Arduino.h"
|
Here are instructions to move the application to Eclipse: BUILDING AN ARDUINO APPLICATION IN ECLIPSE A. MAKE C++ TEMPLATE APPLICATION
cd ~/esp &&
mkdir -p components &&
#include "Arduino.h"
If make fails, clear the build folders and try again: B. EDIT CODE TO MAKE IT INTO AN ARDUINO/C++ APPLICATION
C. SET UP BUILD ENVIRONMENT TO BUILD A C++ APP
D. BUILD TARGET
NOTE: if you program shows errors even though it built without any errors, rebuild the index (right-click on project , Index, Rebuild). If that doesn't fix the problem try cleaning and rebuilding the project. If that doesn't work, go to Project/ Properties/ C/C++ General/ Code Analysis and unclick/apply and click back on/apply Syntax and Semantic Errors: you can also turn off/apply individual entries until you find the one that is causing a problem. In some cases it's simply a question of overriding the 'error' in the project editor). E. REPLICATE In order to avoid having to do this every single time, copy the blink folder and call it ‘Arduino-template’ for instance (and save a copy securely!). Then when you have a new project, say ‘myProject’, copy the ‘Arduino-template’ again and rename it to ‘myProject’. Import it into Eclipse and set the Eclipse project properties as in C. Above. Edit Makefile and change the PROJECT NAME: = myProject Rebuild the index, clean the project and build it. |
I was not building a new enough version of IDF, I guess. There is already a PR to fix SD_MMC. #1836 |
I have the same issue. I use esp-arduino as esp-idf component under Eclipse\Ununtu. esp-idf v.3.0.3 home/iho/esp/arduino/libraries/SD_MMC/src//SD_MMC.cpp: In member function 'bool fs::SDMMCFS::begin(const char*, bool)': 23:14:03 Build Failed. 9 errors, 0 warnings. (took 2s.748ms) |
I have another question (sorry!) How do I add a library to the project? #1449 says to just put the library in the project/components/arduino/libraries, but that doesn't work for me (at the moment). The library is not found if I select 'Include only specific Arduino libraries' (which I have to do so that I can deselect 'Enable SD_MMC' ). If I do not select 'Include only specific Arduino libraries' then the U8g2 is built, but the build fails on the sd_mmc. So it's a catch-22 situation until the sd_mmc issue is resolved ... or is there another way of adding the U8g2 library so that it becomes part of the Arduino libraries? |
Well, I've found a workaround ... which is to comment out the SD_MMC.cpp file. But is there a better way, by adding the library to the Arduino libraries? Or having the library as a separate component (or something ...)? |
I am getting a FATAL error with regards to the esp32-hal-time.c file.
|
@neilpanchal: Please do not hijack issues. This has nothing to do with the OP, and explains exactly what the problem is. |
@lbernstone I was going to start another one, but thought the title of this issue was sufficiently vague to just post it here. No worries, I will open a new one. I did it out of courtesy to not inundate issue list with redundancy. |
U8g2 relies on the Arduino SD library. I'll need to look at the source but I think this can be disabled with a #define |
Same problem, started after update. got a few Code looks like C initialization, which should work but doesn't. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This stale issue has been automatically closed. Thank you for your contributions. |
can anybody explain to me why the latest version on esp-idf (v4.0) does not support the Arduino-esp32 component? |
@Suraj-singh999898 it does if you use the correct branch of arduino-esp32, look at the idf v4 branch for support. |
hi atanisoft, can you please elaborate on this method, I am trying this for a week. sorry if it's a silly question, I just a beginner |
@Suraj-singh999898 make sure you are using https://github.com/espressif/arduino-esp32/tree/idf-release/v4.0 and it should work. |
Ok I try it now just wait an hour, I respond you soon, |
@atanisoft Sir, |
|
@QGB This usually happens when compiling a CPP file without declaring the
The If you have further issues please provide a code example in a NEW issue so people can assist. |
@atanisoft I got some compiling error in Arduino ide . old version libraries conflict with Arduino latest libraries ,how to resolve?
|
@QGB Your issue doesn't seem related to this one, please file a new issue and perhaps someone will be able to help you. |
@atanisoft ok,the similar problem greiman/SdFat#23 |
How in God's name did I get involved in this? I'm receiving emails. Unfortunately, I'm not a developer on this project.. |
Hardware:
Board: ESP32 Wrover Module
Core Installation/update date: 4/9/2018
IDE name: ESP32 with Arduino component
Flash Frequency: 40Mhz
Upload Speed: 115200
Description:
I am trying to run Arduino code as a component in the esp-idf initially, and then in Eclipse.
I've followed the instructions here carefully :
https://github.com/espressif/arduino-esp32/blob/master/docs/esp-idf_component.md
I got some compilation errors so I referenced this link:
#1142 (comment)
and followed the instructions there 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" (first link above) so that the main.cpp should be as below.
I'm running on Ubuntu.
Sketch:
extern "C" void app_main()
#include <stdio.h>
#include "sdkconfig.h"
#include "Arduino.h"
extern "C" void app_main()
{
initArduino();
}
The text was updated successfully, but these errors were encountered: