PlatformIO Community

ESP32: esptool: error: too few arguments


Hi All,

I’m a software developer and new to Platformio and the ESPEasy project. Because I wanted to build ESPEasy for ESP32 I had the same problem while uploading to the target and after short internet search I’ve found this thread here. :wink:

I have played around e.g. with the Platformio example projects and maybe have found the cause of the esptool issue while uploading the built ESPEasy image:
The platformio.ini seems to be sensitive with commented statements between not-commented. After removing the commented lines with ‘platform’ in the [core_esp32] section the upload works perfectly in my environment. So, only the active line (platform = espressif32@0.12.0) is left in this section.

BTW, the image built from the ESPEasy_mega-20180615 snapshot is showing errors on the console on my ESP32-PICO-KIT. But this is an other issue.

I hope, this helps you too (TD-er). :wink:


Here my platformio.ini:


I have done further investigations and my first suspicion was wrong.
In my platformio.ini (which I have uploaded) I have done a second modification: I have specified a upload_port.

So here’s my current conclusion:

  1. If I take the unmodified platform.ini from the ESPEasy_mega-20180615 source package I get the known esptool error.
  2. If I only remove the comment line with the text " # directly from Platformio, Atom …" (below the commented upload_port line), my upload runs without problems. Maybe this line is responsible for the problem because the comment doesn’t start at the beginning of the line?


@Uewel , You officially made my day!

I used your version and removed the upload statement (I use COM9, not COM7 and detection wasn’t really an issue) and it now works.

Linking .pioenvs\esp32dev\firmware.elf

Retrieving maximum program size .pioenvs\esp32dev\firmware.elf
Building .pioenvs\esp32dev\firmware.bin
Checking size .pioenvs\esp32dev\firmware.elf
Memory Usage ->
DATA:    [==        ]  18.9% (used 55876 bytes from 294912 bytes)
PROGRAM: [========= ]  85.4% (used 1119206 bytes from 1310720 bytes) v2.3.1
Configuring upload protocol...
AVAILABLE: esptool, minimodule, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h
CURRENT: upload_protocol = esptool
Looking for upload port...
Auto-detected: COM9
Uploading .pioenvs\esp32dev\firmware.bin v2.3.1
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 12496 bytes to 8282...
Wrote 12496 bytes (8282 compressed) at 0x00001000 in 0.2 seconds (effective 502.4 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 144...
Wrote 3072 bytes (144 compressed) at 0x00008000 in 0.0 seconds (effective 1536.0 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 47...
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.0 seconds (effective 4096.0 kbit/s)...
Hash of data verified.
Compressed 1120448 bytes to 647442...
Wrote 1120448 bytes (647442 compressed) at 0x00010000 in 15.7 seconds (effective 569.3 kbit/s)...
Hash of data verified.
Hard resetting via RTS pin...
 [SUCCESS] Took 158.51 seconds

So it looks like there is a bug in the parser (Python code?) about what’s in comments.

Probably another issue, but I got some linker issues about loop() and setup() when using @0.12.0. They were gone with @1.0.2.


I’m glad to hear that your problem is also solved!
The problematic line is indeed #139 with the intended comment.

May I finally ask you, which source version you are using? I still have problems to boot ESPEasy_mega-20180615 on a PICO board.
If I use platform=espressif32@1.0.2 my build ends with error:
D:/ESP32dev/ESPEasy_mega/Source/src/ESPEasy.ino: In function ‘void setup()’:
D:/ESP32dev/ESPEasy_mega/Source/src/ESPEasy.ino:116:17: error: ‘WiFiEventFullCb’ was not declared in this scope

I cannot find any declaration of WiFiEventFullCb.


I will push a commit in a few minutes that allows ESPeasy to work again on ESP32 :slight_smile:


Super! Thanks in advance. :+1:

Best Regards,


If you’re really eager to test, I just merged it.


I can confirm, that your commit ( 08b2259) is now buildable out-of-the-box. Perfect!

But I still have the problem, that my PICO-board cannot properly boot. But since this is off topic we can discuss this in ESPEasy.