1e7070334c
Signed-off-by: lidun <1084178170@qq.com>
40 lines
1.4 KiB
C
40 lines
1.4 KiB
C
#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
|