PlatformIO Community

Bootloader target fails with "Missing bootloader fuses!" although set

Hi,

I set the bootloader options for my ATtiny84 inside the platformio.ini like described in the docs http://docs.platformio.org/en/latest/platforms/atmelavr.html#bootloader-programming. My config:

[env:attiny84]
platform = atmelavr
board = attiny84
framework = arduino

upload_protocol = stk500v1
upload_flags =
  -P$UPLOAD_PORT
  -b$UPLOAD_SPEED
upload_speed = 19200
upload_port = COM3


board_bootloader.file = optiboot/optiboot_attiny84_8000000L.hex
board_bootloader.low_fuses = 0xE2
board_bootloader.high_fuses = 0xDF
board_bootloader.extended_fuses = 0xff
board_bootloader.lock_bits = 0xFF
board_bootloader.unlock_bits = 0xFF 

board_build.variant=tinyX4_reverse 

When I’m trying to burn the bootloader for my ATtiny84 using

platformio run --target bootloader -v

it fails with “Missing bootloader fuses!” although those are set in the platformio.ini file like shown above:

PS D:\temp\nrftest-attiny84-2> platformio run --target bootloader -v
Processing attiny84 (platform: atmelavr; board: attiny84; framework: arduino; upload_protocol: stk500v1; upload_flags: -P$UPLOAD_PORT, -b$UPLOAD_SPEED; upload_speed: 19200; upload_port: COM3; board_bootloader.file: optiboot/optiboot_attiny84_8000000L.hex; board_bootloader.low_fuses: 0xE2; board_bootloader.high_fuses: 0xDF; board_bootloader.extended_fuses: 0xff; board_bootloader.lock_bits: 0xFF; board_bootloader.unlock_bits: 0xFF; board_build.variant: tinyX4_reverse)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/attiny84.html
PLATFORM: Atmel AVR 2.0.0 > Generic ATtiny84
HARDWARE: ATTINY84 8MHz, 512B RAM, 8KB Flash
PACKAGES: framework-arduino-avr-attiny 1.3.2, toolchain-atmelavr 1.50400.190710 (5.4.0)
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 9 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Error: Missing bootloader fuses!
==================================================================================== [FAILED] Took 1.64 seconds ==================================================================================== 

Did is miss something?

Thanks
Markus

I don’t think so… I think it was actually an oversight when the bootloader/fuse setting was added.

I noticed before that if I was trying to set the fuse on a target that didn’t have fuse settings in it’s configuration file, that it didn’t seem to work, and it looks like that is the case even after the recent refactoring of the code. [edit: or maybe not?]

Can you try this instead (based on the naming used in a board that does have fuses configured)… maybe it’s a naming mistake in the documentation? I just noticed there is some inconsistency with the bootloader settings and the custom fuse settings, and the bootloader one looks wrong.

board_bootloader.file = optiboot/optiboot_attiny84_8000000L.hex
board_bootloader.lfuse = 0xE2
board_bootloader.hfuse = 0xDF
board_bootloader.efuse = 0xff
board_bootloader.lock_bits = 0xFF
board_bootloader.unlock_bits = 0xFF 

Thanks, it worked! I created a PR for the docs: https://github.com/platformio/platformio-docs/pull/113

1 Like