bootloader.c 400 B

123456789101112131415161718
  1. #include "global.h"
  2. u8 boot_goto_app(u32 addr)
  3. {
  4. pFunction Jump_To_Application;
  5. __IO u32 JumpAddress;
  6. CAN_DeInit(CAN1);
  7. if (((*(__IO u32 *)addr) & 0x2FFE0000) == 0x20000000)
  8. {
  9. JumpAddress = *(__IO u32 *)(addr + 4);
  10. Jump_To_Application = (pFunction)JumpAddress;
  11. __set_MSP(*(__IO u32 *)addr);
  12. Jump_To_Application();
  13. }
  14. return 1;
  15. }