Page 1 of 2

Problem compiling code(esp32)

Posted: Mon Dec 21, 2020 3:56 am
by xingkunpeng
Hi,

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

More specifically:
lighthouse@VM-0-14-ubuntu:~$ cd esp/micropython/ports/esp32
lighthouse@VM-0-14-ubuntu:~/esp/micropython/ports/esp32$ sudo make
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
Building with ESP IDF v3
mkdir -p build-GENERIC/bootloader/"/home/lighthouse/esp/esp-idf"/components/bootloader/subproject/main/
mkdir -p build-GENERIC/bootloader/"/home/lighthouse/esp/esp-idf"/components/bootloader_support/src/
mkdir -p build-GENERIC/bootloader/"/home/lighthouse/esp/esp-idf"/components/log/
mkdir -p build-GENERIC/bootloader/"/home/lighthouse/esp/esp-idf"/components/micro-ecc/micro-ecc/
mkdir -p build-GENERIC/bootloader/"/home/lighthouse/esp/esp-idf"/components/soc/esp32/
mkdir -p build-GENERIC/bootloader/"/home/lighthouse/esp/esp-idf"/components/soc/src/
mkdir -p build-GENERIC/bootloader/"/home/lighthouse/esp/esp-idf"/components/spi_flash/
AR build-GENERIC/bootloader/libbootloader_support.a
/home/lighthouse/esp/xtensa-esp32-elf/bin/xtensa-esp32-elf-ar: build-GENERIC/bootloader//home/lighthouse/esp/esp-idf/components/bootloader_support/src/bootloader_clock.o: No such file or directory
make: *** [Makefile:835: build-GENERIC/bootloader/libbootloader_support.a] Error 1


The content in makefile is:
ESPIDF ?= "/home/lighthouse/esp/esp-idf"
BOARD ?= GENERIC
CROSS_COMPILE ?= /home/lighthouse/esp/xtensa-esp32-elf/bin/xtensa-esp32-elf-
include Makefile



I feel that many problems have been solved before compiling this firmware. Now I feel that it is the worst step. I am stuck here. Hope to get help!



In addition, the V3 V4 version of espidf has been tried, and this error is reported.

(the makefile of ports / esp32 supports two versions of espidf, one V3 and one V4)

Any help would be appreciated!!!!

Re: Problem compiling code(esp32)

Posted: Mon Dec 21, 2020 8:16 am
by xingkunpeng
Add a log:


lighthouse@VM-0-14-ubuntu:~/esp/micropython/ports/esp32$ sudo make V=1
Building with ESP IDF v3
mkdir -p build-GENERIC/bootloader/"/home/lighthouse/esp/esp-idf"/components/bootloader/subproject/main/
mkdir -p build-GENERIC/bootloader/"/home/lighthouse/esp/esp-idf"/components/bootloader_support/src/
mkdir -p build-GENERIC/bootloader/"/home/lighthouse/esp/esp-idf"/components/log/
mkdir -p build-GENERIC/bootloader/"/home/lighthouse/esp/esp-idf"/components/micro-ecc/micro-ecc/
mkdir -p build-GENERIC/bootloader/"/home/lighthouse/esp/esp-idf"/components/soc/esp32/
mkdir -p build-GENERIC/bootloader/"/home/lighthouse/esp/esp-idf"/components/soc/src/
mkdir -p build-GENERIC/bootloader/"/home/lighthouse/esp/esp-idf"/components/spi_flash/
AR build-GENERIC/bootloader/libbootloader_support.a
/home/lighthouse/esp/xtensa-esp32-elf/bin/xtensa-esp32-elf-ar cr build-GENERIC/bootloader/libbootloader_support.a build-GENERIC/bootloader/"/home/lighthouse/esp/esp-idf"/components/bootloader_support/src/bootloader_clock.o build-GENERIC/bootloader/"/home/lighthouse/esp/esp-idf"/components/bootloader_support/src/bootloader_common.o build-GENERIC/bootloader/"/home/lighthouse/esp/esp-idf"/components/bootloader_support/src/bootloader_flash.o build-GENERIC/bootloader/"/home/lighthouse/esp/esp-idf"/components/bootloader_support/src/bootloader_flash_config.o build-GENERIC/bootloader/"/home/lighthouse/esp/esp-idf"/components/bootloader_support/src/bootloader_init.o build-GENERIC/bootloader/"/home/lighthouse/esp/esp-idf"/components/bootloader_support/src/bootloader_random.o build-GENERIC/bootloader/"/home/lighthouse/esp/esp-idf"/components/bootloader_support/src/bootloader_utility.o build-GENERIC/bootloader/"/home/lighthouse/esp/esp-idf"/components/bootloader_support/src/flash_qio_mode.o build-GENERIC/bootloader/"/home/lighthouse/esp/esp-idf"/components/bootloader_support/src/esp_image_format.o build-GENERIC/bootloader/"/home/lighthouse/esp/esp-idf"/components/bootloader_support/src/flash_encrypt.o build-GENERIC/bootloader/"/home/lighthouse/esp/esp-idf"/components/bootloader_support/src/flash_partitions.o build-GENERIC/bootloader/"/home/lighthouse/esp/esp-idf"/components/bootloader_support/src/bootloader_sha.o build-GENERIC/bootloader/"/home/lighthouse/esp/esp-idf"/components/bootloader_support/src/secure_boot_signatures.o build-GENERIC/bootloader/"/home/lighthouse/esp/esp-idf"/components/bootloader_support/src/secure_boot.o
/home/lighthouse/esp/xtensa-esp32-elf/bin/xtensa-esp32-elf-ar: build-GENERIC/bootloader//home/lighthouse/esp/esp-idf/components/bootloader_support/src/bootloader_clock.o: No such file or directory
make: *** [Makefile:835: build-GENERIC/bootloader/libbootloader_support.a] Error 1

