UDSTask.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * UDSTask.h
  3. *
  4. * Created on: 2022Äê3ÔÂ14ÈÕ
  5. * Author: Zhengchao
  6. */
  7. #ifndef UDSTASK_H_
  8. #define UDSTASK_H_
  9. #include "PlatformTypes.h"
  10. #include "hal_adapter.h"
  11. #include "USER_CONFIG.h"
  12. #define INFO_START_ADDR 0x20006FF0u
  13. #define REQUEST_ENTER_BOOTLOADER_ADDR 0x20006FF1u
  14. #define DOWNLOAD_APP_SUCCESSFUL_ADDR 0x20006FF0u
  15. #define EN_CRC_SOFTWARE /* Enable CRC module with software */
  16. //#define USE_CAN_EXT_ID
  17. /* TODO Bootloader: #01 CAN RX and TX message ID Configuration */
  18. #if defined (CAN0_MSG_TYPE)
  19. #if (CAN0_MSG_TYPE == CAN_MSG_STANDARD)
  20. #define RX_FUN_ADDR_ID (0x7BFu) /* FuncReq - CAN TP RX function ID */
  21. #define RX_PHY_ADDR_ID (0x7A1u) /* PhysReq - CAN TP RX physical ID */
  22. #define TX_RESP_ADDR_ID (0x7A9u) /* PhysResp - CAN TP TX physical ID */
  23. #elif (CAN0_MSG_TYPE == CAN_MSG_EXTENDED)
  24. #define RX_FUN_ADDR_ID (0x18DA55FFu) /* FuncReq - CAN TP RX function ID */
  25. #define RX_PHY_ADDR_ID (0x18DA5536u) /* PhysReq - CAN TP RX physical ID */
  26. #define TX_RESP_ADDR_ID (0x18DA3655u) /* PhysResp - CAN TP TX physical ID */
  27. #endif
  28. #else
  29. #error "please define the CAN MSG Type of can0"
  30. #endif
  31. void RequestEnterBootloader(void);
  32. boolean IsJumptoBootloader(uint32 CanID, uint8 Data[]);
  33. void DoRoutinePositiveAnswer(void);
  34. boolean Boot_CheckDownlaodAPPStatus(void);
  35. #endif /* UDSTASK_H_ */