platformio / platform-atmelavr

Atmel AVR: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/atmelavr
Apache License 2.0
140 stars 105 forks source link

avrdude.conf No such file or directory #293

Closed Thijxx closed 2 years ago

Thijxx commented 2 years ago

You can erase any parts of this template not applicable to your Issue.


Configuration

Operating system: Linux

PlatformIO Version (platformio --version): 6.1.4

Description of problem

Uploading using Arduino as ISP is broken.

upload_command = avrdude $UPLOAD_FLAGS -U flash:w:$SOURCE:i results in the following error:

avrdude: can't open config file "/home/jenkins/workspace/avrdude/label/Ubuntu12.04x64/objdir/etc/avrdude.conf": No such file or directory
avrdude: error reading system wide configuration file "/home/jenkins/workspace/avrdude/label/Ubuntu12.04x64/objdir/etc/avrdude.conf"

Looked in the docs: https://docs.platformio.org/en/latest/platforms/atmelavr.html#upload-using-programmer Not sure what the format should be but the example provided does not work, avrdude: invalid baud rate specified '-c' when you just copy/paste the config. May be another bug I don't know.

When I fix the baud rate by just putting in the number, I get another error, this time it is: avrdude: error reading system wide configuration file " /home/thijs/.platformio/packages/tool-avrdude/avrdude.conf"

The path is correct, the file is readable, avrdude: can't open config file " /home/thijs/.platformio/packages/tool-avrdude/avrdude.conf": No such file or directory while the file is there and readable to User, Group and Other.

Steps to Reproduce

  1. Try to program ATTiny85 with Arduino as ISP

Actual Results

Error.

Expected Results

Like the Arduino IDE with the same code and setup: upload to programmer, done.

If problems with PlatformIO Build System:

The content of platformio.ini:

[env:myenv]
platform = atmelavr
framework = arduino
board = attiny85
upload_protocol = custom
upload_flags = -P$UPLOAD_PORT -b$UPLOAD_SPEED
upload_port = /dev/ttyACM0
upload_speed = 19200
lib_deps = PowerNap
upload_command = avrdude $UPLOAD_FLAGS -U flash:w:$SOURCE:i```

**Source file to reproduce issue:**
```cpp
Insert here...

Additional info

Thijxx commented 2 years ago

Another bug in this flow that I encountered is that the example misses the board setting. Please specifyboardinplatformio.inito use with 'arduino' framework

ivankravets commented 2 years ago

Please check examples here https://docs.platformio.org/en/latest/platforms/atmelavr.html#upload-using-programmer

Thijxx commented 2 years ago

Please check examples here https://docs.platformio.org/en/latest/platforms/atmelavr.html#upload-using-programmer

You replied with a URL that I mentioned in my ticket as being the source of the problem.

robmaxtech commented 2 years ago

The example in the doc works fine; you should specify the avrdude.conf:

upload_flags =
    -C
    ; use "tool-avrdude-megaavr" for the atmelmegaavr platform
    ${platformio.packages_dir}/tool-avrdude/avrdude.conf

and the programmer

-c
<your programmer>

HTH!

ivankravets commented 2 years ago

@robmaxtech, thanks for the confirmation.

@Thijxx, please reopen this issue if you still have any problems with PIO Core.