16 #include "../misc/bootloaderShared.h" 17 #include "../misc/rtos.h" 23 uint32_t
flash_update_block(uint32_t address,
const void* newData,
int dataSize,
int noPageErase)
44 else if (memcmp((
const void*)address, newData, dataSize) == 0)
65 for (
int i = 0; i < 10; i++)
82 if (memcmp((
const void*)address, newData, dataSize) == 0)
85 flash_lock(address, address + dataSize - 1, 0, 0);
98 #if !defined(PLATFORM_IS_EVB_2) 161 return flash_read_user_signature((uint32_t*)ptr, size /
sizeof(uint32_t));
170 memcpy(ptrCopy, (
const void*)ptr, size);
175 flash_erase_user_signature();
179 uint32_t result = flash_write_user_signature(ptrCopy, size /
sizeof(uint32_t));
__no_inline RAMFUNC void flash_erase_chip(void)
#define cpu_irq_disable()
Disable interrupts globally.
void vPortFree(void *pv) PRIVILEGED_FUNCTION
uint32_t flash_erase_block(uint32_t address)
#define RSTC_CR_KEY_PASSWD
(RSTC_CR) Writing any other value in this field aborts the write operation.
#define EEFC_FCR_FCMD(value)
void * pvPortMalloc(size_t xSize) PRIVILEGED_FUNCTION
#define EEFC_FCR_FARG(value)
#define RSTC
(RSTC ) Base Address
uint32_t flash_write_count
uint32_t flash_lock(uint32_t ul_start, uint32_t ul_end, uint32_t *pul_actual_start, uint32_t *pul_actual_end)
Lock all the regions in the given address range. The actual lock range is reported through two output...
#define WDT_CR_WDRSTT
(WDT_CR) Watchdog Restart
#define WDT
(WDT ) Base Address
uint32_t flash_update_block(uint32_t address, const void *newData, int dataSize, int noPageErase)
#define EEFC_FCR_FKEY_PASSWD
#define END_CRITICAL_SECTION
User board definition template.
#define BOOTLOADER_FLASH_USER_DATA_END_ADDRESS
#define BOOTLOADER_FLASH_BLOCK_SIZE
#define RSTC_CR_PROCRST
(RSTC_CR) Processor Reset
uint32_t flash_get_user_signature(volatile void *ptr, uint32_t size)
#define EFC
(EFC ) Base Address
uint32_t efc_perform_fcr(Efc *p_efc, uint32_t ul_fcr)
Perform command.
uint32_t flash_write(uint32_t ul_address, const void *p_buffer, uint32_t ul_size, uint32_t ul_erase_flag)
Write a data buffer on flash.
#define BEGIN_CRITICAL_SECTION
uint32_t flash_set_user_signature(const volatile void *ptr, uint32_t size)
int flash_write_in_progress(void)
void time_delay(uint32_t ms)
Autogenerated API include file for the Atmel Software Framework (ASF)
nvr_manage_t g_nvr_manage_config
#define EFC_FCMD_EA
Erase all.
#define EEFC_FSR_FRDY
(EEFC_FSR) Flash Ready Status (cleared when Flash is busy)
#define BOOTLOADER_FLASH_USER_DATA_START_ADDRESS
static int s_flashWriteInProgress
uint32_t flash_unlock(uint32_t ul_start, uint32_t ul_end, uint32_t *pul_actual_start, uint32_t *pul_actual_end)
Unlock all the regions in the given address range. The actual unlock range is reported through two ou...
#define EFC_FCMD_CGPB
Clear GPNVM Bit.