Arduino-esp32: Arduino Fails to Build as ESP-IDF Component - Fatal Error

Created on 10 Sep 2018  路  19Comments  路  Source: espressif/arduino-esp32

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

All 19 comments

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

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

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

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

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

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.

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

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

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.

Cool.

Simple workaround:

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

Change line:

include "apps/sntp/sntp.h"

With:

include "lwip/apps/sntp.h"

https://github.com/espressif/arduino-esp32/blob/a0f0bd930cfd2d607bf3d3288f46e2d265dd2e11/cores/esp32/esp32-hal-time.c#L16

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

thanks will try that out later

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

As per https://github.com/espressif/arduino-esp32/issues/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).

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"

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

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 ?

Of arduino-esp32:

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

Was this page helpful?
0 / 5 - 0 ratings