Your SAMD51 M4 board bootloader may need to be updated to fix an intermittent bug that can erase parts of internal flash.
To see if you need to update your bootloader, get the UF2 boot drive to appear as a mounted drive on your computer, in a file browser window. If you're running MakeCode, click the reset button once. If you're running CircuitPython or an Arduino program, double-click the reset button.
When you see the ...BOOT drive (FEATHERBOOT, METROM4BOOT, ITSYM4BOOT, PORTALBOOT, etc.) , click the drive in the file browser window and then double-click the INFO_UF2.TXT file to see what's inside.
The example screenshots below are for a PyGamer. What you see for your board will be largely the same except for the board name and the BOOT drive name.
The bootloader version is listed in INFO_UF2.TXT. In this example, the version is v3.6.0.
If the bootloader version you see is older than v3.9.0, you need to update. For instance, the bootloader above needs to be upgraded.
Download the latest version of the bootloader updater from the circuitpython.org Downloads page for your board.
- The bootloader updater will be named update-bootloader-name_of_your_board-v3.9.0.uf2 or some later version. Drag that file from your Downloads folder onto the BOOT drive:
After you drag the updater onto the boot drive, the red LED on the board will flicker and then blink slowly about five times. A few seconds later, the BOOT will appear in the Finder. After that, you can click on the BOOT drive and double-click INFO_UF2.TXT again to confirm you've updated the bootloader.