A LED flasher example (from Atmel START) is available in this folder to understand how to use the UART Bootloader with provided python script.

1. Build and Program the bootloader (bootloader_SAML11x16A_64K for the SAM L11 Xpro) .

2. Program using Atmel Studio Device Programming tool the following USER_WORD (UROW) bitfields:
	i. RXN = 0x0 // Must be cleared or the SAM L11 will not be able to enter Bootloader mode, as the Bootloader runs from the RAM to allow for self-update
	ii. AS = 0x80, ANSC = 0x20, RS = 0x40 // This maps half of the Flash/SRAM to the Secure area (bootloader+application)

Note: SAM L11 AS, ANSC and RS fuses values depend on the bootloader+application size.

3. Build LEDflasher_l11 solution (secure project first then non-secure one) to generate the different application binary files (secure, nsc and non secure binaries).

4. Once done, use boot.py utility (from bootloader_uart_l11\tools folder) to flash the application by using following command in Windows Command Prompt (Cmd):

	boot.py -v -i COM10 -f ..\..\LEDflasher_l11\LEDflasher_l11\Debug\LEDflasher_l11_prog.bin -o 0x400
	boot.py -v -i COM10 -f ..\..\LEDflasher_l11\LEDflasher_l11\Debug\LEDflasher_l11_veneer.bin -o 0x7C00
	boot.py -v -i COM10 -f ..\..\LEDflasher_l11\Non-Secure_LEDflasher_l11\Debug\Non-Secure_LEDflasher_l11.bin -o 0x8000
	boot.py -v -i COM10 -r

	Note: 	pySerial module is required to be installed on top of python 2.X.

			Tested environment:
				i. 		python-2.7.14.exe
				ii. 	pyserial-2.7.win32.exe
				
Note: COMx port number can be retrieved using Windows Device Manager.
Note: Binary offset values must be adjusted depending on applications linker files.
Note: it is also possible to update UROW and/or BOCOR NVM rows. Refer to product data sheet for more details on UROW/BOCOR use.