Atmel Software Framework

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
In System Programming API

Modules

 In System Programming UC3 implementation
 This implementation links the UC3 NVM functions to the common isp API.
 
 Boot Process definition for UC3 parts
 The behavior of the UC3 boot process for bootloader is defined by the fuses values and two Words in the user page.
 

Data Structures

struct  isp_mem_bootloader_t
 Memory bootloader structure. More...
 
struct  isp_mem_t
 Memory API definition. More...
 
union  isp_mems_t
 Memories list structure. More...
 

Typedefs

typedef uint32_t isp_addr_t
 Data type for holding flash memory addresses. More...
 

Functions

 COMPILER_PACK_SET (1) typedef union
 Memory signature structure to store JTAG ID. More...
 

Variables

 isp_mem_signature_t
 
const isp_mems_t isp_memories
 Memories list declaration. More...
 

Main In System Programming functions

void isp_init (void)
 Initializes the ISP interface. More...
 
bool isp_is_security (void)
 Gives the security state of the chip. More...
 
void isp_force_boot_isp (bool force)
 Change the boot process configuration to enable/disable the ISP mode for the next startup. More...
 
bool isp_erase_chip (void)
 Erase the application flash area and eventually the eeprom. More...
 
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. More...
 
void isp_start_appli (void)
 Resets the device to start the user application. More...
 

Memory units index values

Used to access at a memory through isp_memories list.

#define ISP_MEM_FLASH   0x00
 
#define ISP_MEM_EEPROM   0x01
 
#define ISP_MEM_SECURITY   0x02
 
#define ISP_MEM_CONFIGURATION   0x03
 
#define ISP_MEM_BOOTLOADER   0x04
 
#define ISP_MEM_SIGNATURE   0x05
 
#define ISP_MEM_USER   0x06
 
#define ISP_MEM_INT_RAM   0x07
 
#define ISP_MEM_EXT_MEM_CS0   0x08
 
#define ISP_MEM_EXT_MEM_CS1   0x09
 
#define ISP_MEM_EXT_MEM_CS2   0x0A
 
#define ISP_MEM_EXT_MEM_CS3   0x0B
 
#define ISP_MEM_EXT_MEM_CS4   0x0C
 
#define ISP_MEM_EXT_MEM_CS5   0x0D
 
#define ISP_MEM_EXT_MEM_CS6   0x0E
 
#define ISP_MEM_EXT_MEM_CS7   0x0F
 
#define ISP_MEM_EXT_MEM_DF   0x10
 
#define ISP_MEM_COUNT   0x11
 

#define ISP_MEM_BOOTLOADER   0x04

Referenced by udi_dfu_atmel_sel_mem().

#define ISP_MEM_CONFIGURATION   0x03

Referenced by udi_dfu_atmel_sel_mem().

#define ISP_MEM_COUNT   0x11
#define ISP_MEM_EEPROM   0x01
#define ISP_MEM_EXT_MEM_CS0   0x08
#define ISP_MEM_EXT_MEM_CS1   0x09
#define ISP_MEM_EXT_MEM_CS2   0x0A
#define ISP_MEM_EXT_MEM_CS3   0x0B
#define ISP_MEM_EXT_MEM_CS4   0x0C
#define ISP_MEM_EXT_MEM_CS5   0x0D
#define ISP_MEM_EXT_MEM_CS6   0x0E
#define ISP_MEM_EXT_MEM_CS7   0x0F
#define ISP_MEM_EXT_MEM_DF   0x10
#define ISP_MEM_FLASH   0x00
#define ISP_MEM_INT_RAM   0x07
#define ISP_MEM_SECURITY   0x02

Referenced by udi_dfu_atmel_sel_mem().

#define ISP_MEM_SIGNATURE   0x05

Referenced by udi_dfu_atmel_sel_mem().

#define ISP_MEM_USER   0x06

typedef uint32_t isp_addr_t

Data type for holding flash memory addresses.

COMPILER_PACK_SET ( )

Memory signature structure to store JTAG ID.

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)

Change the boot process configuration to enable/disable the ISP mode for the next startup.

Parameters
forceEnable the ISP mode for the next startup if true

References BOOT_CFG1, BOOT_CFG1_ADDRESS, BOOT_CFG1_CRC8_MASK, BOOT_CFG1_CRC8_OFFSET, BOOT_CFG1_FORCE_MASK, BOOT_CFG1_FORCE_OFFSET, i, and isp_crc8().

Referenced by udi_dfu_atmel_setup(), and udi_dfu_flip_msg_decode().

void isp_init ( void  )

Initializes the ISP interface.

Example, load the JTAG ID in signature memory

References Get_debug_register, mem_signature, and Rd_bitfield.

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.

References isp_mem_t::fnct_read.

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 cpu_irq_disable, UC3C, UC3D, and UC3L3_L4.

Referenced by udi_dfu_atmel_setup().

isp_mem_signature_t
const isp_mems_t isp_memories

Memories list declaration.

Referenced by udi_dfu_atmel_sel_mem().