Hello everyone!
I am fairly new to PlatformIO / embedded development but not new to C++ or software development. I am trying to setup a project in such a way that I can have two main files in the /src directory and have each of the main files be uploaded to a separate Arduino Nano ESP32. The project structure I am looking for is below.
[env:arduino_nano_esp32]
platform = espressif32
board = arduino_nano_esp32
framework = arduino
build_src_filter = +<*>
[env:Sender]
platform = espressif32
board = arduino_nano_esp32
framework = arduino
build_src_filter = +<Sender.cpp>
upload_protocol = dfu
upload_port = /dev/cu.usbmodem3485187ABD482
monitor_port = /dev/cu.usbmodem3485187ABD482
upload_flags =
--serial
[env:Receiver]
platform = espressif32
board = arduino_nano_esp32
framework = arduino
build_src_filter = +<Receiver.cpp>
upload_protocol = dfu
upload_port = /dev/cu.usbmodem3485187AA41C2
monitor_port = /dev/cu.usbmodem3485187AA41C2
upload_flags =
--serial
With this platformio.ini file I get this error.
Processing Sender (platform: espressif32; board: arduino_nano_esp32; framework: arduino)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/arduino_nano_esp32.html
PLATFORM: Espressif 32 (6.6.0) > Arduino Nano ESP32
HARDWARE: ESP32S3 240MHz, 320KB RAM, 16MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, dfu, esp-bridge, esp-builtin, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
- framework-arduinoespressif32 @ 3.20014.231204 (2.0.14)
- tool-dfuutil-arduino @ 1.11.0
- tool-esptoolpy @ 1.40501.0 (4.5.1)
- tool-mkfatfs @ 2.0.1
- tool-mklittlefs @ 1.203.210628 (2.3)
- tool-mkspiffs @ 2.230.0 (2.30)
- tool-openocd-esp32 @ 2.1100.20220706 (11.0)
- toolchain-riscv32-esp @ 8.4.0+2021r2-patch5
- toolchain-xtensa-esp32s3 @ 8.4.0+2021r2-patch5
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 33 compatible libraries
Scanning dependencies...
Dependency Graph
|-- WiFi @ 2.0.0
Building in release mode
Retrieving maximum program size .pio/build/Sender/firmware.elf
Checking size .pio/build/Sender/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [== ] 16.9% (used 55272 bytes from 327680 bytes)
Flash: [== ] 22.3% (used 700561 bytes from 3145728 bytes)
Configuring upload protocol...
AVAILABLE: cmsis-dap, dfu, 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 = dfu
Uploading .pio/build/Sender/firmware.bin
Error: Unexpected argument: 0x2341:0x0070
My current theory is the conflicting --serial flag and dfu upload protocol but when I remove the --serial flag I get dfu-util: More than one DFU capable USB device found!
. I thought setting upload_port on the two environments was enough…what am I missing?
Thank you in advance!
Winston