Fixed fuse flashing in Nano Every configuration #130
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I noticed an issue with the current release of MegaCoreX while developing my own board with the following design choices:
I modified the core in my own internal builds by duplicating the Nano Every's board definition and changed the
build.variant
touno-wifi
for that specific pinout, while still retaining the other properties for a SAMD11 based programmer (1200bps touch, JTAG2UPDI).I started running into UART issues when I changed the board frequency from 20MHz to 16MHz (and by extension, all clock speeds that depend on the 16MHz oscillator). I tried to dump the fuses from the ATmega4809 and found out that the fuses were not burnt, meaning that while
F_CPU
was altered, the relevant fuse was never changed to reflect the correct frequency.I dug around further and found that the
{bootloader.fuse0}
in platform.txt (and by extension, the other fuse and lock bits) were all blank, astools.avrdude_nanoevery
never had definitions for those variables. This commit fixes the issue by adding those variables, although there might be a more elegant solution than duplicatingtools.avrdude.bootloader.<insert fuse here>
intotools.avrdude_nanoevery.bootloader.<insert fuse here>
. If others have more insights on this, please chime in as this is the first time I've modified platform.txt like this :)