UDSTask.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 0x2000EFF0u
  13. #define REQUEST_ENTER_BOOTLOADER_ADDR 0x2000EFF1u
  14. #define DOWNLOAD_APP_SUCCESSFUL_ADDR 0x2000EFF0u
  15. #define EN_CRC_SOFTWARE /* Enable CRC module with software */
  16. /* TODO Bootloader: #01 CAN RX and TX message ID Configuration */
  17. #if defined (CAN1_MSG_TYPE)
  18. #if (CAN1_MSG_TYPE == CAN_MSG_STANDARD)
  19. #define RX_FUN_ADDR_ID (0x7BFu) /* FuncReq - CAN TP RX function ID */
  20. #define RX_PHY_ADDR_ID (0x7A0u) /* PhysReq - CAN TP RX physical ID */
  21. #define TX_RESP_ADDR_ID (0x7A8u) /* PhysResp - CAN TP TX physical ID */
  22. #elif (CAN1_MSG_TYPE == CAN_MSG_EXTENDED)
  23. #define RX_FUN_ADDR_ID (0x18DA55FFu) /* FuncReq - CAN TP RX function ID */
  24. #define RX_PHY_ADDR_ID (0x18DA5535u) /* PhysReq - CAN TP RX physical ID */
  25. #define TX_RESP_ADDR_ID (0x18DA3555u) /* PhysResp - CAN TP TX physical ID */
  26. #endif
  27. #else
  28. #error "please define the CAN MSG Type of can1"
  29. #endif
  30. void RequestEnterBootloader(void);
  31. boolean IsJumptoBootloader(uint32 CanID, uint8 Data[]);
  32. void DoRoutinePositiveAnswer(void);
  33. boolean Boot_CheckDownlaodAPPStatus(void);
  34. #endif /* UDSTASK_H_ */