Skip to content
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

docker based "make flash" fails on Windows #552

Open
NordmeyerT opened this issue Feb 7, 2025 · 6 comments
Open

docker based "make flash" fails on Windows #552

NordmeyerT opened this issue Feb 7, 2025 · 6 comments

Comments

@NordmeyerT
Copy link

NordmeyerT commented Feb 7, 2025

On Windows 11
Calling make flash" fails with following error

esp@e64254eb300b:~/esp_wifi_repeater$ make flash
/home/esp/esp_wifi_repeater/../esp-open-sdk/xtensa-lx106-elf/bin/esptool.py --port /dev/ttyUSB0 --baud 460800  write_flash -ff 40m -fm dio -fs 4M 0x00000 firmware/0x00000.bin 0x02000 firmware/0x02000.bin 0x82000 firmware/0x82000.bin 0x3FC000 /home/esp/esp_wifi_repeater/../esp-open-sdk/sdk/bin/esp_init_data_default_v08_vdd33.bin
usage: esptool write_flash [-h] [--flash_freq {40m,26m,20m,80m}]
                           [--flash_mode {qio,qout,dio,dout}]
                           [--flash_size {detect,4m,2m,8m,16m,32m,16m-c1,32m-c1,32m-c2}]
                           [--no-progress] [--verify]
                           <address> <filename> [<address> <filename> ...]
esptool write_flash: error: argument <address> <filename>: [Errno 2] No such file or directory: '/home/esp/esp_wifi_repeater/../esp-open-sdk/sdk/bin/esp_init_data_default_v08_vdd33.bin'
Makefile:163: recipe for target 'flash' failed
make: *** [flash] Error 2

@hmueller01
Copy link
Contributor

This is fixed with #550 ...

@NordmeyerT
Copy link
Author

Now I get

esp@cc1e02be70ae:~/esp_wifi_repeater$ make flash
/home/esp/esp_wifi_repeater/../esp-open-sdk/xtensa-lx106-elf/bin/esptool.py --port /dev/ttyUSB0 --baud 460800  write_flash -ff 40m -fm dio -fs 4MB 0x00000 firmware/0x00000.bin 0x02000 firmware/0x02000.bin 0x82000 firmware/0x82000.bin
usage: esptool write_flash [-h] [--flash_freq {40m,26m,20m,80m}]
                           [--flash_mode {qio,qout,dio,dout}]
                           [--flash_size {detect,4m,2m,8m,16m,32m,16m-c1,32m-c1,32m-c2}]
                           [--no-progress] [--verify]
                           <address> <filename> [<address> <filename> ...]
esptool write_flash: error: argument --flash_size/-fs: invalid choice: '4mb' (choose from 'detect', '4m', '2m', '8m', '16m', '32m', '16m-c1', '32m-c1', '32m-c2')
Makefile:161: recipe for target 'flash' failed
make: *** [flash] Error 2

@NordmeyerT
Copy link
Author

this fixes the issue in Makefile

-ESPTOOLOPTS    = -ff 40m -fm dio -fs 4MB
+ESPTOOLOPTS    = -ff 40m -fm dio -fs 4m

@hmueller01
Copy link
Contributor

It was 32mb before. But this is deprecated. Modern esptool.py versions use

Flash Size: --flash_size, -fs
Size of the SPI flash, given in megabytes.

Valid values are: keep, detect, 256KB, 512KB, 1MB, 2MB, 4MB, 2MB-c1, 4MB-c1, 8MB, 16MB

See https://docs.espressif.com/projects/esptool/en/latest/esp8266/esptool/flash-modes.html

So this is again a problem of the old toolchain in the docker ... so we should revert this.

@hmueller01
Copy link
Contributor

As I said, the version in the docker is VERY old ...

/home/esp/esp_wifi_repeater/../esp-open-sdk/xtensa-lx106-elf/bin/esptool.py version
esptool.py v1.2

My SDK comes with esptool.py v2.8 resulting in

WARNING: Flash size arguments in megabits like '32m' are deprecated.
Please use the equivalent size '4MB'.
Megabit arguments may be removed in a future release.

Modern environment (PlatformIO):

~/.platformio/packages/tool-esptoolpy/esptool.py version
esptool.py v4.5.1

only supports
--flash_size {detect,keep,256KB,512KB,1MB,2MB,2MB-c1,4MB,4MB-c1,8MB,16MB,32MB,64MB,128MB}
esptool write_flash: error: argument --flash_size/-fs: invalid choice: '32m' (choose from detect, keep, 256KB, 512KB, 1MB, 2MB, 2MB-c1, 4MB, 4MB-c1, 8MB, 16MB, 32MB, 64MB, 128MB)

this fixes the issue in Makefile

-ESPTOOLOPTS    = -ff 40m -fm dio -fs 4MB
+ESPTOOLOPTS    = -ff 40m -fm dio -fs 4m

It's megabits, so 4m == 512kB ... not good.

@hmueller01
Copy link
Contributor

reverted, see #554

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

2 participants