Skip to content
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 Fails to Build as ESP-IDF Component - Fatal Error #1853

Closed
neilpanchal opened this issue Sep 10, 2018 · 19 comments
Closed

Arduino Fails to Build as ESP-IDF Component - Fatal Error #1853

neilpanchal opened this issue Sep 10, 2018 · 19 comments

Comments

@neilpanchal
Copy link

neilpanchal commented Sep 10, 2018

Hardware:

Board: ESP32-Devkit-C
Core Installation/update date: 09 Sep 2018
IDE name: Component
Flash Frequency: Default
Upload Speed: Default

Description:

Arduino component fails by following instructions as per the following link:
https://github.com/espressif/arduino-esp32/blob/master/docs/esp-idf_component.md

Debug Messages:

/home/neil/esp/projects/hello_world/components/arduino/cores/esp32/esp32-hal-time.c:16:28: fatal error: apps/sntp/sntp.h: No such file or directory
compilation terminated.

Toolchain and ESP-IDF versions:

Latest master as per ESP-IDF git repo: Commit: c5265b12dd698ceb17c0d29a8519f68f1e74c3b9
xtensa-esp32 toolchain : xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0

What did I try?

Tried to make sure submodules are recursively initialized, everything is up to date.
I tried to also make menuconfig as both on/off for "Start Arduino setup and loop on boot".

@better-adapted
Copy link

better-adapted commented Sep 10, 2018

EXACT same issues AND VERSIONS here.
also tried Issue #1142 as per instructions and "git checkout f586f5e690e687f8db219a8b509bbf483fc416d6"

details as above on win10pro/vmware/ubuntu

everything else is working including openocd on olimex-usb-tiny-h

@lbernstone
Copy link
Contributor

Do you see that file in tools/sdk/include/lwip/apps/sntp/sntp.h? Do any of the esp32-hal files compile?

@RA5040
Copy link

RA5040 commented Sep 10, 2018

Have a look at this:
http://www.irelandupclose.com/customer/esp32/cpp-arduino/Eclipse-Arduino.html
If you follow the instructions you should be able to build with the current release ('current' being about 5 days old in my case).

@better-adapted
Copy link

better-adapted commented Sep 11, 2018

I now have it working with the following versions

esp-idf = 9/5/2018 3:35AM master a0d2dd03856fec4242d0ac043898b404a5caff17 "a0d2dd03856fec4242d0ac043898b404a5caff17"

component / arduino = 8/27/2018 3:06AM a0f0bd9 "a0f0bd930cfd2d607bf3d3288f46e2d265dd2e11"

menconfig:
sd_mmc is disabled in arduino libs (thanks fellow irishman RA5040)
compiler c++ exceptions enabled

blink.c is now blink.cpp
//file: main.cpp
#include "Arduino.h"
void setup()
{
Serial.begin(115200);
Serial.println("hello");
}

void loop()
{
Serial.println(millis());
delay(1000);
}

I may now try other checkouts it am felling brave

@better-adapted
Copy link

i can help if anyone needs openocd working - i have it running in vmware and mingw32

@RA5040
Copy link

RA5040 commented Sep 12, 2018

Good for you @better-adapted! What JTAG are you using, and if it isn't the Wrover Kit, could you let me have the configuration?

Also, if anyone wants to use openocd in Windows or Linux I have instructions here: http://www.irelandupclose.com/customer/esp32/jtag/

Having said that ... in my experience OpenOCD and gdb are not exactly rock solid!! There's currently an issue with in-line optimisation which causes a crash, but hopefully this will be fixed soon.

@better-adapted
Copy link

better-adapted commented Sep 12, 2018

been trying openocd with mingw32 and VMware/Ubuntu 18.04 - its a "olimex arm-usb-tiny-h"

standard scripts so far - i really want to debug using 3rd party arduino libs like MQTT and RFM69 stuff.

I will also try segger j-link I have sitting here soon

in Ubuntu
sudo bin/openocd -s share/openocd/scripts -f interface/ftdi/olimex-arm-usb-tiny-h.cfg -f board/esp-wroom-32.cfg

in mingw32
bin/openocd -s share/openocd/scripts -f interface/ftdi/olimex-arm-usb-tiny-h.cfg -f board/esp-wroom-32.cfg

@RA5040
Copy link

RA5040 commented Sep 13, 2018

Thanks. I see that Visual GDB has similar problems to gdb/openocd: https://sysprogs.com/w/limitations-of-the-esp32-debugging/ ... seems to be esp32 issues (although the post is 2016 - may be better now).

I will be interested to see how you get on with the debugging. I find that it's great for simple stuff, but it tends to fall down as soon as it gets a bit complex (pity it's not the other way!)

@better-adapted
Copy link

I did try using Visual GDB but it was so slow and too much hassle to bring in newer commits of edp-idf though I do like it for Pi3 work with Qt5. Will test j-link with Visual GDB and bring it into Ubuntu soon.

@RA5040
Copy link

RA5040 commented Sep 13, 2018

Cool.

@hetlelid
Copy link

hetlelid commented Sep 14, 2018

Simple workaround:

In the file: cores/esp32/esp32-hal-time.c

Change line:
#include "apps/sntp/sntp.h"

With:
#include "lwip/apps/sntp.h"

#include "apps/sntp/sntp.h"

Edit: Some arduino modules are failing. Disable all in menuconfig first and test, then enable only what you need.

@better-adapted
Copy link

thanks will try that out later

@RA5040
Copy link

RA5040 commented Sep 14, 2018

Edit: Some arduino modules are failing. Disable all in menuconfig first and test, then enable only what you need.

As per #1848, the problem with disabling any of the arduino modules is that it also disables any 3rd-party libraries added through the Arduino library manager (in 1848 issue, the U8g2 library).

@qt1
Copy link
Contributor

qt1 commented Sep 17, 2018

Same problem.

It seems like this is caused by a change in esp-idf that is not matched by a change in arduino.

here is a search that finds different variations the the include esp-idf and in components/arduino:

~/esp$ grep -r -e  '#include.*sntp.h"' *
esp-idf/examples/protocols/http2_request/main/http2_request_example_main.c:#include "lwip/apps/sntp.h"
esp-idf/examples/protocols/sntp/main/sntp_example_main.c:#include "lwip/apps/sntp.h"
esp-idf/components/lwip/lwip/src/apps/sntp/sntp.c:#include "lwip/apps/sntp.h"
rs232_bridge/components/arduino/cores/esp32/esp32-hal-time.c:#include "apps/sntp/sntp.h"
wifi_test/components/arduino/cores/esp32/esp32-hal-time.c:#include "apps/sntp/sntp.h"

@me-no-dev
Copy link
Member

use "idf-update" branch! will merge soon (couple of days)

@angelsinacento
Copy link

use "idf-update" branch! will merge soon (couple of days)

How do I choose this branch? Is this a branch of arduino-esp32 or esp-idf ?

@hetlelid
Copy link

Of arduino-esp32:

git clone -b idf-update https://github.com/espressif/arduino-esp32.git

@copercini
Copy link
Contributor

It's already merged here 96822d7

so just clone the main repo

@copercini
Copy link
Contributor

Fixed on 96822d7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants