I want to flash the UF2 bootloader for SAMD21 MCUs together with a compiled binary of a user program onto a SAMD21 MCU.
From what I understand how any bootloader works, the bootloader sits in a specific address space in the flash (in case of UF2 it seems to be 0x0-0x00002000) and then after that address space the bootloader will flash the user program and execute it.
Now it would be great if I can program my board with the bootloader and the default user programm all in once without needing to flash the bootloader with the programmer first and then connecting the board via USB to flash the user program.
Can I somehow concat the binaries so the programmer can flash everything at once in a single operation?
I planned on using https://github.com/adafruit/Adafruit_DAP with a Teesny for flashing. This works great using only the bootloader binary.