🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

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

    Arduino
    7
    15
    17.7k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • I
      ispybadguys
      last edited by

      Your are correct. I have a Mac running Monterey 12.3.1. python --version returns 2.7.14. Xcode is 13.4.1

      teastainT 1 Reply Last reply Reply Quote 0
      • teastainT
        teastain @ispybadguys
        last edited by

        Hi, I'm on an M1 iMac, Monterey.
        Goto Pthyon.org and follow the easy instructions and install Python3.x.x, painlessly.
        hope this helps

        Cheers, Terry!

        100% M5Stack addict with several drawers full of product!

        1 Reply Last reply Reply Quote 0
        • I
          ispybadguys
          last edited by

          Thanks. I did this and also dug out an old windows laptop running Arduino 1.8.19. I downloaded the M5Stack boards file using https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/arduino/package_m5stack_index.json and then installed the M5STACK libraries and the M5EPD library from GitHub. This setup gives the very same error.

          1 Reply Last reply Reply Quote 1
          • ajb2k3A
            ajb2k3
            last edited by

            Have you set the environment variable to point to python 3?

            Also the new OS X is a pain!

            UIFlow, so easy an adult can learn it!
            If I don't know it, be patient!
            I've ether not learned it or am too drunk to remember it!
            Author of the WIP UIFlow Handbook!
            M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

            1 Reply Last reply Reply Quote 0
            • I
              ispybadguys
              last edited by

              I would not know where to set that is but since the same error occurs in the Windows version of the IDE I am thinking that it isn't a problem with the MAC. Also this only fails with the Paper device if I select the Core 2 I can program the Paper just fine however the external I2C doesn't work so IDK if this is because I said the Paper was a Core 2 or not.

              1 Reply Last reply Reply Quote 0
              • M5_TinkerM
                M5_Tinker @ispybadguys
                last edited by

                same error.
                Brand new user (just received my M5StickC 7 hours ago)
                My development environment is freshly minted (3 hours ago) on a USB drive plugged into a Raspberry Pi4B.
                New OS. New install of Arduino IDE 1.8.19.
                Add platform "M5Stack Arduino" and Library "M5StackCPlus" by following these instructions.

                the sketch is very basic
                '''
                void setup() { }

                void loop() { }
                '''

                the error is:
                usage: esptool write_flash [-h] [--erase-all]
                [--flash_freq {keep,40m,26m,20m,80m}]
                [--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

                Please assist with getting my shiny new device to work.

                M5_TinkerM 1 Reply Last reply Reply Quote 1
                • M5_TinkerM
                  M5_Tinker @M5_Tinker
                  last edited by

                  the file does actually show the "-e". What should it be?
                  ~/.arduino15/packages/m5stack/hardware/esp32/2.0.5/boards.txt

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

                  M5_TinkerM 1 Reply Last reply Reply Quote 0
                  • M5_TinkerM
                    M5_Tinker @M5_Tinker
                    last edited by

                    Dear M5: please repair the board information for the M5Stick-C-plus. See errors above.

                    other users: switching to the M5Stick-C (no "-plus") platform allowed me to upload new sketches to the device.
                    0_1665178518532_3412d667-e1c3-43ad-88dd-97a04a107d2d-image.png

                    teastainT 1 Reply Last reply Reply Quote 1
                    • teastainT
                      teastain @M5_Tinker
                      last edited by

                      Me too. Thanks for sharing or I would go insane.
                      I have seen this in other M5Stack Products
                      There is a user felmue that helps keep things straight, maybe he can help?

                      Cheers, Terry!

                      100% M5Stack addict with several drawers full of product!

                      1 Reply Last reply Reply Quote 0
                      • V
                        veryalien
                        last edited by veryalien

                        This problem seems to be caused by the esp32 2.0.5 update.

                        I don't think M5Stack are to blame, this was not a mandatory setting before.

                        After this update was installed I had the same problem with some of my M5Stack boards, but not all of them. A menu setting for erasing flash before upload or not must now be set. It seems that this menu setting must be sent to esptool, if this is not provided then esptool fails with the Address "{upload.erase_cmd}" must be a number error
                        There is a simple fix, if you can find your hidden arduino boards.txt file.
                        The path to the file will be different on Windows, Linux and OSX.
                        You need to add the following to boards.txt for ALL types of M5Stack/M5Stamp boards and then uploads should work again:

                        <board_name>.menu.EraseFlash.none=Disabled
                        <board_name>.menu.EraseFlash.none.upload.erase_cmd=
                        <board_name>.menu.EraseFlash.all=Enabled
                        <board_name>.menu.EraseFlash.all.upload.erase_cmd=-e

                        Replace <board_name> with the correct name for each type of board in the complete list. You can see what the name should be in the section for each M5Stack board.

                        After editing and saving boards.txt in the correct place, you need to restart the arduino IDE. You will then see in the Tools menu Erase All Flash Before Sketch Upload: Disabled/Enabled. This is the missing required setting for esptool.

                        Make a copy of your boards.txt before you make any edits so you can recover from any incorrect changes.

                        Good Luck!

                        M 1 Reply Last reply Reply Quote 2
                        • M
                          makingwaves @veryalien
                          last edited by

                          Hi @veryalien,

                          For the record, I was getting this error with the M5StickC PLUS and your suggested edits to boards.txt fixed the problem. Thanks! Note that for whatever reason, I was not getting this error with an M5Atom.

                          Do you know how/when M5Stack does new releases that incorporates bug fixes such as these? Do we need to somehow notify them or do they regularly read the community forum? I'm aware of at least one library bug that someone has found a fix for in the forum. In that case, the user did a pull request on GitHub and the fix was pulled into the repository, but a new version of the library has not been released.

                          1 Reply Last reply Reply Quote 0
                          • S
                            SarahC
                            last edited by

                            Thank you!

                            I was getting this on my M5StickC-Plus, on the 10th/Oct/2022, with all the latest board/library updates.

                            I hope everyone else can find this thread!

                            For me the file I had to add those lines to was:

                            C:\Users[login name]\AppData\Local\Arduino15\packages\m5stack\hardware\esp32\2.0.5\boards.txt

                            1 Reply Last reply Reply Quote 0
                            • ajb2k3A
                              ajb2k3
                              last edited by

                              The esp32 bord defs in Arduino are controlled by espressif and it looks like they broke a few things.

                              UIFlow, so easy an adult can learn it!
                              If I don't know it, be patient!
                              I've ether not learned it or am too drunk to remember it!
                              Author of the WIP UIFlow Handbook!
                              M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

                              1 Reply Last reply Reply Quote 0
                              • First post
                                Last post