bootloader.c 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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 "syspar.h"
  26. #include "user.h"
  27. /************************************************************************
  28. Constant Table:
  29. ************************************************************************/
  30. /************************************************************************
  31. Exported Functions:
  32. ************************************************************************/
  33. /************************************************************************
  34. Function: void boot_voBootloader(void)
  35. Description:
  36. Call by:
  37. Input Variables:
  38. Output/Return Variables:
  39. Subroutine Call:
  40. Reference:
  41. ************************************************************************/
  42. //#ifdef BOOTLOADER
  43. // void boot_voBootloader(void)
  44. //{
  45. // uint32_t i = 0;
  46. // for(i = 0; i < 48; i++)
  47. // {
  48. // VectorTable[i] = *(__IO uint32_t*)(APPLICATION_ADDRESS + (i<<2));
  49. // }
  50. // /* Enable the SYSCFG peripheral clock*/
  51. // //RCC_APB2PeriphResetCmd(RCC_APB2Periph_SYSCFG, ENABLE);
  52. // //NVIC_SetVectorTable(NVIC_VectTab_RAM,0);
  53. // nvic_vector_table_set(NVIC_VECTTAB_RAM,0x0);
  54. // rcu_periph_reset_enable(RCU_CFGCMPRST);
  55. // /* Remap SRAM at 0x00000000 */
  56. // //SYSCFG_MemoryRemapConfig(SYSCFG_MemoryRemap_SRAM);
  57. // SYSCFG_CFG0 |= SYSCFG_CFG0_BOOT_MODE;
  58. //}
  59. //#endif
  60. ///************************************************************************
  61. // Local Functions: N/A
  62. //************************************************************************/
  63. //
  64. //
  65. ///************************************************************************
  66. // Copyright (c) 2018 Welling Motor Technology(Shanghai) Co. Ltd.
  67. // All rights reserved.
  68. /************************************************************************/
  69. #ifdef _BOOTLOADER_C_
  70. #undef _BOOTLOADER_C_
  71. #endif
  72. /************************************************************************
  73. End of this File (EOF)!
  74. Do not put anything after this part!
  75. ************************************************************************/