Re: Problem compiling code(esp32)

Posted: Wed Dec 23, 2020 4:11 pm
by hcet14
@xingkunpeng Did you solve your problem?

I have a similar problem when compiling org. micropython from github for ESP8266 with an additional softuart. File sofuart.o exists. I have no clue where to look for the problem!
Any hint would be appreciated 8-)
  • b/utils/pyexec.o build-GENERIC/lib/utils/interrupt_char.o build-GENERIC/lib/utils/sys_stdio_mphal.o build-GENERIC/drivers/bus/softspi.o build-GENERIC/drivers/dht/dht.o -L/tools/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/lib -lmain -ljson -llwip_open -lpp -lnet80211 -lwpa -lphy -lnet80211 -L/tools/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.5/ -lgcc
    xtensa-lx106-elf-ld: cannot find softuart.o

    mphal.o build-GENERIC/esp_init_data.o build-GENERIC/gccollect.o build-GENERIC/lexerstr32.o build-GENERIC/uart.o build-GENERIC/softuart.o build-GENERIC/esppwm.o build-GENERIC/espneopixel.o build-GENERIC/espapa102.o build-GENERIC/modp

Re: Problem compiling code(esp32)

Posted: Wed Dec 23, 2020 4:35 pm
by ellisjr
I'm afraid I am not skilled enough to diagnose your problems. What I can tell you is that I had loads of problems creating the system to build MicroPython, but all of them were solved by re-reading the instructions, each time more carefully. I wish I had read them incredibly carefully the first time :roll: :lol:

Took me three days overall, but it was worth it. Good luck!

Re: Problem compiling code(esp32)

Posted: Tue Dec 29, 2020 4:38 am
by xingkunpeng
我又重新走了一遍,成功了。(当然,这之前我尝试了好多遍)
这一遍重点注意了一个地方,那就是所有加了sudo的地方,全部拒掉了,因为这可能会印象环境变量。我现在感觉就是这样,我把这个经验分享出来,希望可以帮到大家
I walked again and made it. (of course, I've tried it many times before.)

This time, we focus on one thing, that is, all the places added sudo are rejected, because it may affect the environment variables. I feel like this now. I share this experience and hope it can help you!

Re: Problem compiling code(esp32)

Posted: Mon Jan 11, 2021 12:16 am
by jimmo
xingkunpeng wrote:
Mon Dec 21, 2020 3:56 am
ESPIDF ?= "/home/lighthouse/esp/esp-idf"
Can you try without the quotes around this?

You also shouldn't need sudo.

Re: Problem compiling code(esp32)

Posted: Tue Apr 13, 2021 5:02 am
by xingkunpeng
Yes, I did as you said. It's OK

Re: Problem compiling code(esp32)

Posted: Tue Apr 13, 2021 5:10 am
by xingkunpeng
hcet14 wrote:
Wed Dec 23, 2020 4:11 pm
@xingkunpeng Did you solve your problem?

I have a similar problem when compiling org. micropython from github for ESP8266 with an additional softuart. File sofuart.o exists. I have no clue where to look for the problem!
Any hint would be appreciated 8-)
  • b/utils/pyexec.o build-GENERIC/lib/utils/interrupt_char.o build-GENERIC/lib/utils/sys_stdio_mphal.o build-GENERIC/drivers/bus/softspi.o build-GENERIC/drivers/dht/dht.o -L/tools/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/lib -lmain -ljson -llwip_open -lpp -lnet80211 -lwpa -lphy -lnet80211 -L/tools/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.5/ -lgcc
    xtensa-lx106-elf-ld: cannot find softuart.o

    mphal.o build-GENERIC/esp_init_data.o build-GENERIC/gccollect.o build-GENERIC/lexerstr32.o build-GENERIC/uart.o build-GENERIC/softuart.o build-GENERIC/esppwm.o build-GENERIC/espneopixel.o build-GENERIC/espapa102.o build-GENERIC/modp
As I said, when executing the command, almost all sudos are removed, including make, and then it's OK

Re: Problem compiling code(esp32)

Posted: Tue Apr 13, 2021 5:11 am
by xingkunpeng
jimmo wrote:
Mon Jan 11, 2021 12:16 am
xingkunpeng wrote:
Mon Dec 21, 2020 3:56 am
ESPIDF ?= "/home/lighthouse/esp/esp-idf"
Can you try without the quotes around this?

You also shouldn't need sudo.
Yes, I did as you said. It's OK

Re: Problem compiling code(esp32)

Posted: Tue Apr 13, 2021 5:11 am
by xingkunpeng
ellisjr wrote:
Wed Dec 23, 2020 4:35 pm
I'm afraid I am not skilled enough to diagnose your problems. What I can tell you is that I had loads of problems creating the system to build MicroPython, but all of them were solved by re-reading the instructions, each time more carefully. I wish I had read them incredibly carefully the first time :roll: :lol:

Took me three days overall, but it was worth it. Good luck!
Thank you very much and best wishes!