Problems flashing bootloader to SAMD51 using Segger J-Link EDU and Microchip studio

“Bits 11:8 – BOOTPROT[3:0] Boot Loader Protection Size This bitfield is loaded from the NVM User page during the device startup (See the Memories chapter). Defines the size of the BOOTPROT region which is protected against write or erase or Chip-Erase operations. This size is given by the following formula (15-BOOTPROT)*8KB.”

So, if I’m reading this right, 0 maximises the size of the write- and erase-protected region?

I suggest setting it to 15, then erase, then write, then set it back to 0.

Best,
Paul