PIC18F BootLoader
|
The functions are declared and defined state enumerations. More...
#include <xc.h>
#include <p18f4431.h>
#include <string.h>
#include <stdlib.h>
Go to the source code of this file.
Macros | |
#define | NVM_ROW_SIZE 8 |
#define | NVM_PAGE_SIZE 64 |
#define | NVM_START_ADDRESS 0x00 |
#define | NVM_END_ADDRESS 0x3fff |
Typedefs | |
typedef unsigned char | uint8_t |
typedef unsigned short | uint16_t |
typedef unsigned long | uint32_t |
typedef enum SYSTEM_STATUS_Tag | SYS_STATE_t |
Enumeral represents different system states. | |
typedef enum SYSTEM_COM_PROTOCOL_MSG_Tag | SYS_COM_PROTOCL_MSG_t |
Enumeral represents handshaking signals between programmer and controller. | |
Enumerations | |
enum | SYSTEM_STATUS_Tag { SYS_WAIT_FOR_START_CMND, SYS_CONFIG_FLASH, SYS_RCV_FIRMWARE_HEADER, SYS_FIRMWARE_UPDATE, SYS_RUN_APPLCN, SYS_SND_ADDRS_RANGE } |
Enumeral represents different system states. More... | |
enum | SYSTEM_COM_PROTOCOL_MSG_Tag { SYS_START_CMND_FROM_PROGRMR = 0x01, SYS_READY_FOR_FIRMWARE_HEADER, SYS_FIRMWARE_HEADER_POS_ACK, SYS_FIRMWARE_HEADER_NEG_ACK, SYS_SND_NXT_CHUNK, SYS_ADDRESS_RANGE_TAG, SYS_ADDRESS_RANGE_RQT } |
Enumeral represents handshaking signals between programmer and controller. More... | |
Functions | |
void | runStateMachine (void) |
function executes different states of the system. SYS_SND_ADDRS_RANGE - Send the PIC programmable start and end address of the program memory SYS_WAIT_FOR_START_CMND - The Start command triggers system to start the process and initializes buffer counter SYS_RCV_FIRMWARE_HEADER - Get the total packet count from the host and applcn start address SYS_CONFIG_FLASH - Erase application program area and update table pointer SYS_FIRMWARE_UPDATE - Receive and put the binary chunks in the flash memory SYS_RUN_APPLCN - Run the application | |
void | initVarConfigPort (void) |
function configures and initializes IO ports. | |
void | runApplcn (void) |
PC is updated with the new pointer to execute loaded binary from the application flash program memory. | |
Variables | |
uint16_t | applStartAdd |
uint8_t | totalNumberOfPacckets |
uint8_t | progMemRange [] |
The functions are declared and defined state enumerations.
#define NVM_END_ADDRESS 0x3fff |
NVM end adress.
#define NVM_PAGE_SIZE 64 |
NVM each page size 64 bytes.
#define NVM_ROW_SIZE 8 |
NVM each row size 8 bytes.
#define NVM_START_ADDRESS 0x00 |
NVM start adress.
typedef unsigned short uint16_t |
typedef for unsigned short.
typedef unsigned long uint32_t |
typedef for unsigned long.
typedef unsigned char uint8_t |
typedef for unsigned char.
Enumeral represents handshaking signals between programmer and controller.
enum SYSTEM_STATUS_Tag |
Enumeral represents different system states.
uint16_t applStartAdd |
Application start address.
uint8_t progMemRange[] |
uint8_t totalNumberOfPacckets |
Variable holds the (size of the firmware/64) in bytes.