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 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
#define APP_FlashBaseAddress 0x08008000 //APP <20><>ʼ<EFBFBD><CABC>ַ
|
|||
|
#define APP_FlagAddress (APP_FlashBaseAddress+0x4000) //APP<50><50>־λ<D6BE><CEBB>ַ
|
|||
|
|
|||
|
|
|||
|
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
|