PlatformIO Community

How to upload with FT231XS

Greetings!

I am running PlatformIO on Linux Mint 20. Trying to upload code to a SparkFun Arduino Pro Mini 328 using SparkFun FT231X programmer. Following the FTDI chip page I set the upload_protocol in the platformio.ini like so:

[env:sparkfun_promicro8]
platform = atmelavr
board = sparkfun_promicro8
framework = arduino
upload_protocol = ftdi

But when trying to upload I get:

Configuring upload protocol...
AVAILABLE: ftdi
CURRENT: upload_protocol = ftdi
Looking for upload port...
Auto-detected: /dev/ttyUSB0
Forcing reset using 1200bps open/close on port /dev/ttyUSB0
Waiting for the new upload port...
Uploading .pio/build/sparkfun_promicro8/firmware.hex

avrdude: Can't find programmer id "ftdi"

Valid programmers are:

and a whole list of programmers. I switched to avrftdi, but things didn’t get much better:

Configuring upload protocol...
AVAILABLE: avrftdi
CURRENT: upload_protocol = avrftdi
Looking for upload port...
Auto-detected: /dev/ttyUSB0
Forcing reset using 1200bps open/close on port /dev/ttyUSB0
Waiting for the new upload port...
Uploading .pio/build/sparkfun_promicro8/firmware.hex
avrdude: Error: no libftdi or libusb support. Install libftdi1/libusb-1.0 or libftdi/libusb and run configure/make again.

avrdude done.  Thank you.

*** [upload] Error 1

How do I make the upload work?

Please note:

  • Uploading works fine from the Arduino IDE. No change in setup.
  • PlatformIO serial monitor works. Both ways - input and output. The FT231XS is known and working.

Cheers!
tjk :slight_smile:

I’ve been looking at this for several days, but only now got an idea to move forward. I picked the avrdude invocations and compared them. Here are the differences.

Arduino IDE:

-p atmega328p -c arduino

PlatformIO:

-p atmega32u4 -c avrftdi

Turns out I’ve selected “SparkFun Pro Micro” board, which is wrong. :man_facepalming: It is based on the ATmega32U4. Selecting the correct one - Arduino Pro Mini ATmega328P - makes the upload work like a charm.

tjk :expressionless: