Thanks, I did see that but I was hoping for a bit more technical information.
The Adafruit SAMD21 contains a bootloader that can flash new code to the microcontroller (ie. UF2 format).
When you follow "part 1" and copy the first UF2 file, it is updating the SAMD21 microcontroller with new code. However, what's confusing is that afterwards you follow "part 2" which flashes different code to the microcontroller. I am wondering why there are two steps for updating the microcontroller code.
I'm wondering if part 1 is overwriting the SAMD21 internal bootloader (ie. the bootloader pre-installed on the Trinket) with a new one.
...or stated a different way:
Part 1 updates SAMD21 internal bootloader:
Part 2 updates SAMD21 program code.
Snippet from part1 (https://github.com/mattytrog/FUSEE_...-Suite/Part_1/Trinket/FUSEE_SUITE_TRINKET.ino):
This appears to be writing to address 0x0 which I think is overwriting the SAMD21 bootloader? I think this SAMD21 bootloader is what mattytrog is calling a "prebootloader" ?
Sorry, I'm just trying to understand how this works because I'm interested in learning.
The Adafruit SAMD21 contains a bootloader that can flash new code to the microcontroller (ie. UF2 format).
When you follow "part 1" and copy the first UF2 file, it is updating the SAMD21 microcontroller with new code. However, what's confusing is that afterwards you follow "part 2" which flashes different code to the microcontroller. I am wondering why there are two steps for updating the microcontroller code.
I'm wondering if part 1 is overwriting the SAMD21 internal bootloader (ie. the bootloader pre-installed on the Trinket) with a new one.
...or stated a different way:
Part 1 updates SAMD21 internal bootloader:
Part 2 updates SAMD21 program code.
Snippet from part1 (https://github.com/mattytrog/FUSEE_...-Suite/Part_1/Trinket/FUSEE_SUITE_TRINKET.ino):
Code:
for (i = 0; i < BOOTLOADER_K * 1024; i += FLASH_ROW_SIZE) {
memcpy(pageBuf, &bootloader[i], FLASH_ROW_SIZE);
flash_write_row((uint32_t *)(void *)i, (uint32_t *)(void *)pageBuf);
}
This appears to be writing to address 0x0 which I think is overwriting the SAMD21 bootloader? I think this SAMD21 bootloader is what mattytrog is calling a "prebootloader" ?
Sorry, I'm just trying to understand how this works because I'm interested in learning.
Last edited by sofakng,