just a quick fix, my VSCode based platformIO installation of avrdude can’t find its config file, because my windows username has spaces in it. I’m no scripting master, but i’ve placed quotes around stuff in a bat/python script before, i think i can fix it myself. Should probably be fixed by default in the future through (thank you in advance, maxgerhardt
Processing nanoatmega328new (platform: atmelavr; board: nanoatmega328new; framework: arduino)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/nanoatmega328new.html
PLATFORM: Atmel AVR (4.0.1) > Arduino Nano ATmega328 (New Bootloader)
HARDWARE: ATMEGA328P 16MHz, 2KB RAM, 30KB Flash
DEBUG: Current (avr-stub) External (avr-stub, simavr)
PACKAGES:
- framework-arduino-avr @ 5.1.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 5 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Selected fuses: [lfuse = 0xFF, hfuse = 0xDA, efuse = 0xFD]
Setting fuses
avrdude: can't open config file "C:\Users\Thijs": No such file or directory
avrdude: error reading system wide configuration file "C:\Users\Thijs"
*** [bootloader] Error 1
=========================================================================================== [FAILED] Took 1.30 seconds ===========================================================================================
which has needless doubled quotes. One set of quotes was added manually using %s, then i suspect env.Replace is detecting spaces in the string and adding another set of quotation marks. After removing the %s quotation, the fuses script worked! (so the github page you linked to was absolutely right, and i’ll post a reminder there that it’s unsolved once again)
However, the bootloader script has a similar (but more difficult) issue, it tries to run:
avrdude -p atmega328p -C "C:\Users\Thijs van Liempd\.platformio\packages\tool-avrdude\avrdude.conf" -c usbasp "-Uflash:w:"C:\Users\Thijs van Liempd\.platformio\packages\framework-arduino-avr\bootloaders\optiboot/optiboot_atmega328.hex":i" -Ulock:w:0x0F:m
where "-Uflash:w:"C:\Users\Thijs van Liempd\.platformio\packages\framework-arduino-avr\bootloaders\optiboot/optiboot_atmega328.hex":i" comes from the line: BOOTFLAGS=['-Uflash:w:"%s":i' % bootloader_path, "-Ulock:w:%s:m" % lock_bits],
The bootloader_path variable doesn’t have quotes by default, so adding them with %s makes sense, but because the -Uflash:w: portion is concatenated to a single string, the env.Replace (presumably!) adds another set of quotation marks, which screws it up.
Do you think env.Replace() is adding the excessive quotation marks, and is there a quick way to stop it?
it’s been a while but i’d like to close this thing off.
I have identified the problem and devised a fix;
the issue lies in the fact that BOOTFLAGS is a list: