Problems Uploading Sketch to Arduino Uno

Hello PIO :slight_smile:

I added a serial port bluetooth module (HC-05) to an Arduino Uno.

When used in conjunction with PIO’s serial monitor, the device works great. I thought it would be cool to use it for uploading sketches as well so I configured it to do so (I wired the HC-05’s state pin (pin 32) to the Arduino’s reset pin. I’m able to upload sketches flawlessly using the Arduino Ide, but I get a consistent error in PIO when I issue the command:

platformio run --upload-port COM5 --verbose --target upload

(COM5 is the correct port, the HC-05’s baud rate is set to the default 115200).

I’m able to upload using the Arduino Ide, but I’d much rather use PIO. Does anyone have any suggestions? The reported error follows. Thanks.

avr-g++ -o .pioenvs\uno\firmware.elf -Os -mmcu=atmega328p -Wl,--gc-sections -flto -fuse-linker-plugin .pioenvs\uno\src\xbee_serial_test_1.ino.o -L.pioenvs\uno -Wl,--start-group .pioenvs\uno\lib
FrameworkArduinoVariant.a .pioenvs\uno\libFrameworkArduino.a -lm .pioenvs\uno\lib\libsimple-zigbee.a .pioenvs\uno\lib\libSoftwareSerial.a .pioenvs\uno\lib\libLiquidCrystal.a -Wl,--end-group
Checking program size
text       data     bss     dec     hex filename
10912       592     412   11916    2e8c .pioenvs\uno\firmware.elf
avr-objcopy -O ihex -R .eeprom .pioenvs\uno\firmware.elf .pioenvs\uno\firmware.hex
BeforeUpload(["upload"], [".pioenvs\uno\firmware.hex"])
Use manually specified: COM5
avrdude -v -p atmega328p -C C:\Users\Rob\.platformio\packages\tool-avrdude\avrdude.conf -c arduino -b 115200 -P "COM5" -D -U flash:w:.pioenvs\uno\firmware.hex:i

avrdude: Version 6.3, compiled on Sep 12 2016 at 17:24:16
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

System wide configuration file is "C:\Users\Rob\.platformio\packages\tool-avrdude\avrdude.conf"

Using Port                    : COM5
Using Programmer              : arduino
Overriding Baud Rate          : 115200
avrdude: ser_open(): can't open device "\\.\COM5": Element not found.


avrdude done.  Thank you.

*** [upload] Error 1