Microchip® Advanced Software Framework

isp.c File Reference

In system programming to control security, memories and fuse bits.

Copyright (c) 2011-2018 Microchip Technology Inc. and its subsidiaries.

#include "conf_isp.h"
#include "board.h"
#include "isp.h"
#include "boot.h"
#include "flash_api.h"
#include "string.h"

Functions

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...
 
Miscellaneous functions of the In System Programming module
void isp_init (void)
 Initializes the ISP interface. More...
 
bool isp_is_security (void)
 Gives the security state of the chip. 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...
 
static uint8_t isp_crc8 (uint8_t inCrc, uint8_t inData)
 Calculates the CRC-8-CCITT. More...
 
void isp_force_boot_isp (bool force)
 Change the boot process configuration to enable/disable the ISP mode for the next startup. More...
 

Variables

const isp_mem_t isp_bootloader
 Interface for memory bootloader version. More...
 
const isp_mem_t isp_conf
 Interface for memory configuration (fuse bits) More...
 
const isp_mem_t isp_flash
 Interface for memory flash. More...
 
const isp_mem_t isp_no_available
 Interface for memory no available. More...
 
const isp_mem_t isp_security
 Interface for bit security. More...
 
const isp_mem_t isp_signature
 Interface for memory signature. More...
 
const isp_mem_t isp_user
 Interface for memory user page. More...
 
Specific memories
static isp_mem_signature_t mem_signature
 Memory signature that stores information about the device. More...
 
static isp_mem_bootloader_t mem_bootloader
 Memory bootloader that stores the bootloader version. More...
 
Memories list declaration
const isp_mems_t isp_memories
 Memories list declaration. More...