remapVector.c 742 B

12345678910111213141516171819202122
  1. /********************************************************************************
  2. * File Name: remapVector.c
  3. * Function Describe:Remapping the vector table
  4. * Relate Module:
  5. * Explain: Hardware version is HS121
  6. * Writer: wjl
  7. * Date: 2016.10.01
  8. *******************************************************************************/
  9. #include "includes.h"
  10. #define VECTOR_NUMBER 48
  11. void AppRemap_Vector(void)
  12. {
  13. uint8_t i = 0;
  14. for(i = 0; i < VECTOR_NUMBER; i++)
  15. *((uint32_t*)(SRAM_BASE + (i << 2)))=*(__IO uint32_t*)(FLASH_APP_ADDR + (i<<2));
  16. /* Enable the SYSCFG peripheral clock*/
  17. RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE);
  18. /* Remap SRAM at 0x00000000 */
  19. SYSCFG_MemoryRemapConfig(SYSCFG_MemoryRemap_SRAM);
  20. }