/* Unlock the Flash Program and Erase Controller, upper Bank. 
This enables write access to the upper bank of the Flash memory in XL devices. It is locked by default on reset.  */
void flash_unlock_upper(void)
/* Unlock the Flash Program and Erase Controller, upper Bank. 
This enables write access to the upper bank of the Flash memory in XL devices. It is locked by default on reset.  */
void flash_unlock_upper(void)
{
	if (desig_get_flash_size() > 512) {
		FLASH_CR2 |= FLASH_CR_LOCK;
		FLASH_KEYR2 = FLASH_KEYR_KEY1;
		FLASH_KEYR2 = FLASH_KEYR_KEY2;
	}
}