I am using Windows 11, NCS v2, VSCode extension, under WSL2.
What I want to do is build a UF2 image of my zephyr application and be able to drag/drop it onto a bootloader which supports UF2.
I have looked and I see there are a number of Kconfig parameters which seem to reference this functionality, but I can't figure out what combination of settings and values to use.
I'm familiar that Adafruit has a bootloader (link) which supports UF2, and works on the nrf52840 feather, which I am using.
I can directly flash the Adafruit UF2 bootloader using my jlink programmer. I can also build zephyr applications and flash them through the vscode extension with jlink.
Specifically what I want to accomplish is:
- Take an application which I can normally directly flash to the board (any sample or other application)
- Make changes to the prj.conf file
- Ultimately end up with a UF2 file I can drag/drop onto the USB drive presented by a UF2 bootloader, adafruit or otherwise, but initially adafruit
A number of Kconfig parameters explicitly name UF2 and Adafruit UF2 bootloaders. Is the Adafruit UF2 bootloader expected to work for zephyr applications with the right build configuration?
Below I reference a number of the parameters I have seen and played with unsuccessfully, but I may be missing more. I could really use a working example if there is one.
CONFIG_BUILD_OUTPUT_UF2 - allows automatic building of a zephyr.uf2 file in the build directory. I enabled this, should I? I do see zephyr.uf2 produced as part of the build.
CONFIG_BOOTLOADER_BOSSA_ADAFRUIT_UF2 - "Select the Adafruit UF2 variant of the BOSSA bootloader" Not really sure what this does. Should I set this?
CONFIG_BUILD_OUTPUT_UF2_FAMILY_ID - "UF2 bootloaders only accept UF2 files with a matching family ID" For the nRF52840, I believe the right value is "0xADA52840". I think I should set this.
CONFIG_ROM_START_OFFSET - If the application is built for chain-loading by a bootloader this variable is required to be set to value that leaves sufficient space between the beginning of the image and the start of the first section to store an image header or any other metadata. In the particular case of the MCUboot bootloader this reserves enough space to store the image header, which should also meet vector table alignment requirements on most ARM targets, although some targets may require smaller or larger values. Would I need to set this? To what?
Thanks.