Files
TX/source/Loader/bootloader.h

45 lines
1.2 KiB
C
Raw Permalink Normal View History

/*
* bootloader.h
*
* Created on: Oct 22, 2023
* Author: Brian.Bailey
*/
#ifndef LOADER_BOOTLOADER_H_
#define LOADER_BOOTLOADER_H_
#include <stdint.h>
#include <stdbool.h>
#include "bootloader.h"
#define BL_VERSION 1 //Bootloader Version (integer)
#define BL_MAX_VERSION 255 //Max version - otherwise FLASH reads as uninitialized
//Locations for bootable image components
//Update these for transmitter.
#define BL_BOOTLOADER_IMAGE_ADDR 0x00000000 //base address for the bootloader image in FLASH
#define BL_APP_IMAGE_ADDR 0x00010000 //base address for the application image in FLASH
//Bootloader EEPROM Addresses
#define BL_RESERVED 0x0000 //Don't use address 0x0
#define BL_VERSION_EEPROM_ADDR 0x0004
#define BL_LOADERRUNREQUEST_EEPROM_ADDR 0x0008
#define BL_PROGRAMMED_EEPROM_ADDR 0x000C
//First 128 addresses (32 entries) in EEPROM are reserved for the bootloader
typedef struct {
uint32_t version; //bootloader version (for application to read)
uint32_t loaderRunRequest; //loader run request for program update
uint32_t transmitterProgrammed; //Transmitter has been programmed
}BL_DATA_t;
void BL_Run(void);
void BL_ShowScreen(void);
void BL_ReadInfo(void); //for application
#endif /* LOADER_BOOTLOADER_H_ */