Can't upload UF2 file to nrf52840

Hi there,

So Next , you made progress
The issue you’re describing with the UF2 file and the “Sysbuild” option in SDK 2.6 is a known quirk. Here’s what’s going on:

  • Sysbuild Option:
    The Sysbuild (or system build) option in some older Nordic SDK configurations adds extra system components or changes how certain metadata (such as the vector table or image headers) is generated. This configuration can modify the layout or headers of your firmware image.
  • UF2 Bootloader Expectations:
    The UF2 bootloader on the Xiao expects the firmware image to be formatted in a very specific way, with particular metadata and memory offsets. When the Sysbuild option is enabled, those modifications can cause a mismatch between what the bootloader expects and what’s actually in the UF2 file.
  • Resulting Behavior:
    As the thread you mentioned indicates, with Sysbuild enabled, you might see error messages during upload because the image header or some metadata doesn’t match exactly what the bootloader anticipates. However, once the file is (imperfectly) loaded, the application code itself is still correct and will run as expected.
  • The Fix:
    Removing the Sysbuild option essentially tells the build system to generate a “cleaner” firmware image—one that better matches the bootloader’s requirements. Even though some minor errors might still be reported during upload, the resulting UF2 file is compatible enough that the board boots into your application properly.

In summary:
The problem stems from a configuration detail in SDK 2.6 where the Sysbuild option alters the UF2 image format in a way that conflicts with the bootloader’s expectations on the Xiao. Disabling that option produces an image that, despite minor warnings, loads and runs correctly.

If you’re building with SDK 2.6 for the Xiao, it’s recommended to remove the Sysbuild option when you intend to use UF2 uploads. This workaround has been proven to let the application run correctly even if the upload process reports some errors.

HTH
GL :slight_smile: PJ :v:

it’s pain having One foot in NRF_sdk and the other in Arduino IDE LOL. But with All of the changes currently and new developments
the Nrf_SDK is the way to go. IMO. Debugging is a dream, even in PLIO it works, but NOT in Arduino go figure.
FWIW;
Nordic Backs there stuff 100% and updates and improvements are constant, NONE of the others even come close in my experience.