Yeah, I tried it out also but on a pro8MHzatmega328 and it seemed like it would work fine, but I didn’t have the programmer hooked up so it then failed to set/read the fuses (which I expected).
I have the same issue as [Mikolaj98p] or [maxgerhardt]. Are there any hints to solve this issue. My platformio.ini is set-up for Attiny85 with arduino framework, nothing special.
[env:release]
platform = atmelavr
board = attiny85
board_build.mcu = attiny85
board_build.f_cpu = 8000000L
framework = arduino
upload_protocol = usbasp
; each flag in a new line
upload_flags =
-Pusb
; to override default fuse with custom fuse settings use an extra script
extra_scripts = fuse_settings.py
With the introduction of the fuses target, it looks like the fuse values need to be configured like so in your platformio.ini:
; Arduino Pro Mini Atmega328 8Mhz
board_fuses.hfuse = 0xDA
board_fuses.lfuse = 0xFF
board_fuses.efuse = 0xFD
You may not even need the extra_scripts helper any more… worth commenting that out and trying… e.g. pio run -t fuses or the Set fuses project task (I’d try it myself but don’t have willing victim or programmer handy atm).
I can confirm that it works as you wrote. I made some trials. Now everything needed for configuration is embedded in the platformio.ini - fantastic. Many thx for immediate help and support
Doesn’t work for me
platformio.ini :
[env:attiny85]
platform = atmelavr
board = attiny85
board_build.f_cpu = 8000000L
board_fuses.hfuse = 0xDF
board_fuses.lfuse = 0xE2
upload_protocol = stk500v2
; each flag in a new line
upload_flags =
-Pusb
But fuses are not set:
avrdude: Device signature = 0x1e930b (probably t85)
avrdude: erasing chip
avrdude: reading input file “.pio/build/attiny85/firmware.hex”
avrdude: writing flash (264 bytes):
Are you actually setting the fuses? i.e. running the Set Fuses or Upload using Programmer and Set Fuses task? As the fuses should not be set during a normal upload.
Ok. I didn’t know that you need a special task for this purpose.
I thought this would be done in a ‘normal’ upload if the additional lines with the fuse settings are defined in the platformio.ini file.
Running the special task ‘Set Fuses’ works.
Thanks for the fast help, but I could not derive this information from the docu…
During a ‘normal’ run of avrdude, it never sets the fuses… IIRC… that’s why it also says ‘safemode’ in relation to the fuses. But it is worth mentioning that in the platformio docs also, as it is somewhat unclear if you’re not familar with the behaviour of the underlying tools If you’ve come from Arduino IDE land, this is why you use the ‘Burn Bootloader’ command on new parts (even those like the attiny85 which have no bootloader)… as that’s the only time avrdude is run in ‘set the fuses’ mode (or is that ‘light the fuses’?).
Correct. I like the platformio IDE very much (as it is a ‘real’ IDE in comparison with the Arduino IDE). And it is quite intuitive to use. Just setting the fuses was not that clear to me. The only thing I’m missing now is some kind of simulator (like in AVRStudio). But maybe it is also already there and I was just too impatient to find out how it works…
Hi all.
Maybe i’m wrong, but i can’t no longer see “Set fuses” option in Platformio Tasks…
Is it possible it was removed from that menù with new 2.0.1 Platformio??
No, it’s just confusing… especially when you have only one board environment defined - that you need to expand the environment for it to access that extra menu. I did mention it somewhere before I’m sure, but will probably have to add an issue for it as it was probably on the forum somewhere.
I was never able to get the fuses writing to work. I have since written a PowerShell script that runs from the terminal to do it. I then used the VsCode Action buttons extension to make it available from the actions bar.