This implementation links the XMEGA NVM functions to the common isp API.
Also, it manage :
- the flash access security
- the JTAG ID information storage
- the bootloader version storage
- the start appli operation through software reset
|
static void | mem_bootloader_read (void *dst, isp_addr_t src, uint16_t nbytes) |
| Copy a bootloader version memory section to a RAM buffer. More...
|
|
static void | mem_eeprom_read (void *dst, isp_addr_t src, uint16_t nbytes) |
| Copy a eeprom memory section to a RAM buffer. More...
|
|
static void | mem_eeprom_write (isp_addr_t dst, const void *src, uint16_t nbytes) |
| Copy a RAM buffer to a eeprom memory section. More...
|
|
static void | mem_flash_read (void *dst, isp_addr_t src, uint16_t nbytes) |
| Copy a flash memory section to a RAM buffer. More...
|
|
static void | mem_flash_write (isp_addr_t dst, const void *src, uint16_t nbytes) |
| Copy a RAM buffer to a flash memory section. More...
|
|
static void | mem_signature_read (void *dst, isp_addr_t src, uint16_t nbytes) |
| Copy a signature memory section to a RAM buffer. More...
|
|
bool isp_erase_chip |
( |
void |
| ) |
|
void isp_force_boot_isp |
( |
bool |
force | ) |
|
Initializes the ISP interface.
Example, load the JTAG ID in signature memory
Referenced by udi_dfu_atmel_enable().
bool isp_is_security |
( |
void |
| ) |
|
Gives the security state of the chip.
- Returns
1
if chip is secured, otherwise 0
.
Referenced by udi_dfu_atmel_enable().
void isp_start_appli |
( |
void |
| ) |
|
Resets the device to start the user application.
The ISP mode must be disabled before (See isp_force_boot_isp(false)) to allow the boot process to jump to the user application.
- Note
- : this function is usually implemented by using a watchdog reset or a software reset to restart the CPU.
References ccp_write_io(), and cpu_irq_disable.
Referenced by udi_dfu_atmel_setup().
static void mem_bootloader_read |
( |
void * |
dst, |
|
|
isp_addr_t |
src, |
|
|
uint16_t |
nbytes |
|
) |
| |
|
static |
Copy a bootloader version memory section to a RAM buffer.
- Parameters
-
dst | Pointer to data destination. |
src | Pointer to source memory. |
nbytes | Number of bytes to transfer. |
static void mem_eeprom_read |
( |
void * |
dst, |
|
|
isp_addr_t |
src, |
|
|
uint16_t |
nbytes |
|
) |
| |
|
static |
Copy a eeprom memory section to a RAM buffer.
- Parameters
-
dst | Pointer to data destination. |
src | Pointer to source flash. |
nbytes | Number of bytes to transfer. |
References nvm_eeprom_read_buffer().
static void mem_eeprom_write |
( |
isp_addr_t |
dst, |
|
|
const void * |
src, |
|
|
uint16_t |
nbytes |
|
) |
| |
|
static |
static void mem_flash_read |
( |
void * |
dst, |
|
|
isp_addr_t |
src, |
|
|
uint16_t |
nbytes |
|
) |
| |
|
static |
Copy a flash memory section to a RAM buffer.
- Parameters
-
dst | Pointer to data destination. |
src | Pointer to source flash. |
nbytes | Number of bytes to transfer. |
References nvm_flash_read_buffer().
static void mem_flash_write |
( |
isp_addr_t |
dst, |
|
|
const void * |
src, |
|
|
uint16_t |
nbytes |
|
) |
| |
|
static |
Copy a RAM buffer to a flash memory section.
- Parameters
-
dst | Pointer to flash destination. |
src | Pointer to source data. |
nbytes | Number of bytes to transfer. |
References nvm_flash_erase_and_write_buffer().
static void mem_signature_read |
( |
void * |
dst, |
|
|
isp_addr_t |
src, |
|
|
uint16_t |
nbytes |
|
) |
| |
|
static |
Copy a signature memory section to a RAM buffer.
- Parameters
-
dst | Pointer to data destination. |
src | Pointer to source memory. |
nbytes | Number of bytes to transfer. |
Initial value:= {
.fnct_write = NULL,
}
static isp_mem_bootloader_t mem_bootloader
Memory bootloader that stores the bootloader version.
Definition: isp.c:77
static void mem_bootloader_read(void *dst, isp_addr_t src, uint16_t nbytes)
Copy a bootloader version memory section to a RAM buffer.
Definition: isp.c:149
Interface for memory bootloader version.
Initial value:= {
.size = EEPROM_SIZE,
}
static void mem_eeprom_read(void *dst, isp_addr_t src, uint16_t nbytes)
Copy a eeprom memory section to a RAM buffer.
Definition: isp.c:115
static void mem_eeprom_write(isp_addr_t dst, const void *src, uint16_t nbytes)
Copy a RAM buffer to a eeprom memory section.
Definition: isp.c:127
Interface for memory eeprom.
Initial value:= {
}
#define FLASH_SIZE
Size of a flash page in bytes.
Definition: nvm.h:447
static void mem_flash_read(void *dst, isp_addr_t src, uint16_t nbytes)
Copy a flash memory section to a RAM buffer.
Definition: isp.c:91
static void mem_flash_write(isp_addr_t dst, const void *src, uint16_t nbytes)
Copy a RAM buffer to a flash memory section.
Definition: isp.c:103
Interface for memory flash.
Initial value:= {
.list = {
}
}
const isp_mem_t isp_flash
Interface for memory flash.
Definition: isp.c:167
const isp_mem_t isp_signature
Interface for memory signature.
Definition: isp.c:188
const isp_mem_t isp_no_available
Interface for memory no available.
Definition: isp.c:195
const isp_mem_t isp_eeprom
Interface for memory eeprom.
Definition: isp.c:174
const isp_mem_t isp_bootloader
Interface for memory bootloader version.
Definition: isp.c:181
Memories list declaration.
Referenced by udi_dfu_atmel_sel_mem().
Initial value:= {
.size = 0,
.fnct_read = NULL,
.fnct_write = NULL,
}
Interface for memory no available.
Initial value:= {
.fnct_write = NULL,
}
static isp_mem_signature_t mem_signature
Memory signature that stores information about the device.
Definition: isp.c:74
static void mem_signature_read(void *dst, isp_addr_t src, uint16_t nbytes)
Copy a signature memory section to a RAM buffer.
Definition: isp.c:161
Interface for memory signature.
Initial value:= {
.id1 = 0,
.id2 = 0,
}
#define BOOTLOADER_VERSION
Definition: conf_isp.h:53
Memory bootloader that stores the bootloader version.
Memory signature that stores information about the device.