Arduino Nano ESP32 esptool: error: argument --baud/-b: invalid arg_auto_int value: '{upload.speed}'

Hello everyone!

I got the brand new Arduino Nano EPS32 board, and it is lovely!
Long story short, while tinkering around with it I deleted it original boot loader to install the Micropython boot loader, and it works!
But when I try to flash it again with the Arduino boot loader I get this message:

usage: esptool [-h]
               [--chip {auto,esp8266,esp32,esp32s2,esp32s3beta2,esp32s3,esp32c3,esp32c6beta,esp32h2beta1,esp32h2beta2,esp32c2,esp32c6,esp32h2}]
               [--port PORT] [--baud BAUD]
               [--before {default_reset,usb_reset,no_reset,no_reset_no_sync}]
               [--after {hard_reset,soft_reset,no_reset,no_reset_stub}]
               [--no-stub] [--trace] [--override-vddsdio [{1.8V,1.9V,OFF}]]
               [--connect-attempts CONNECT_ATTEMPTS]
               {load_ram,dump_mem,read_mem,write_mem,write_flash,run,image_info,make_image,elf2image,read_mac,chip_id,flash_id,read_flash_status,write_flash_status,read_flash,verify_flash,erase_flash,erase_region,merge_bin,get_security_info,version}
               ...
esptool: error: argument --baud/-b: invalid arg_auto_int value: '{upload.speed}'
Failed chip erase: uploading error: exit status 2

I am unable to find any topic with a similar problem. As for other ESP32 boards (WROOM and Banana PI Leaf S3) I have no problem uploading the boot loader and the Blink sketch.

I am running on LInux Ubuntu 22 LTS, Arduino 2.1.1 IDE and have updated the esp32 core also.
Also tested it on a Windows 10 machine and got the exact same error message.

Any advice would be much appreciated.

Thank you for your time!

Update: Got a fresh new ESP32 Nano. I can upload a sketch but only running arduino ide as sudo.

WARNING: Category '' in library ESP Insights is not valid. Setting to 'Uncategorized'
WARNING: Category '' in library ESP RainMaker is not valid. Setting to 'Uncategorized'
WARNING: Category '' in library WiFiProv is not valid. Setting to 'Uncategorized'
Sketch uses 285785 bytes (9%) of program storage space. Maximum is 3145728 bytes.
Global variables use 30732 bytes (9%) of dynamic memory, leaving 296948 bytes for local variables. Maximum is 327680 bytes.
dfu-util 0.11-arduino4

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2021 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

Opening DFU capable USB device...
Device ID 2341:0070
Device DFU version 0101
Claiming USB DFU Interface...
Setting Alternate Interface #0 ...
Determining device status...
DFU state(2) = dfuIDLE, status(0) = No error condition is present
DFU mode device DFU version 0101
Device returned transfer size 4096
Copying data from PC to DFU device
Download	[=========================] 100%       286144 bytes
Download done.
DFU state(7) = dfuMANIFEST, status(0) = No error condition is present
DFU state(2) = dfuIDLE, status(0) = No error condition is present
Done!

But still can not burn a new boot loader:

usage: esptool [-h]
               [--chip {auto,esp8266,esp32,esp32s2,esp32s3beta2,esp32s3,esp32c3,esp32c6beta,esp32h2beta1,esp32h2beta2,esp32c2,esp32c6,esp32h2}]
               [--port PORT] [--baud BAUD]
               [--before {default_reset,usb_reset,no_reset,no_reset_no_sync}]
               [--after {hard_reset,soft_reset,no_reset,no_reset_stub}]
               [--no-stub] [--trace] [--override-vddsdio [{1.8V,1.9V,OFF}]]
               [--connect-attempts CONNECT_ATTEMPTS]
               {load_ram,dump_mem,read_mem,write_mem,write_flash,run,image_info,make_image,elf2image,read_mac,chip_id,flash_id,read_flash_status,write_flash_status,read_flash,verify_flash,erase_flash,erase_region,merge_bin,get_security_info,version}
               ...
esptool: error: argument --baud/-b: invalid arg_auto_int value: '{upload.speed}'
Error while burning bootloader.

Also now using arduino 1.8.19 on Linux Ubuntu

Hi @motoazdaja. There is a somewhat unintuitive procedure for restoring the Nano ESP32 board to usability with Arduino IDE after flashing it with MicroPython. Instead of using Tools > Burn Bootloader, you should select Sketch > Upload Using Programmer on the first upload of an Arduino sketch. After that, you can go back to using the standard Upload procedure (e.g., Sketch > Upload) for any subsequent sketch uploads.

Unfortunately, even though the Nano ESP32 is otherwise fully supported by Arduino IDE 1.x, the Upload Using Programmer operation for the Nano ESP32 is only supported when using Arduino IDE 2.x.

2 Likes

Hello @ptillisch thank you for your response!

Hi @motoazdaja. There is a somewhat unintuitive procedure for restoring the Nano ESP32 board to usability with Arduino IDE after flashing it with MicroPython. Instead of using Tools > Burn Bootloader , you should select Sketch > Upload Using Programmer on the first upload of an Arduino sketch.

This part of the solution works but there are extra steps:

  • B1 pin needs to be grounded before the power-up of the board.
  • You have to reset in the Tools > Board back to Arduino Nano ESP32 because the IDE sees the board in the DFU regime as a generic ESP32S3 device. After that the sketch is uploaded successfully.
