I have programmed my Sparkfun SAMD21G18a minibreak with the samd21_sam_ba_usbcdc.hex bootloader using my ATMEL ICE. No problem with the flash and I verified the binary image is flashed using the SAM-BA 2.16 GUI at addresses [0x0000 - 0x0ED8]. Address 0x20000000 contains 0x1000 which indicates that the bootloader resident in the SAMD21 expects the user application to be stored at address 0x1000. Sweet, now all I have to do is disconnect my ICE, boot the SAMD21 in bootloader mode and use the SAM-BA 2.16 GUI to flash some code.
The problem is that the SAM-BA 2.16 GUI does not allow me to flash any user applications in the address range [0x1000 - 0x5FFFF]. It throws a pop-up titled "Attempt to write to monitor area" and OK's me off-stage. I think I now understand what is causing the problem...
The SAM-BA 2.16 uses the profile for a SAMD21J18a when programming a SAMD21G18a part. On a lead from another forum poster I opened the source: ...\Atmel\sam-ba_2.16\applets\samd21j18a\sam-ba_applets\flash\flash_app_main It contains the ominous code:
//Typical monitor size when compiled (rounded to 8kb upper bound)
#define MONITOR_SIZE (0x6000)
Can someone hook me up with SAM-BA ver 2.15 (which I have been told works), provide me with a working SAM-BA 2.16 executable, or provide me with a simple tutorial how to recompile the binary for the J18a part to change this line of code?