Problem compiling code

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
nikanta
Posts: 4
Joined: Sun Jun 16, 2019 10:28 am

Problem compiling code

Post by nikanta » Sun Jun 16, 2019 11:06 am

Hello

I am trying to compile the micropython source code with no succes
I get errors when running make at micropython/ports/esp32
More specifically:

[b]When running "make" i get this error:[/b]
[code] Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
find: ‘/components’: No such file or directory
find: ‘/components’: No such file or directory
find: ‘/components’: No such file or directory
GEN build/sdkconfig.h
/usr/bin/python3: can't find '__main__' module in '/home/nikitas/ESP32/esp/esp-idf'
Makefile:239: recipe for target 'build/sdkconfig.h' failed
make: *** [build/sdkconfig.h] Error 1 [/code]

[b]When running "make V=1" i get this error:[/b]
[code]find: ‘/components’: No such file or directory
find: ‘/components’: No such file or directory
find: ‘/components’: No such file or directory
GEN build/sdkconfig.h
mkdir -p build/
python3 /home/nikitas/ESP32/esp/esp-idf /tools/kconfig_new/confgen.py \
--output header build/sdkconfig.h \
--config boards/sdkconfig \
--kconfig /home/nikitas/ESP32/esp/esp-idf /Kconfig \
--env "IDF_TARGET=esp32" \
--env "IDF_CMAKE=n" \
--env "COMPONENT_KCONFIGS=/home/nikitas/ESP32/esp/esp-idf/tools/ldgen/test/data/Kconfig /home/nikitas/ESP32/esp/esp-idf/tools/unit-test-app/components/test_utils/Kconfig /home/nikitas/ESP32/esp/esp-idf/tools/kconfig/Kconfig /home/nikitas/ESP32/esp/esp-idf/tools/kconfig_new/test/Kconfig /home/nikitas/ESP32/esp/esp-idf/components/spiffs/Kconfig /home/nikitas/ESP32/esp/esp-idf/components/vfs/Kconfig /home/nikitas/ESP32/esp/esp-idf/components/heap/Kconfig /home/nikitas/ESP32/esp/esp-idf/components/esp_http_server/Kconfig /home/nikitas/ESP32/esp/esp-idf/components/pthread/Kconfig /home/nikitas/ESP32/esp/esp-idf/components/freertos/Kconfig /home/nikitas/ESP32/esp/esp-idf/components/mdns/Kconfig /home/nikitas/ESP32/esp/esp-idf/components/esp_http_client/Kconfig /home/nikitas/ESP32/esp/esp-idf/components/nvs_flash/Kconfig /home/nikitas/ESP32/esp/esp-idf/components/freemodbus/Kconfig /home/nikitas/ESP32/esp/esp-idf/components/mbedtls/Kconfig /home/nikitas/ESP32/esp/esp-idf/components/log/Kconfig /home/nikitas/ESP32/esp/esp-idf/components/esp32/Kconfig /home/nikitas/ESP32/esp/esp-idf/components/ethernet/Kconfig /home/nikitas/ESP32/esp/esp-idf/components/mqtt/Kconfig /home/nikitas/ESP32/esp/esp-idf/components/esp_adc_cal/Kconfig /home/nikitas/ESP32/esp/esp-idf/components/bt/Kconfig /home/nikitas/ESP32/esp/esp-idf/components/wear_levelling/Kconfig /home/nikitas/ESP32/esp/esp-idf/components/spi_flash/Kconfig /home/nikitas/ESP32/esp/esp-idf/components/lwip/Kconfig /home/nikitas/ESP32/esp/esp-idf/components/openssl/Kconfig /home/nikitas/ESP32/esp/esp-idf/components/app_trace/Kconfig /home/nikitas/ESP32/esp/esp-idf/components/libsodium/Kconfig /home/nikitas/ESP32/esp/esp-idf/components/driver/Kconfig /home/nikitas/ESP32/esp/esp-idf/components/tcpip_adapter/Kconfig /home/nikitas/ESP32/esp/esp-idf/components/esp_event/Kconfig /home/nikitas/ESP32/esp/esp-idf/components/aws_iot/Kconfig /home/nikitas/ESP32/esp/esp-idf/components/fatfs/Kconfig /home/nikitas/ESP32/esp/esp-idf/components/unity/Kconfig /home/nikitas/ESP32/esp/esp-idf/examples/bluetooth/gatt_server/main/Kconfig /home/nikitas/ESP32/esp/esp-idf/examples/bluetooth/ble_throughput/throughput_client/main/Kconfig /home/nikitas/ESP32/esp/esp-idf/examples/bluetooth/ble_throughput/throughput_server/main/Kconfig /home/nikitas/ESP32/esp/esp-idf/Kconfig" \
--env "COMPONENT_KCONFIGS_PROJBUILD=/home/nikitas/ESP32/esp/esp-idf/components/partition_table/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/components/mqtt/esp-mqtt/examples/emitter-client/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/components/bootloader/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/components/esptool_py/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/components/app_update/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/mesh/internal_communication/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/mesh/manual_networking/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/wifi/scan/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/wifi/power_save/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/wifi/getting_started/station/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/wifi/getting_started/softAP/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/wifi/wps/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/wifi/simple_sniffer/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/wifi/espnow/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/wifi/wpa2_enterprise/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/peripherals/i2c/i2c_self_test/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/peripherals/i2c/i2c_tools/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/peripherals/sdio/host/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/peripherals/sdio/slave/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/peripherals/adc2/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/peripherals/uart/nmea0183_parser/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/peripherals/spi_master/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/system/console/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/system/ota/native_ota_example/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/system/ota/simple_ota_example/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/system/sysview_tracing/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/system/app_trace_to_host/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/system/deep_sleep/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/system/gcov/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/system/base_mac_address/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/ethernet/ethernet/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/ethernet/iperf/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/protocols/asio/chat_client/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/protocols/asio/tcp_echo_server/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/protocols/asio/chat_server/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/protocols/asio/udp_echo_server/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/protocols/sntp/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/protocols/http_request/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/protocols/mdns/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/protocols/esp_http_client/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/protocols/https_mbedtls/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/protocols/openssl_server/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/protocols/coap_server/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/protocols/https_server/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/protocols/modbus_slave/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/protocols/http2_request/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/protocols/http_server/simple/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/protocols/http_server/advanced_tests/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/protocols/http_server/file_serving/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/protocols/http_server/persistent_sockets/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/protocols/mqtt/ws/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/protocols/mqtt/ssl/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/protocols/mqtt/wss/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/protocols/mqtt/ssl_mutual_auth/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/protocols/mqtt/tcp/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/protocols/pppos_client/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/protocols/sockets/udp_server/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/protocols/sockets/tcp_client/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/protocols/sockets/udp_client/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/protocols/sockets/udp_multicast/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/protocols/sockets/tcp_server/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/protocols/https_request/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/protocols/aws_iot/thing_shadow/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/protocols/aws_iot/subscribe_publish/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/protocols/openssl_client/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/protocols/coap_client/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/provisioning/console_prov/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/provisioning/custom_config/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/provisioning/ble_prov/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/provisioning/softap_prov/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/get-started/blink/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/bluetooth/gatt_client/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/bluetooth/ble_ibeacon/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/bluetooth/a2dp_sink/main/Kconfig.projbuild /home/nikitas/ESP32/esp/esp-idf/examples/bluetooth/a2dp_gatts_coex/main/Kconfig.projbuild"
/usr/bin/python3: can't find '__main__' module in '/home/nikitas/ESP32/esp/esp-idf'
Makefile:239: recipe for target 'build/sdkconfig.h' failed
make: *** [build/sdkconfig.h] Error 1[/code]

