M5STACK Paper "{upload.erase_cmd}" must be a number

I am having problems with the IDE 2.0 uploading to a M5STACK Paper. I researched this error and found two fixes. The first fix said tu download the Nightly Build so I did. The seconds fix said to add to the boards.text.

The error is:

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

I made the following change to the boards.txt

##############################################################

m5stack-paper.name=M5Stack-Paper

BOARD_DEFINITON.menu.EraseFlash.none=Disabled
BOARD_DEFINITON.menu.EraseFlash.none.upload.erase_cmd=
BOARD_DEFINITON.menu.EraseFlash.all=Enabled
BOARD_DEFINITON.menu.EraseFlash.all.upload.erase_cmd=-e

m5stack-paper.upload.tool.serial=esptool_py

Any help is appreciated.

Kurt

I'm not familiar with your board. The error is clear, -e is not a number :wink:

Did you make a typing mistake? Maybe you're following instruction for a different board package?

Thanks for the quick reply. I get this same error without any modifications to the boards.txt file so in that case I didn't type anything.

I am also getting this same error on the Windows version of the IDE.

Hi @ispybadguys

Please post a link to where you found that.

I could be certain if I saw the original information, but BOARD_DEFINITON was likely intended to be a "placeholder" to be replaced by the board ID. In this context, it appears the board ID is m5stack-paper

So the correct boards.txt content would look like this:

##############################################################

m5stack-paper.name=M5Stack-Paper

m5stack-paper.menu.EraseFlash.none=Disabled
m5stack-paper.menu.EraseFlash.none.upload.erase_cmd=
m5stack-paper.menu.EraseFlash.all=Enabled
m5stack-paper.menu.EraseFlash.all.upload.erase_cmd=-e

m5stack-paper.upload.tool.serial=esptool_py

Thanks. I think I am almost there. I made the changes you suggested and a couple more. I am now down to the error "Error while uploading: missing 'upload.tool' configuration parameter" This is what the boards.txt has now:


##############################################################

m5stack-paper.name=M5Stack-Paper

m5stack-paper.menu.EraseFlash.none=Disabled
m5stack-paper.menu.EraseFlash.none.upload.erase_cmd=
m5stack-paper.menu.EraseFlash.all=Enabled
m5stack-paper.menu.EraseFlash.all.upload.erase_cmd=-e

m5stack-paper.upload.tool=esptool_py
m5stack-paper.upload.tool.default=esptool_py
m5stack-paper.upload.tool.network=esp_ota
m5stack-paper.upload.maximum_size=6553600
m5stack-paper.upload.maximum_data_size=4521984
m5stack-paper.upload.wait_for_upload_port=true
m5stack-paper.upload.flags=
m5stack-paper.upload.extra_flags=

m5stack-paper.serial.disableDTR=true
m5stack-paper.serial.disableRTS=true

m5stack-paper.build.tarch=xtensa
m5stack-paper.build.bootloader_addr=0x1000
m5stack-paper.build.target=esp32
m5stack-paper.build.mcu=esp32
m5stack-paper.build.core=esp32
m5stack-paper.build.variant=m5stack_paper
m5stack-paper.build.board=M5Stack_Paper

m5stack-paper.build.f_cpu=240000000L
m5stack-paper.build.flash_size=16MB
m5stack-paper.build.flash_freq=80m
m5stack-paper.build.flash_mode=dio
m5stack-paper.build.boot=dio
m5stack-paper.build.partitions=default_16MB
m5stack-paper.build.defines=

m5stack-paper.menu.PSRAM.enabled=Enabled
m5stack-paper.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue -mfix-esp32-psram-cache-strategy=memw
m5stack-paper.menu.PSRAM.enabled.build.extra_libs=
m5stack-paper.menu.PSRAM.disabled=Disabled
m5stack-paper.menu.PSRAM.disabled.build.defines=
m5stack-paper.menu.PSRAM.disabled.build.extra_libs=

m5stack-paper.menu.PartitionScheme.default=Default (2 x 6.5 MB app, 3.6 MB SPIFFS)
m5stack-paper.menu.PartitionScheme.default.build.partitions=default_16MB
m5stack-paper.menu.PartitionScheme.default.upload.maximum_size=6553600
m5stack-paper.menu.PartitionScheme.large_spiffs=Large SPIFFS (7 MB)
m5stack-paper.menu.PartitionScheme.large_spiffs.build.partitions=large_spiffs_16MB
m5stack-paper.menu.PartitionScheme.large_spiffs.upload.maximum_size=4685824

