bootloader.c 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /************************************************************************
  2. Project: Welling Motor Control Paltform
  3. Filename: bootloader.c
  4. Partner Filename: bootloader.h
  5. Description: The bootstrap program for using UART to download application program
  6. Complier: IAR Embedded Workbench for ARM 7.80.4
  7. CPU TYPE : GD32F3x0
  8. *************************************************************************
  9. Copyright (c) 2018 Welling Motor Technology(Shanghai) Co. Ltd.
  10. All rights reserved.
  11. *************************************************************************
  12. *************************************************************************
  13. Revising History (ECL of this file):
  14. ************************************************************************/
  15. /************************************************************************
  16. Beginning of File, do not put anything above here except notes
  17. Compiler Directives:
  18. ************************************************************************/
  19. #ifndef _BOOTLOADER_C_
  20. #define _BOOTLOADER_C_
  21. #endif
  22. /************************************************************************
  23. Include File
  24. ************************************************************************/
  25. #include "user.h"
  26. /************************************************************************
  27. Constant Table:
  28. ************************************************************************/
  29. /************************************************************************
  30. Exported Functions:
  31. ************************************************************************/
  32. /************************************************************************
  33. Function: void boot_voBootloader(void)
  34. Description:
  35. Call by:
  36. Input Variables:
  37. Output/Return Variables:
  38. Subroutine Call:
  39. Reference:
  40. ************************************************************************/
  41. //#ifdef BOOTLOADER
  42. // void boot_voBootloader(void)
  43. //{
  44. // uint32_t i = 0;
  45. // for(i = 0; i < 48; i++)
  46. // {
  47. // VectorTable[i] = *(__IO uint32_t*)(APPLICATION_ADDRESS + (i<<2));
  48. // }
  49. // /* Enable the SYSCFG peripheral clock*/
  50. // //RCC_APB2PeriphResetCmd(RCC_APB2Periph_SYSCFG, ENABLE);
  51. // //NVIC_SetVectorTable(NVIC_VectTab_RAM,0);
  52. // nvic_vector_table_set(NVIC_VECTTAB_RAM,0x0);
  53. // rcu_periph_reset_enable(RCU_CFGCMPRST);
  54. // /* Remap SRAM at 0x00000000 */
  55. // //SYSCFG_MemoryRemapConfig(SYSCFG_MemoryRemap_SRAM);
  56. // SYSCFG_CFG0 |= SYSCFG_CFG0_BOOT_MODE;
  57. //}
  58. //#endif
  59. ///************************************************************************
  60. // Local Functions: N/A
  61. //************************************************************************/
  62. //
  63. //
  64. ///************************************************************************
  65. // Copyright (c) 2018 Welling Motor Technology(Shanghai) Co. Ltd.
  66. // All rights reserved.
  67. /************************************************************************/
  68. #ifdef _BOOTLOADER_C_
  69. #undef _BOOTLOADER_C_ /* parasoft-suppress MISRA2004-19_6 "本项目中无法更改,后续避免使用" */
  70. #endif
  71. /************************************************************************
  72. End of this File (EOF)!
  73. Do not put anything after this part!
  74. ************************************************************************/