Problem compiling code(esp32)

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
xingkunpeng
Posts: 13
Joined: Mon Dec 21, 2020 3:41 am

Problem compiling code(esp32)

Post by xingkunpeng » Mon Dec 21, 2020 3:56 am

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

xingkunpeng
Posts: 13
Joined: Mon Dec 21, 2020 3:41 am

Re: Problem compiling code(esp32)

Post by xingkunpeng » Mon Dec 21, 2020 8:16 am

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

User avatar
hcet14
Posts: 34
Joined: Sat Dec 19, 2020 12:59 am

Re: Problem compiling code(esp32)

Post by hcet14 » 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
I'm a beginner with this stuff and no programmer at all.

ellisjr
Posts: 24
Joined: Sun May 17, 2020 8:30 pm

Re: Problem compiling code(esp32)

Post by ellisjr » 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!
John Ellis
What cannot go wrong, will. What definitely cannot go wrong absolutely will... :roll:

xingkunpeng
Posts: 13
Joined: Mon Dec 21, 2020 3:41 am

Re: Problem compiling code(esp32)

Post by xingkunpeng » Tue Dec 29, 2020 4:38 am

我又重新走了一遍,成功了。(当然,这之前我尝试了好多遍)
这一遍重点注意了一个地方,那就是所有加了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!

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

Re: Problem compiling code(esp32)

Post by jimmo » 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.

xingkunpeng
Posts: 13
Joined: Mon Dec 21, 2020 3:41 am

Re: Problem compiling code(esp32)

Post by xingkunpeng » Tue Apr 13, 2021 5:02 am

Yes, I did as you said. It's OK

xingkunpeng
Posts: 13
Joined: Mon Dec 21, 2020 3:41 am

Re: Problem compiling code(esp32)

Post by xingkunpeng » Tue Apr 13, 2021 5:10 am

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

xingkunpeng
Posts: 13
Joined: Mon Dec 21, 2020 3:41 am

Re: Problem compiling code(esp32)

Post by xingkunpeng » Tue Apr 13, 2021 5:11 am

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

xingkunpeng
Posts: 13
Joined: Mon Dec 21, 2020 3:41 am

Re: Problem compiling code(esp32)

Post by xingkunpeng » Tue Apr 13, 2021 5:11 am

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!

Post Reply