STM32 Bootloader
Customizable Bootloader for STM32 microcontrollers
|
Go to the documentation of this file.
16 #ifndef __BOOTLOADER_H
17 #define __BOOTLOADER_H
31 #define USE_CHECKSUM 0
34 #define USE_WRITE_PROTECTION 0
37 #define SET_VECTOR_TABLE 1
45 #define CLEAR_RESET_FLAGS 1
48 #define APP_ADDRESS (uint32_t)0x08008000
51 #define END_ADDRESS (uint32_t)0x080FFFFB
54 #define CRC_ADDRESS (uint32_t)0x080FFFFC
57 #define SYSMEM_ADDRESS (uint32_t)0x1FFF0000
64 #include "stm32l4xx.h"
66 #error "Target MCU header file is not defined or unsupported."
71 #define APP_SIZE (uint32_t)(((END_ADDRESS - APP_ADDRESS) + 3) / 4)
74 #define FLASH_PAGE_NBPERBANK (256)
77 #define RAM_BASE SRAM1_BASE
78 #define RAM_SIZE SRAM1_SIZE_MAX
uint8_t Bootloader_VerifyChecksum(void)
This function verifies the checksum of application located in flash. If USE_CHECKSUM configuration pa...
void Bootloader_JumpToSysMem(void)
This function performs the jump to the MCU System Memory (ST Bootloader).
uint8_t Bootloader_FlashBegin(void)
Begin flash programming: this function unlocks the flash and sets the data pointer to the start of ap...
uint8_t Bootloader_GetProtectionStatus(void)
This function returns the protection status of flash.
uint8_t Bootloader_CheckSize(uint32_t appsize)
This function checks whether the new application fits into flash.
uint8_t Bootloader_FlashEnd(void)
Finish flash programming: this function finalizes the flash programming by locking the flash.
uint8_t Bootloader_Init(void)
This function initializes bootloader and flash.
void Bootloader_JumpToApplication(void)
This function performs the jump to the user application in flash.
uint8_t Bootloader_Erase(void)
This function erases the user application area in flash.
uint8_t Bootloader_FlashNext(uint64_t data)
Program 64bit data into flash: this function writes an 8byte (64bit) data chunk into the flash and in...
uint8_t Bootloader_ConfigProtection(uint32_t protection)
This function configures the wirte protection of flash.
uint32_t Bootloader_GetVersion(void)
This function returns the version number of the bootloader library. Semantic versioning is used for n...
uint8_t Bootloader_CheckForApplication(void)
This function checks whether a valid application exists in flash. The check is performed by checking ...