Can the Arduino ISP board be used with PlatformIO?


#1

Greetings all!
I was wondering if there was support for the Arduino ISP board with PlatformIO? I’ve tried different options that are listed with the documentation, but all seem to either require a serial port to push the code onto the device. The ISP does not provide a serial device. Please let me know if I’m missing something. Thanks in advance!

–Chris


#2

Hi @cslamar
Have you read Upload using Programmer in our docs?


#3

I have indeed looked at the examples show in the documentation, and tried each with a combination of options. I can use an Arduino as a programmer, but since the ISP doesn’t generate a serial port to connect to, I’m at a loss what options to use. Any thoughts would be gratefully accepted!

Thanks


Arduino 328p Chip
#4

Use “Upload using Programmer” or pio run -t program with this conf

[env:myenv]
platform = atmelavr
framework = arduino
board = ***
upload_protocol = usbtiny

#5

Greetings,

I tried your suggested configuration and here’s the output I received:

Using Port : usb Using Programmer : usbtiny avrdude: Error: Could not find USBtiny device (0x1781/0xc9f)
Here’s the platformio.ini entry
[env:megaatmega2560] platform = atmelavr framework = arduino board = megaatmega2560 upload_protocol = usbtiny lib_install = 1, 54

As always, any input would be great!

Thanks


#6

Sorry, looks like this information is missed in our docs. I’ve just fixed it. Please use this conf

[env:megaatmega2560]
platform = atmelavr
framework = arduino
board = megaatmega2560
upload_protocol = arduinoisp
lib_install = 1, 54

#7

That did it!! Thank you very much!!!


#8

Great! Do you use PlatformIO IDE or CLI?


#9

I usually use the IDE


#10

Happy Coding with PlatformIO! :blush:


#11

Where should I enter with this conf parameters? I’m trying to upload my code to an Arduino loaded with the ArduinoISP code and one ISP shield.


#12

In platformio.ini set the following line inside desired environment block, and change board to whatever matches your platform:

upload_protocol = arduinoisp

Hope this helps. It worked well for me!


#13

I will test it and give you a feedback later. Thanks!


#14

I use the following configuration in my platformio.ini and it works:
[env:unoAsIsp]
platform = atmelavr
framework = arduino
board = uno
upload_protocol = arduinoisp
upload_flags = -P$UPLOAD_PORT -b$UPLOAD_SPEED

upload_port = COM4
upload_speed = 19200

Thank you.


#15

You should only need:

[env:unoAsIsp] platform = atmelavr framework = arduino board = uno upload_protocol = arduinoisp

That’s all I needed at least. Hope it helps.


#16

Thank you for a good start for setting it up.
It is not working for me yet.
Any idea with what i do with this?

Looking for upload port...
Auto-detected: COM17
Uploading .pioenvs\unoAsIsp\firmware.hex
avrdude: Error: Invalid -P value: 'COM17'
Use -P usb:bus:device

Witch I understand is that Auto-detected is wrongly formated for the -P.

I see that @Fernando_Fontana used this:
upload_flags = -P$UPLOAD_PORT -b$UPLOAD_SPEED
upload_port = COM4
upload_speed = 19200

But there is no so to say “:device” there. How is that formated?
Thx for your help


#17

Could open Arduino IDE settings and enable a verbose log for build/upload? After that, please program board with Arduino IDE and copy here the full output from console.


#18

When I use

[env:nano328]
platform = atmelavr
board = nanoatmega328
framework = arduino
upload_protocol = arduinoisp

It bitches about not specifying a com port. The problem is my USBtiny is a device.


#19

Dunce cap award today. I needed ty use usbtiny for the protocol.


#20

http://docs.platformio.org/en/latest/platforms/atmelavr.html#upload-using-programmer