Error encountered with pio remote run

I am seeing a couple different errors using pio remote run. My current setup:

  • VM that holds my platform.io project for esp32-c6 dev kit
  • Local on my mac, I have the hardware plugged in and am running pio remote agent start

My platform ini:

[env]
build_flags =
    -std=c++17
    -fexceptions

[env:c3]
platform = espressif32
board = esp32-c3-devkitm-1
framework = espidf

I’m basically just building a hello world that grabs some details about the board and writes to console. Have flashed this previously via pio remote run -t upload -r -e c6 -v (notice the -r) but I’ve ran into other issues here that I’m avoiding by building locally (to the VM that is) and then flashing the output to the device via pio remote run -t upload -e c6 -v . Everything builds fine, but when it goes to upload, I see the following error:

......
Successfully created esp32c6 image.
================================================================================================== [SUCCESS] Took 227.77 seconds ==================================================================================================
Uploading firmware remotely
Processing c6 (platform: espressif32; board: esp32-c6-devkitc-1; framework: espidf; build_flags: -std=c++17, -fexceptions)
--------------------------------------------------------------------------------
<lambda>(["upload"], [".pio/build/c6/firmware.bin"])
AVAILABLE: cmsis-dap, esp-bridge, esp-builtin, esp-prog, espota, esptool, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa
CURRENT: upload_protocol = esptool
BeforeUpload(["upload"], [".pio/build/c6/firmware.bin"])
Auto-detected: /dev/cu.usbmodem57280257101
"/opt/homebrew/Cellar/platformio/6.1.15/libexec/bin/python" "/Users/jschneekloth/.platformio/packages/tool-esptoolpy/esptool.py" --chip esp32c6 --port "/dev/cu.usbmodem57280257101" --baud 460800 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size detect .pio/build/c6/firmware.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 {detect,keep,256KB,512KB,1MB,2MB,2MB-c1,4MB,4MB-c1,8MB,16MB,32MB,64MB,128MB}]
                           [--spi-connection SPI_CONNECTION] [--no-progress]
                           [--verify] [--encrypt]
                           [--encrypt-files <address> <filename> [<address> <filename> ...]]
                           [--ignore-flash-encryption-efuse-setting] [--force]
                           [--compress | --no-compress]
                           <address> <filename> [<address> <filename> ...]
esptool write_flash: error: argument <address> <filename>: Address ".pio/build/c6/firmware.bin" must be a number
*** [upload] Error 2

It looks like the command to flash isn’t specified correctly and I’m missing an address, but not sure where I should specify that (or why I need to). Any thoughts on what I can do here?

When I try --force-remote, 90% of the time I’ll see an error Agent has been terminated with a BananaError output from the agent with string too long. I prefer not using --force-remote anyway so I’m trying to get this working without.

If the flashing command doesn’t include the proper address for the firmware, it’s a bug. Please file one in https://github.com/platformio/platform-espressif32/issues/ if not already present.