Skip to content

Build failed on ESP_IDF #3215

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

Closed
boonkey opened this issue Sep 16, 2019 · 5 comments
Closed

Build failed on ESP_IDF #3215

boonkey opened this issue Sep 16, 2019 · 5 comments

Comments

@boonkey
Copy link

boonkey commented Sep 16, 2019

Hardware: (irrelevant for this issue)

Board: M5 ESP32CAM
Core Installation/update date: latest
IDE name: IDF-with Arduino
Flash Frequency: 40
Flash size: 4 MB
PSRAM enabled: ?no?
Upload Speed: ?115200?
Computer OS: Ubuntu 18.04.3 LTS

I'm trying to add the HTTPClient header file (and all associated files, libraries, methods, etc.) to M5's WIFI_STA project (link) in order to be able to send GET requests.

I followed the steps in the docs (doc):

  1. cloned the repo into components/ as arduino/
  2. tried to make
    I had the exact same issue as WiFiClientSecure make issue #2154, so I followed the instructions there to solve.
  3. Component Config -> mbedTLS -> TLS Key Exchange Methods -> [*] Enable pre-shared-key ciphersuits [*] Enable PSK based ciphersuite modes
    I now still have building issues, appearing unrelated to the previous one.

LOG:

In file included from /home/user/esp/m5stack-cam-psram/wifi/wifi_sta/main/main.c:18:0: /home/user/esp/m5stack-cam-psram/wifi/wifi_sta/components/arduino/libraries/HTTPClient/src/HTTPClient.h:32:18: fatal error: memory: No such file or directory compilation terminated. /home/user/esp/esp-idf/make/component_wrapper.mk:285: recipe for target 'main.o' failed make[1]: *** [main.o] Error 1 /home/user/esp/esp-idf/make/project.mk:530: recipe for target 'component-main-build' failed make: *** [component-main-build] Error 2
please help me to solve this issue.
Thanks

@me-no-dev
Copy link
Member

you forgot to mention the ESP-IDF version, but I will guess it's not 3.2 :)
Arduino tracks IDF branch release/3.2 currently

@boonkey
Copy link
Author

boonkey commented Sep 18, 2019

I changed ESP-IDF version to release/3.2 as instructed :
cd ~/esp/esp-idf; git checkout release/v3.2; git submodule update --init --recursive;

I went and tried to make again, but it still failed:
In file included from /home/user/esp/m5stack-cam-psram/wifi/wifi_sta/main/main.c:18:0: /home/user/esp/m5stack-cam-psram/wifi/wifi_sta/components/arduino/libraries/HTTPClient/src/HTTPClient.h:32:18: fatal error: memory: No such file or directory compilation terminated. /home/user/esp/esp-idf/make/component_wrapper.mk:285: recipe for target 'main.o' failed make[1]: *** [main.o] Error 1 /home/user/esp/esp-idf/make/project.mk:530: recipe for target 'component-main-build' failed make: *** [component-main-build] Error 2

@boonkey
Copy link
Author

boonkey commented Sep 18, 2019

just to be sure, I've DELETED EVERYTHING and started on a clean slate.
I have done most of my checking make commands without extra threads

Maybe I had something done wrong. I'm writing this as I'm doing it, so everything I write is what has just happend:

Download ESP-IDF

  1. cd ~/esp
  2. git clone -b release/v3.2 --recursive https://github.com/espressif/esp-idf.git
  3. cd ~/esp/esp-idf
  4. git submodule update --init --recursive

Clone the M5stack repo on which I'm basing my project:

  1. cd ~/esp
  2. git clone https://github.com/m5stack/m5stack-cam-psram.git
  3. cd ~/esp/m5stack-cam-psram/wifi/wifi_sta
  4. changed WiFi credentials to connect to my WiFi.
  5. make menuconfig && make flash

after setting menuconfig as required, everything has compiled and ran as expected

