Explorar el Código

[fix] 使能GD32H7 I/D Cache,移除Systick重复配置代码

MuChenger hace 3 meses
padre
commit
233cbaa974

+ 6 - 1
bsp/gd32/arm/gd32h759i-eval/board/board.c

@@ -32,7 +32,6 @@ void Error_Handler(void)
 void SystemClock_Config(void)
 {
     SysTick_Config(SystemCoreClock / RT_TICK_PER_SECOND);
-    NVIC_SetPriority(SysTick_IRQn, 0);
 }
 
 /**
@@ -65,6 +64,12 @@ void rt_hw_board_init()
     SCB->VTOR  = (0x08000000 & NVIC_VTOR_MASK);
 #endif
 
+    /* Enable IChace */
+    rt_hw_cpu_icache_enable();
+
+    /* Enable DChace */
+    rt_hw_cpu_dcache_enable();
+
     SystemClock_Config();
 
 #ifdef RT_USING_SERIAL

+ 6 - 1
bsp/gd32/arm/gd32h759i-start/board/board.c

@@ -32,7 +32,6 @@ void Error_Handler(void)
 void SystemClock_Config(void)
 {
     SysTick_Config(SystemCoreClock / RT_TICK_PER_SECOND);
-    NVIC_SetPriority(SysTick_IRQn, 0);
 }
 
 /**
@@ -65,6 +64,12 @@ void rt_hw_board_init()
     SCB->VTOR  = (0x08000000 & NVIC_VTOR_MASK);
 #endif
 
+    /* Enable IChace */
+    rt_hw_cpu_icache_enable();
+
+    /* Enable DChace */
+    rt_hw_cpu_dcache_enable();
+
     SystemClock_Config();
 
 #ifdef RT_USING_SERIAL