This implementation links the UC3 NVM functions to the common isp API.
Also, it manage :
- the flash access security
- the JTAG ID information storage
- the bootloader version storage
- the ISP force flag
- the start appli operation through watchdog 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_configuration_read (void *dst, isp_addr_t src, uint16_t nbytes) |
| Copy the fuse bits values to a RAM buffer. More...
|
|
static void | mem_configuration_write (isp_addr_t dst, const void *src, uint16_t nbytes) |
| Copy the RAM buffer values to fuse bits. 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_security_read (void *dst, isp_addr_t src, uint16_t nbytes) |
| Copy the security bit value to a RAM buffer. More...
|
|
static void | mem_security_write (isp_addr_t dst, const void *src, uint16_t nbytes) |
| Set the security bit. 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...
|
|
static void | mem_user_read (void *dst, isp_addr_t src, uint16_t nbytes) |
| Copy an user page memory section to a RAM buffer. More...
|
|
static void | mem_user_write (isp_addr_t dst, const void *src, uint16_t nbytes) |
| Copy a RAM buffer to a user page memory section. More...
|
|
static uint8_t isp_crc8 |
( |
uint8_t |
inCrc, |
|
|
uint8_t |
inData |
|
) |
| |
|
static |
bool isp_erase_chip |
( |
void |
| ) |
|
Erase the application flash area and eventually the eeprom.
- Returns
1
if function was successfully done, otherwise 0
.
Referenced by udi_dfu_atmel_erase_chip().
bool isp_erase_chip_split |
( |
void |
| ) |
|
Erase a part of the application flash area This function must be called again as long as it returns 0.
- Returns
1
if the whole application flash area is erased, otherwise it is not finished.
This function has been created to split a long erase so that the ISP application is able to answer external pending requests.
Referenced by udi_dfu_atmel_erase_chip().
void isp_force_boot_isp |
( |
bool |
force | ) |
|
bool isp_is_security |
( |
void |
| ) |
|
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 cpu_irq_disable, UC3C, UC3D, and UC3L3_L4.
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_configuration_read |
( |
void * |
dst, |
|
|
isp_addr_t |
src, |
|
|
uint16_t |
nbytes |
|
) |
| |
|
static |
Copy the fuse bits values to a RAM buffer.
- Parameters
-
dst | Byte array to store fuse bit values (1bit/Byte). |
src | Fuse bit address to read |
nbytes | Number of bit to read |
static void mem_configuration_write |
( |
isp_addr_t |
dst, |
|
|
const void * |
src, |
|
|
uint16_t |
nbytes |
|
) |
| |
|
static |
Copy the RAM buffer values to fuse bits.
- Parameters
-
dst | Fuse bit address to write |
src | Byte array of fuse bit values (1bit/Byte). |
nbytes | Number of bit to write |
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. |
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. |
static void mem_security_read |
( |
void * |
dst, |
|
|
isp_addr_t |
src, |
|
|
uint16_t |
nbytes |
|
) |
| |
|
static |
Copy the security bit value to a RAM buffer.
- Parameters
-
dst | Pointer to store security bit value. |
src | Not used |
nbytes | Must be different of 0 |
static void mem_security_write |
( |
isp_addr_t |
dst, |
|
|
const void * |
src, |
|
|
uint16_t |
nbytes |
|
) |
| |
|
static |
Set the security bit.
- Parameters
-
dst | Not used |
src | Pointer to new security bit value (Must be different of 0) |
nbytes | Must be different of 0 |
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. |
References mem_signature.
static void mem_user_read |
( |
void * |
dst, |
|
|
isp_addr_t |
src, |
|
|
uint16_t |
nbytes |
|
) |
| |
|
static |
Copy an user page 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_user_write |
( |
isp_addr_t |
dst, |
|
|
const void * |
src, |
|
|
uint16_t |
nbytes |
|
) |
| |
|
static |
Copy a RAM buffer to a user page memory section.
- Parameters
-
dst | Pointer to user page destination. |
src | Pointer to source data. |
nbytes | Number of bytes to transfer. |
Initial value:= {
}
#define NULL
Definition: lwip-1.4.1/src/include/lwip/def.h:47
static isp_mem_bootloader_t mem_bootloader
Memory bootloader that stores the bootloader version.
Definition: isp.c:86
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:182
Interface for memory bootloader version.
Initial value:= {
.size = FLASH_API_GPF_NUM,
}
static void mem_configuration_read(void *dst, isp_addr_t src, uint16_t nbytes)
Copy the fuse bits values to a RAM buffer.
Definition: isp.c:152
static void mem_configuration_write(isp_addr_t dst, const void *src, uint16_t nbytes)
Copy the RAM buffer values to fuse bits.
Definition: isp.c:167
Interface for memory configuration (fuse bits)
Initial value:= {
.size = FLASH_API_SIZE,
}
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:100
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:112
Interface for memory flash.
Initial value:= {
.list = {
}
}
const isp_mem_t isp_flash
Interface for memory flash.
Definition: isp.c:224
const isp_mem_t isp_signature
Interface for memory signature.
Definition: isp.c:252
const isp_mem_t isp_security
Interface for bit security.
Definition: isp.c:231
const isp_mem_t isp_no_available
Interface for memory no available.
Definition: isp.c:266
const isp_mem_t isp_user
Interface for memory user page.
Definition: isp.c:259
const isp_mem_t isp_conf
Interface for memory configuration (fuse bits)
Definition: isp.c:238
const isp_mem_t isp_bootloader
Interface for memory bootloader version.
Definition: isp.c:245
Memories list declaration.
Referenced by udi_dfu_atmel_sel_mem().
Initial value:= {
.size = 0,
}
#define NULL
Definition: lwip-1.4.1/src/include/lwip/def.h:47
Interface for memory no available.
Initial value:= {
.size = 1,
}
static void mem_security_write(isp_addr_t dst, const void *src, uint16_t nbytes)
Set the security bit.
Definition: isp.c:138
static void mem_security_read(void *dst, isp_addr_t src, uint16_t nbytes)
Copy the security bit value to a RAM buffer.
Definition: isp.c:124
Interface for bit security.
Initial value:= {
}
#define NULL
Definition: lwip-1.4.1/src/include/lwip/def.h:47
static isp_mem_signature_t mem_signature
Memory signature that stores information about the device.
Definition: isp.c:83
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:194
Interface for memory signature.
Initial value:= {
.size = FLASH_API_USER_PAGE_SIZE,
}
static void mem_user_write(isp_addr_t dst, const void *src, uint16_t nbytes)
Copy a RAM buffer to a user page memory section.
Definition: isp.c:218
static void mem_user_read(void *dst, isp_addr_t src, uint16_t nbytes)
Copy an user page memory section to a RAM buffer.
Definition: isp.c:206
Interface for memory user page.
Initial value:= {
.id1 = 0,
.id2 = 0,
}
#define BOOTLOADER_VERSION
Definition: conf_isp.h:48
Memory bootloader that stores the bootloader version.