m5stack-paper.menu.PartitionScheme.minimal=Minimal (1.3MB APP/700KB SPIFFS)
m5stack-paper.menu.PartitionScheme.minimal.build.partitions=minimal
m5stack-paper.menu.PartitionScheme.no_ota=No OTA (2MB APP/2MB SPIFFS)
m5stack-paper.menu.PartitionScheme.no_ota.build.partitions=no_ota
m5stack-paper.menu.PartitionScheme.no_ota.upload.maximum_size=2097152
m5stack-paper.menu.PartitionScheme.noota_3g=No OTA (1MB APP/3MB SPIFFS)
m5stack-paper.menu.PartitionScheme.noota_3g.build.partitions=noota_3g
m5stack-paper.menu.PartitionScheme.noota_3g.upload.maximum_size=1048576
m5stack-paper.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA/1MB SPIFFS)
m5stack-paper.menu.PartitionScheme.huge_app.build.partitions=huge_app
m5stack-paper.menu.PartitionScheme.huge_app.upload.maximum_size=3145728
m5stack-paper.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS)
m5stack-paper.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs
m5stack-paper.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080

m5stack-paper.menu.CPUFreq.240=240MHz (WiFi/BT)
m5stack-paper.menu.CPUFreq.240.build.f_cpu=240000000L
m5stack-paper.menu.CPUFreq.160=160MHz (WiFi/BT)
m5stack-paper.menu.CPUFreq.160.build.f_cpu=160000000L
m5stack-paper.menu.CPUFreq.80=80MHz (WiFi/BT)
m5stack-paper.menu.CPUFreq.80.build.f_cpu=80000000L
m5stack-paper.menu.CPUFreq.40=40MHz (40MHz XTAL)
m5stack-paper.menu.CPUFreq.40.build.f_cpu=40000000L
m5stack-paper.menu.CPUFreq.26=26MHz (26MHz XTAL)
m5stack-paper.menu.CPUFreq.26.build.f_cpu=26000000L
m5stack-paper.menu.CPUFreq.20=20MHz (40MHz XTAL)
m5stack-paper.menu.CPUFreq.20.build.f_cpu=20000000L
m5stack-paper.menu.CPUFreq.13=13MHz (26MHz XTAL)
m5stack-paper.menu.CPUFreq.13.build.f_cpu=13000000L
m5stack-paper.menu.CPUFreq.10=10MHz (40MHz XTAL)
m5stack-paper.menu.CPUFreq.10.build.f_cpu=10000000L

m5stack-paper.menu.UploadSpeed.921600=921600
m5stack-paper.menu.UploadSpeed.921600.upload.speed=921600
m5stack-paper.menu.UploadSpeed.115200=115200
m5stack-paper.menu.UploadSpeed.115200.upload.speed=115200
m5stack-paper.menu.UploadSpeed.256000.windows=256000
m5stack-paper.menu.UploadSpeed.256000.upload.speed=256000
m5stack-paper.menu.UploadSpeed.230400.windows.upload.speed=256000
m5stack-paper.menu.UploadSpeed.230400=230400
m5stack-paper.menu.UploadSpeed.230400.upload.speed=230400
m5stack-paper.menu.UploadSpeed.460800.linux=460800
m5stack-paper.menu.UploadSpeed.460800.macosx=460800
m5stack-paper.menu.UploadSpeed.460800.upload.speed=460800
m5stack-paper.menu.UploadSpeed.512000.windows=512000
m5stack-paper.menu.UploadSpeed.512000.upload.speed=512000
m5stack-paper.menu.UploadSpeed.1500000=1500000
m5stack-paper.menu.UploadSpeed.1500000.upload.speed=1500000

m5stack-paper.menu.DebugLevel.none=None
m5stack-paper.menu.DebugLevel.none.build.code_debug=0
m5stack-paper.menu.DebugLevel.error=Error
m5stack-paper.menu.DebugLevel.error.build.code_debug=1
m5stack-paper.menu.DebugLevel.warn=Warn
m5stack-paper.menu.DebugLevel.warn.build.code_debug=2
m5stack-paper.menu.DebugLevel.info=Info
m5stack-paper.menu.DebugLevel.info.build.code_debug=3
m5stack-paper.menu.DebugLevel.debug=Debug
m5stack-paper.menu.DebugLevel.debug.build.code_debug=4
m5stack-paper.menu.DebugLevel.verbose=Verbose
m5stack-paper.menu.DebugLevel.verbose.build.code_debug=5

I was not able to reproduce the error. It looks to me that you have correctly made the fix for the bug M5Stack have in their boards definitions.

Try restarting the Arduino IDE. After that, try uploading again and let me know if the error still occurs. The IDE only recognizes changes you made to boards.txt after a restart, so if the Arduino IDE was running while you made the fix, it is expected that the error message would persist.

I want to say thanks for the help on this. I really appreciate it. I posted on the M5Stack forum and no one could answer this. Your solution worked fine I just forgot to restart the IDE.

Kurt

You are welcome. I'm glad it is working now.

Hopefully the M5Stack developers will fix the bug soon. Unfortunately it seems they don't host this boards platform in a public repository. If it was available I would simply submit a fix.

Regards,
Per

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