If i am understanding correctly, it seems as if the the components folder in esp-idf is not found?
But the folder exists
I have made the makefile in my ports/esp32 folder which has the following code:
[code]ESPIDF = $(HOME)/ESP32/esp/esp-idf #<path to root of esp-idf repository>
#PORT = /dev/ttyUSB0
#FLASH_MODE = qio
#FLASH_SIZE = 4MB
#CROSS_COMPILE = xtensa-esp32-elf-
include Makefile[/code]
With this file i have configured the path of my esp-idf directory

Any help would be appreciated

User avatar
jimmo
Posts: 311
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia

Re: Problem compiling code

Post by jimmo » Sun Jun 16, 2019 11:53 am

Makefiles are weird and mysterious.

In your `makefile`, the following line

Code: Select all

ESPIDF = $(HOME)/ESP32/esp/esp-idf #<path to root of esp-idf repository>
is equivalent to:

Code: Select all

ESPIDF = "$(HOME)/ESP32/esp/esp-idf "
So I guess either put no space before the #, or remove the comment entirely.

nikanta
Posts: 4
Joined: Sun Jun 16, 2019 10:28 am

Re: Problem compiling code

Post by nikanta » Sun Jun 16, 2019 2:38 pm

That definitely did the trick
Now it is building and copying the data to the build folder
I am getting another error againg though

[code]Traceback (most recent call last):
File "/home/nikitas/ESP32/esp/esp-idf/tools/ldgen/ldgen.py", line 22, in <module>
from fragments import FragmentFileModel
File "/home/nikitas/ESP32/esp/esp-idf/tools/ldgen/fragments.py", line 20, in <module>
from sdkconfig import SDKConfig
File "/home/nikitas/ESP32/esp/esp-idf/tools/ldgen/sdkconfig.py", line 18, in <module>
from pyparsing import Word, printables, Combine, Literal, hexnums, quotedString, Optional, nums, removeQuotes, oneOf, Group, infixNotation, opAssoc
ModuleNotFoundError: No module named 'pyparsing'
Makefile:808: recipe for target 'build/esp32.common.ld' failed
make: *** [build/esp32.common.ld] Error 1[/code]

I did install pyparsing using "pip install pyparsing" which installed pyparsing-2.4.0
Still the same error

User avatar
jimmo
Posts: 311
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia

Re: Problem compiling code

Post by jimmo » Sun Jun 16, 2019 5:43 pm

Is your system default python (and pip) the same as what the buiild uses?

nikanta
Posts: 4
Joined: Sun Jun 16, 2019 10:28 am

Re: Problem compiling code

Post by nikanta » Mon Jun 17, 2019 10:24 am

When entering python in the terminal i get Python 2.7.15+ (default, Nov 27 2018, 23:36:35)
When entering pip --version i get pip 9.0.1 from /usr/lib/python2.7/dist-packages (python 2.7)

How do i check the version my build is using and if needed how do i change it?

User avatar
jimmo
Posts: 311
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia

Re: Problem compiling code

Post by jimmo » Mon Jun 17, 2019 10:52 am

in py/mkenv.mk it sets

Code: Select all

PYTHON = python3
(I seem to recall this was a relatively recent change)

Use

Code: Select all

make PYTHON=python2
(Or build inside a python3 venv)

nikanta
Posts: 4
Joined: Sun Jun 16, 2019 10:28 am

Re: Problem compiling code

Post by nikanta » Mon Jun 17, 2019 11:04 am

That worked perfectly
Build compiled successfully
Thank you very much for your help

Post Reply