I am migrating from Windows 10 to Ubuntu (I did a test migration on two laptops with no problems).
I can program UPDI devices (eg ATtiny1604) with the pymcuprog script and modified serial card (proves I successfully installed PlatformIO as Visual Studio extension, and successfully loaded the python script as a local instance).
I can program an Aurduino Nano with no problems but I get an avrdude syntax error when I try to program an ATtiny85 either using Arduino as ISP or a USBASP programmer (yes, I’ve installed 99-platformio-udev.rules file to support this programmer).
I’ve checked that the avrdude.conf file is where it expects it to be.
Please can you suggest what I may check / change.
Here’s all the details…
Source
#include <Arduino.h>
// put function declarations here:
int myFunction(int, int);
void setup() {
// put your setup code here, to run once:
int result = myFunction(2, 3);
}
void loop() {
// put your main code here, to run repeatedly:
}
// put function definitions here:
int myFunction(int x, int y) {
return x + y;
}
My platformio.ini
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[env:attiny85]
platform = atmelavr
board = attiny85
framework = arduino
; uploader tool selection - use one block but comment out the other
; device is USBASP V2.0 with updated firmware
; upload_protocol = custom
; upload_port = usb
; upload_flags =
; -C
; ; use "tool-avrdude-megaavr" for the atmelmegaavr platform
; ${platformio.packages_dir}/tool-avrdude/avrdude.conf
; -p
; $BOARD_MCU
; -P
; $UPLOAD_PORT
; -c
; usbasp
; upload_command = avrdude $UPLOAD_FLAGS -U flash:w:$SOURCE:i
; device is Arduino as ISP
upload_protocol = custom
upload_port = /dev/ttyACM0
upload_speed = 19200
; monitor_port = /dev/ttyACM0
; monitor_speed = 57600
upload_flags =
-C
; use "tool-avrdude-megaavr" for the atmelmegaavr platform
${platformio.packages_dir}/tool-avrdude/avrdude.conf
-p
$BOARD_MCU
-P
$UPLOAD_PORT
-b
$UPLOAD_SPEED
-c
stk500v1
upload_command = avrdude $UPLOAD_FLAGS -U flash:w:$SOURCE:i
The error message…
Executing task in folder ATtiny85BareMinimum: platformio run --target upload
Processing attiny85 (platform: atmelavr; board: attiny85; framework: arduino)
-------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/attiny85.html
PLATFORM: Atmel AVR (5.1.0) > Generic ATtiny85
HARDWARE: ATTINY85 8MHz, 512B RAM, 8KB Flash
DEBUG: Current (simavr) External (simavr)
PACKAGES:
- framework-arduino-avr-attiny @ 1.5.2
- tool-avrdude @ 1.60300.200527 (6.3.0)
- toolchain-atmelavr @ 1.70300.191015 (7.3.0)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 9 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Checking size .pio/build/attiny85/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [ ] 1.8% (used 9 bytes from 512 bytes)
Flash: [ ] 3.0% (used 248 bytes from 8192 bytes)
Configuring upload protocol...
AVAILABLE: custom
CURRENT: upload_protocol = custom
Uploading .pio/build/attiny85/firmware.hex
avrdude: error at /home/peter/.platformio/packages/tool-avrdude/avrdude.conf:402: syntax error
avrdude: error reading system wide configuration file "/home/peter/.platformio/packages/tool-avrdude/avrdude.conf"
*** [upload] Error 1
A look at the config file location…
peter@XPS-8700:~$ cd /home/peter/.platformio/packages/tool-avrdude/
peter@XPS-8700:~/.platformio/packages/tool-avrdude$ ls
avrdude avrdude.conf package.json
peter@XPS-8700:~/.platformio/packages/tool-avrdude$
If I rename the file, I get the following error message (I was hoping the file would be re-created in case it was some how mal-formed)…
avrdude: can't open config file "/home/peter/.platformio/packages/tool-avrdude/avrdude.conf": No such file or directory
avrdude: error reading system wide configuration file "/home/peter/.platformio/packages/tool-avrdude/avrdude.conf"
*** [upload] Error 1
Could it be a privileges thing - how to check?
The avrdue.conf file is too large to paste into this topic but I could copy out a section if directed.
Looking in the config file at line 402, I can see…
# Overall avrdude defaults; suitable for ~/.config/avrdude/avrdude.rc
#
default_parallel = "/dev/parport0";
default_serial = "/dev/ttyS0";
default_spi = "";
# default_bitclock = 2.5;
Line 402 is the default_spi
setting. What should this be?
Thanks