
I also haven't worked with PlatformIO advanced scripting before, so forgive me if some of the following questions are silly to some. I have very little experience with python, but I think this should be doable, even for me if someone points me in the right direction. If one or more is present, then this fuse is overridden by whatever value the particular boards_fuses fields holds My idea here would be to check if board_fuses.high, board_fuses.low and board_fuses.extended is present. The last option should be to manually set fuses and override everything. This is possible in Arduino IDE through a separate menu option. Again, this decides what bootloader hex file is loaded.Īnother fuse related feature is the ability to set the brownout detection level. Since the name and path of the bootloader are so extensive, we can check if the user entered a valid board_build.f_cpu, and board_upload.speed by checking if a bootloader with these values exists.Ī bootloader for a >=64kB device is named like this: bootloaders/atmega1284p/16000000L/optiboot_flash_atmega1284p_UART0_1000000_16000000L_BIGBOOT.hexĪ bootloader for a <=32kB device is named like this: bootloaders/atmega328p/16000000L/optiboot_flash_atmega328p_UART0_115200_16000000L.hexīy adding a new parameter to platformio.ini ( board_upload.uart_port maybe?) we can specify if UART0, UART1 or UARTn should be used for uploading. Preferably there should be three flags, one to only set the fuse bits, one to only burn the bootloader and one for doing both. Might圜ore, MiniCore, and MegaCore (all supported by PlatformIO) comes with a bunch of pre-compiled bootloaders where all shares the same file names rules.Īs long as board, board_build.f_cpu, and board_upload.speed is present in platformio.ini Is it possible for a script to figure out the correct fuse bits and load the correct bootloader hex file.


As a developer working with AVRs I feel like the last thing missing from PlatformIO now is the ability to set the correct fuse bits and burn the correct bootloader based on the information given in platformio.ini.
