micropython-builder icon indicating copy to clipboard operation
micropython-builder copied to clipboard

ESP32 in WSL2 environment

Open callimero opened this issue 2 years ago • 6 comments

Hey, great tool! I already build a firmware for the Pico with it.

System is Win10 with WSL(2) with Ubuntu as guest.

I now try to do that same for a ESP32 board. And I am stuck.

I come to

... Project build complete. To flash, run this command: /home/cw/.espressif/python_env/idf5.0_py3.8_env/bin/python ../../../esp-idf/components/esptool_py/esptool/esptool.py -p (PORT) -b 460800 --before default_reset --after hard_reset --chip esp32 write_flash --flash_mode dio --flash_size 4MB --flash_freq 40m 0x1000 build-ESP32_GENERIC/bootloader/bootloader.bin 0x8000 build-ESP32_GENERIC/partition_table/partition-table.bin 0x10000 build-ESP32_GENERIC/micropython.bin or run 'idf.py -p (PORT) flash' bootloader @0x001000 23056 ( 5616 remaining) partitions @0x008000 3072 ( 1024 remaining) application @0x010000 1885120 ( 146496 remaining) total 1950656 make: Leaving directory '/home/cw/micropython-builder/micropython/ports/esp32'

I changed the (PORT) argument and the path to esptool.py

I get then:

cw@DESKTOP-PCKKJN6:~/micropython-builder$ /home/cw/.espressif/python_env/idf5.0_py3.8_env/bin/python ./esp-idf/components/esptool_py/esptool/esptool. py -p /dev/ttyACM0 -b 460800 --before default_reset --after hard_reset --chip esp32 write_flash --flash_mode dio --flash_size 4MB --flash_freq 40m 0 x1000 build-ESP32_GENERIC/bootloader/bootloader.bin 0x8000 build-ESP32_GENERIC/partition_table/partition-table.bin 0x10000 build-ESP32_GENERIC/microp ython.bin usage: esptool write_flash [-h] [--erase-all] [--flash_freq {keep,80m,60m,48m,40m,30m,26m,24m,20m,16m,15m,12m}] [--flash_mode {keep,qio,qout,dio,dout}] [--flash_size {detect,keep,256KB,512KB,1MB,2MB,2MB-c1,4MB,4MB-c1,8MB,16MB,32MB,64MB,128MB}] [--spi-connection SPI_CONNECTION] [--no-progress] [--verify] [--encrypt] [--encrypt-files <address> <filename> [<address> <filename> ...]] [--ignore-flash-encryption-efuse-setting] [--force] [--compress | --no-compress] <address> <filename> [<address> <filename> ...] esptool write_flash: error: argument <address> <filename>: [Errno 2] No such file or directory: 'build-ESP32_GENERIC/bootloader/bootloader.bin' So I am as it seems in a wrong path after the command.

cw@DESKTOP-PCKKJN6:~/micropython-builder$ ./scripts/esp32/generic.sh idf.py says:

cw@DESKTOP-PCKKJN6:~/micropython-builder$ python3 ./esp-idf/tools/idf.py -p /dev/ttyACM0 flash Please use idf.py only in an ESP-IDF shell environment. cw@DESKTOP-PCKKJN6:~/micropython-builder$

Help :) (I am quit out of my comfort zone here)

callimero avatar Dec 08 '23 13:12 callimero

Do you want to add this board to the github workflow here?

v923z avatar Dec 11 '23 21:12 v923z

It is a plain generic esp32 board, so it should work. I think I made some mistakes and the idf is not happy.

I did a restart not using micropython-builder (installed idf in the system and followed the instructions on the mp github) and that works :(

BTW: With a RP2 Board (Arduino RP2040 Nano Connect) it worked just fine.

callimero avatar Dec 12 '23 08:12 callimero

OK, but then it should be in the regular releases, re-compiled every two days: https://github.com/v923z/micropython-builder/releases

v923z avatar Dec 12 '23 21:12 v923z

Hi all, I am also looking for the firmware to run on an esp32 board (Arduino Nano ESP32) without customisation. For me the releases page looks like this: ReleasesPage Apologies if I am missing something obvious (I am also out of my depth here!), but I'm not sure which one of those files I should use? Or should I be navigating to some other page altogether? Thanks!

F-Bello avatar Apr 01 '24 16:04 F-Bello

The ESP32 build is broken at the moment, so no artifacts are uploaded to the release page. I'll try to sort it out. If you want to look at it yourself, here is where you would start: https://github.com/micropython/micropython/blob/master/.github/workflows/ports_esp32.yml

v923z avatar Apr 01 '24 19:04 v923z

Ah ok, thanks for letting me know!

F-Bello avatar Apr 01 '24 22:04 F-Bello