Sketch uses 285785 bytes (9%) of program storage space. Maximum is 3145728 bytes.
Global variables use 30732 bytes (9%) of dynamic memory, leaving 296948 bytes for local variables. Maximum is 327680 bytes.
esptool.py v4.5.1
Serial port /dev/ttyACM3
Connecting...
Chip is ESP32-S3 (revision v0.1)
Features: WiFi, BLE
Crystal is 40MHz
MAC: 34:85:18:7b:7a:d4
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Flash will be erased from 0x00000000 to 0x00003fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00f70000 to 0x00fb5fff...
Flash will be erased from 0x00010000 to 0x00055fff...
Compressed 15088 bytes to 10374...
Writing at 0x00000000... (100 %)
Wrote 15088 bytes (10374 compressed) at 0x00000000 in 0.3 seconds (effective 479.8 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 158...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (158 compressed) at 0x00008000 in 0.0 seconds (effective 540.1 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 47...
Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effective 711.4 kbit/s)...
Hash of data verified.
Compressed 286544 bytes to 164238...
Writing at 0x00f70000... (9 %)
Writing at 0x00f7c345... (18 %)
Writing at 0x00f846ce... (27 %)
Writing at 0x00f89c7f... (36 %)
Writing at 0x00f8f0c1... (45 %)
Writing at 0x00f94428... (54 %)
Writing at 0x00f99a8a... (63 %)
Writing at 0x00fa2f29... (72 %)
Writing at 0x00faa52e... (81 %)
Writing at 0x00fafd85... (90 %)
Writing at 0x00fb5d66... (100 %)
Wrote 286544 bytes (164238 compressed) at 0x00f70000 in 2.0 seconds (effective 1151.4 kbit/s)...
Hash of data verified.
Compressed 286144 bytes to 163909...
Writing at 0x00010000... (9 %)
Writing at 0x0001c365... (18 %)
Writing at 0x00024713... (27 %)
Writing at 0x00029cb4... (36 %)
Writing at 0x0002f10b... (45 %)
Writing at 0x00034453... (54 %)
Writing at 0x00039bd1... (63 %)
Writing at 0x0004310f... (72 %)
Writing at 0x0004a521... (81 %)
Writing at 0x0004fdd6... (90 %)
Writing at 0x00055d70... (100 %)
Wrote 286144 bytes (163909 compressed) at 0x00010000 in 2.2 seconds (effective 1054.0 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin... 
  • After the upload, pres the RESET button, and the program starts running on the ESP32.

After that, you can go back to using the standard Upload procedure (e.g., Sketch > Upload ) for any subsequent sketch uploads.

This part of the solution does not work. The board has a running program on it (Blink example). When I try to use the standard Upload procedure (e.g., Sketch > Upload ) I get this error message:

Sketch uses 285785 bytes (9%) of program storage space. Maximum is 3145728 bytes.
Global variables use 30732 bytes (9%) of dynamic memory, leaving 296948 bytes for local variables. Maximum is 327680 bytes.
dfu-util 0.11-arduino4

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2021 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

dfu-util: Cannot open DFU device 2341:0070 found on devnum 5 (LIBUSB_ERROR_ACCESS)
dfu-util: No DFU capable USB device available
Failed uploading: uploading error: exit status 74

Also tried to double press the RESET button for a reset mode (the error is slightly different):

Sketch uses 285785 bytes (9%) of program storage space. Maximum is 3145728 bytes.
Global variables use 30732 bytes (9%) of dynamic memory, leaving 296948 bytes for local variables. Maximum is 327680 bytes.
dfu-util 0.11-arduino4

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2021 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

dfu-util: Cannot open DFU device 2341:0070 found on devnum 8 (LIBUSB_ERROR_ACCESS)
dfu-util: No DFU capable USB device available
Failed uploading: uploading error: exit status 74

I would like to be able to program this board using the Arduino Editor. (also same error message)

Upload started

Programming with: Serial

Flashing with command:/home/sasa/.arduino-create/arduino/dfu-util/0.11.0-arduino5/dfu-util --device 0x2341:0x0070 -D /tmp/arduino-create-agent1718731041/Blink_copy.bin -Q

dfu-util 0.11-arduino4

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.

Copyright 2010-2021 Tormod Volden and Stefan Schmidt

This program is Free Software and has ABSOLUTELY NO WARRANTY

Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

dfu-util: Cannot open DFU device 2341:0070 found on devnum 8 (LIBUSB_ERROR_ACCESS)

dfu-util: No DFU capable USB device available

Thank you for your help!

I apologize for the incomplete nature of the instructions I provided. I was rushed at the time of my post and failed to provide the level of support I strive for in my efforts here. Thanks for taking the time to share your findings. I'm sure others who have the same question and find this thread during their researches will be very grateful.

In order for Arduino IDE to upload to the Arduino board, your user account must have write permission for that device. Standard user accounts don't have this permission by default. This error can occur when you attempt an upload without the necessary permissions. So it is necessary to configure your system to allow the upload. This is done by creating a special file.

I'll provide instructions you can follow to create that udev rules file:

  1. Open a command line terminal.
  2. Type the following command:
    echo 'SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", MODE:="0666"' | sudo tee /etc/udev/rules.d/60-arduino-esp32.rules && sudo udevadm trigger && sudo udevadm control --reload-rules
    
  3. Press the Enter key.
  4. If prompted for it, enter your Linux account password and press the Enter key.

The command should complete successfully. Now try uploading again. Hopefully the error will no longer occur.

I can only express my sincere gratitude for your effort to resolve the issue.

This was the missing part of the solution. Now the IDE and Web editor work as expected when uploading. No need to manually set the ESP32 into DFU mode with the B1 pin.

For anyone reading this, usually Linux requires additional setting up, and the common problem is with the udev rules.

As far as I am concerned, the problem is solved.

Once again, @ptillisch , thank you so much for your help, much appreciated!

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

Regards,
Per

1 Like

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