Clone this library into my project (following instruction from To use as a component of ESP-IDF :

  1. cd components && \ git clone https://github.com/espressif/arduino-esp32.git arduino && \ cd arduino && \ git submodule update --init --recursive && \ cd ../.. && \ make menuconfig

  2. I got a build error:
    /home/dan/esp/m5stack-cam-psram/wifi/wifi_sta/components/arduino/libraries/WiFiClientSecure/src/ssl_client.cpp: In function 'int start_ssl_client(sslclient_context*, const char*, uint32_t, int, const char*, const char*, const char*, const char*, const char*)':
    /home/dan/esp/m5stack-cam-psram/wifi/wifi_sta/components/arduino/libraries/WiFiClientSecure/src/ssl_client.cpp:149:67: error: 'mbedtls_ssl_conf_psk' was not declared in this scope (const unsigned char *)pskIdent, strlen(pskIdent));
    ^
    /home/dan/esp/esp-idf/make/component_wrapper.mk:285: recipe for target 'libraries/WiFiClientSecure/src//ssl_client.o' failed
    make[1]: *** [libraries/WiFiClientSecure/src//ssl_client.o] Error 1
    make[1]: *** Waiting for unfinished jobs....
    /home/dan/esp/esp-idf/make/project.mk:530: recipe for target 'component-arduino-build' failed
    make: *** [component-arduino-build] Error 2

I used the solution in #2154
3. make menuconfig
4. Component Config -> mbedTLS -> TLS Key Exchange Methods ->
[*] Enable pre-shared-key ciphersuits
[*] Enable PSK based ciphersuite modes

  1. make clean && make

The make command failed with this error:
Python requirements from /home/dan/esp/esp-idf/requirements.txt are satisfied. /home/dan/esp/esp-idf/components/partition_table/Makefile.projbuild:60: warning: undefined variable 'quote'
Building partitions from /home/dan/esp/m5stack-cam-psram/wifi/wifi_sta/components/arduino/tools/partitions/default.csv...
Partitions defined in '/home/dan/esp/m5stack-cam-psram/wifi/wifi_sta/components/arduino/tools/partitions/default.csv' occupy 4.0MB of flash (4194304 bytes) which does not fit in configured flash size 2MB. Change the flash size in menuconfig under the 'Serial Flasher Config' menu.
/home/dan/esp/esp-idf/components/partition_table/Makefile.projbuild:60: recipe for target '/home/dan/esp/m5stack-cam-psram/wifi/wifi_sta/build/default.bin' failed
make: *** [/home/dan/esp/m5stack-cam-psram/wifi/wifi_sta/build/default.bin] Error 2

I've verified that my device (ESP32CAM) has enough flash to 4MB, which it does.
6. make menuconfig

  1. Serial flasher config -> Flash size -> 4MB

  2. make clean && make

compilation passed without errors. I re-checked by running step 8 numerous times, all passing.

  1. make -j6 flash monitor

run passed without errors

Add use of this library to my code:

using instructions from here

  1. add includes to code:
    #include <WiFi.h>
    #include <HTTPClient.h>

  2. make clean && make

this time I got LOTS OF ERRORS

In file included from /home/dan/esp/m5stack-cam-psram/wifi/wifi_sta/components/arduino/cores/esp32/Print.h:27:0, from /home/dan/esp/m5stack-cam-psram/wifi/wifi_sta/components/arduino/libraries/WiFi/src/WiFi.h:27, from /home/dan/esp/m5stack-cam-psram/wifi/wifi_sta/main/main.c:2: /home/dan/esp/m5stack-cam-psram/wifi/wifi_sta/components/arduino/cores/esp32/Printable.h:25:1: error: unknown type name 'class' class Print; ^ /home/dan/esp/m5stack-cam-psram/wifi/wifi_sta/components/arduino/cores/esp32/Printable.h:33:1: error: unknown type name 'class' class Printable ^ /home/dan/esp/m5stack-cam-psram/wifi/wifi_sta/components/arduino/cores/esp32/Printable.h:34:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token { ^ In file included from /home/dan/esp/m5stack-cam-psram/wifi/wifi_sta/components/arduino/libraries/WiFi/src/WiFi.h:27:0, from /home/dan/esp/m5stack-cam-psram/wifi/wifi_sta/main/main.c:2: /home/dan/esp/m5stack-cam-psram/wifi/wifi_sta/components/arduino/cores/esp32/Print.h:34:1: error: unknown type name 'class' class Print ^ /home/dan/esp/m5stack-cam-psram/wifi/wifi_sta/components/arduino/cores/esp32/Print.h:35:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token { ^ In file included from /home/dan/esp/m5stack-cam-psram/wifi/wifi_sta/components/arduino/libraries/WiFi/src/WiFi.h:28:0, from /home/dan/esp/m5stack-cam-psram/wifi/wifi_sta/main/main.c:2: /home/dan/esp/m5stack-cam-psram/wifi/wifi_sta/components/arduino/cores/esp32/IPAddress.h:29:1: error: unknown type name 'class' class IPAddress: public Printable ^ /home/dan/esp/m5stack-cam-psram/wifi/wifi_sta/components/arduino/cores/esp32/IPAddress.h:29:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token class IPAddress: public Printable ^ /home/dan/esp/m5stack-cam-psram/wifi/wifi_sta/components/arduino/cores/esp32/IPAddress.h:94:7: error: unknown type name 'IPAddress' const IPAddress INADDR_NONE(0, 0, 0, 0); ^ /home/dan/esp/m5stack-cam-psram/wifi/wifi_sta/components/arduino/cores/esp32/IPAddress.h:94:29: error: expected declaration specifiers or '...' before numeric constant const IPAddress INADDR_NONE(0, 0, 0, 0); ^ /home/dan/esp/m5stack-cam-psram/wifi/wifi_sta/components/arduino/cores/esp32/IPAddress.h:94:32: error: expected declaration specifiers or '...' before numeric constant const IPAddress INADDR_NONE(0, 0, 0, 0); ^ /home/dan/esp/m5stack-cam-psram/wifi/wifi_sta/components/arduino/cores/esp32/IPAddress.h:94:35: error: expected declaration specifiers or '...' before numeric constant const IPAddress INADDR_NONE(0, 0, 0, 0); ^ /home/dan/esp/m5stack-cam-psram/wifi/wifi_sta/components/arduino/cores/esp32/IPAddress.h:94:38: error: expected declaration specifiers or '...' before numeric constant const IPAddress INADDR_NONE(0, 0, 0, 0); ^ In file included from /home/dan/esp/m5stack-cam-psram/wifi/wifi_sta/components/arduino/libraries/WiFi/src/WiFi.h:29:0, esp32/Printable.h:25:1: error: unknown type name 'class' from /home/dan/esp/m5stack-cam-psram/wifi/wifi_sta/main/main.c:2: /home/dan/esp/m5stack-cam-psram/wifi/wifi_sta/components/arduino/cores/esp32/IPv6Address.h:29:1: error: unknown type name 'class' class IPv6Address: public Printable ^ /home/dan/esp/m5stack-cam-psram/wifi/wifi_sta/components/arduino/cores/esp32/IPv6Address.h:29:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token class IPv6Address: public Printable ^ In file included from /home/dan/esp/m5stack-cam-psram/wifi/wifi_sta/components/arduino/libraries/WiFi/src/WiFiSTA.h:28:0, from /home/dan/esp/m5stack-cam-psram/wifi/wifi_sta/components/arduino/libraries/WiFi/src/WiFi.h:32, from /home/dan/esp/m5stack-cam-psram/wifi/wifi_sta/main/main.c:2: /home/dan/esp/m5stack-cam-psram/wifi/wifi_sta/components/arduino/libraries/WiFi/src/WiFiGeneric.h:28:22: fatal error: functional: No such file or directory compilation terminated. /home/dan/esp/esp-idf/make/component_wrapper.mk:285: recipe for target 'main.o' failed make[1]: *** [main.o] Error 1 /home/dan/esp/esp-idf/make/project.mk:530: recipe for target 'component-main-build' failed make: *** [component-main-build] Error 2
3. I found bug #116 and followed instructions: change all my C files to C++

  1. make clean && make

resulted in lots of /home/dan/esp/m5stack-cam-psram/wifi/wifi_sta/main/main.cpp:73:1: sorry, unimplemented: non-trivial designated initializers not supported errors. solving them included:
a. change all non-trivial designated initializers
b. adding extern "C" to void app_main()
c. changing CMakeLists.txt

so far so good, the code compiled and ran

  1. adding code section from the instructions, and make.

code is compiling. This bug is over.

@me-no-dev for future times, please don't dismiss so easily. the problem wasn't compiler version (but a whole different sets of problems)

@Boldie
Copy link
Contributor

Boldie commented Oct 15, 2019

Thanks for this "tutorial", I ran to the same problem with my port. Since this is a config problem, why is this not catched in the code with a #ifndef XY #error A GOOD DESCRIPTION ....

@atanisoft
Copy link
Collaborator

Thanks for this "tutorial", I ran to the same problem with my port. Since this is a config problem, why is this not catched in the code with a #ifndef XY #error A GOOD DESCRIPTION ....

@Boldie Why not send in a PR to add those sort of config checks to the client code ....

Boldie pushed a commit to Boldie/arduino-esp32 that referenced this issue Oct 15, 2019
Especially if the user wants to use the library as component in IDF,
there are some pitfalls while doing make menuconfig. One is this missing
dependency which will now fail with a better error message with a hint to
the user how to fix it.

refs espressif#2154 espressif#3215
me-no-dev pushed a commit that referenced this issue Oct 17, 2019
#3364)

Especially if the user wants to use the library as component in IDF,
there are some pitfalls while doing make menuconfig. One is this missing
dependency which will now fail with a better error message with a hint to
the user how to fix it.

refs #2154 #3215
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

4 participants