M5Stack-Tough ESP32 upload fails, can anyone help?

I get the following error message after a successful compile, but then upload fails:

esptool write_flash: error: argument <address> <filename>: Address "{upload.erase_cmd}" must be a number

Using Arduin0 1.8.19 with Windows10.
I have used M5Core2 successfully and now have M5Stack-Tough, both use ESP32-S3.
I have loaded the correct board and M5Tough library and selected the correct board, M5Stack-Tough.
I have selected the correct port when the M5Stack-Tough is plugged in.
When I compile and upload any example sketches for M5Tough I get the error message above.

Can anyone help with this message and explain what I need to do?

Enable verbose output during upload and post the complete output you get.

I have been pointed to this fix in the M5Stack forum:
Have a look here: esptool write_flash: error: argument : Address "{upload.erase_cmd}" must be a number

Here is the full message after successful compilation:

Sketch uses 835953 bytes (63%) of program storage space. Maximum is 1310720 bytes.
Global variables use 40444 bytes (12%) of dynamic memory, leaving 287236 bytes for local variables. Maximum is 327680 bytes.
C:\Users\Gordon\AppData\Local\Arduino15\packages\m5stack\tools\esptool_py\3.3.0/esptool.exe --chip esp32 --port COM7 --baud 921600 --before default_reset --after hard_reset write_flash {upload.erase_cmd} -z --flash_mode dio --flash_freq 80m --flash_size 16MB 0x1000 C:\Users\Gordon\AppData\Local\Temp\arduino_build_195087/Time.ino.bootloader.bin 0x8000 C:\Users\Gordon\AppData\Local\Temp\arduino_build_195087/Time.ino.partitions.bin 0xe000 C:\Users\Gordon\AppData\Local\Arduino15\packages\m5stack\hardware\esp32\2.0.5/tools/partitions/boot_app0.bin 0x10000 C:\Users\Gordon\AppData\Local\Temp\arduino_build_195087/Time.ino.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 FLASH_SIZE]
                           [--spi-connection SPI_CONNECTION] [--no-progress]
                           [--verify] [--encrypt]
                           [--encrypt-files <address> <filename> [<address> <filename> ...]]
                           [--ignore-flash-encryption-efuse-setting]
                           [--compress | --no-compress]
                           <address> <filename> [<address> <filename> ...]
esptool write_flash: error: argument <address> <filename>: Address "{upload.erase_cmd}" must be a number
esptool write_flash: error: argument <address> <filename>: Address "{upload.erase_cmd}" must be a number

Thanks for your reply.

Did it help? Which board did you choose?
The error message you posted clearly shows that the M5Stack people did the core wrongly, the board definitions are missing some important parameters. Write to their support team and ask for a fix.

I have edited the boards.txt file as suggested by adding in the flash erase commands. I'm away this week and will have to test it at the weekend.

I guess that should work although I have no clue what the differences between the many M5 boards are.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.