#ifndef __BOOTLOADER_H__ #define __BOOTLOADER_H__ #include "uds_config.h" #define BOOTLOADER_PROGRAMMING_FLAG 0xAA55BA5C #define BOOT_FlashBaseAddress 0x08000000 //FBL 驱动代码 #define APP_FlashBaseAddress 0x08008000 //APP 起始地址 #define APP_FlagAddress (APP_FlashBaseAddress+0x4000) //APP标志位地址 typedef enum { /* Generic error codes */ STATUS_SUCCESS = 0x000U, /*!< Generic operation success status */ STATUS_ERROR = 0x001U, /*!< Generic operation failure status */ STATUS_BUSY = 0x002U, /*!< Generic operation busy status */ STATUS_TIMEOUT = 0x003U, /*!< Generic operation timeout status */ } status_t; extern void JumpToApplicationSW(void); extern status_t EraseApplicationSoftwareCode(uint32_t address, uint32_t length); extern status_t ProgramApplicationSoftware(uint32_t address, uint8_t *pdata, uint32_t length); extern void BootloaderInit(void); extern uint8_t GetUdsUpdataFlag(void); void ClearExternProgrammingRequest(void); void SetExternProgrammingRequest(void); void SetBootloaderSwVersionAddress(void); uint32_t GetBootloaderSwVersionAddress(void); bool IsExternProgrammingRequestValid(void); #endif