From 8f100a83bca597d4a6c4aa0859a14d02b7b6adbd Mon Sep 17 00:00:00 2001 From: tyustli <1225613647@qq.com> Date: Mon, 21 Oct 2019 17:12:00 +0800 Subject: [PATCH] [bsp] [gd32vf103] explicit call clock init --- bsp/gd32vf103v-eval/board/board.c | 2 ++ .../libraries/n22/env_Eclipse/init.c | 18 +++++++----------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/bsp/gd32vf103v-eval/board/board.c b/bsp/gd32vf103v-eval/board/board.c index 5ddcccafa5..de2907c79b 100644 --- a/bsp/gd32vf103v-eval/board/board.c +++ b/bsp/gd32vf103v-eval/board/board.c @@ -48,6 +48,8 @@ void *__wrap_memset(void *s, int c, size_t n) } void rt_hw_board_init(void) { +extern void riscv_clock_init(void); + riscv_clock_init(); systick_config(TMR_FREQ / RT_TICK_PER_SECOND); #ifdef RT_USING_HEAP diff --git a/bsp/gd32vf103v-eval/libraries/n22/env_Eclipse/init.c b/bsp/gd32vf103v-eval/libraries/n22/env_Eclipse/init.c index ada05ba2c7..4a959cd9a6 100644 --- a/bsp/gd32vf103v-eval/libraries/n22/env_Eclipse/init.c +++ b/bsp/gd32vf103v-eval/libraries/n22/env_Eclipse/init.c @@ -7,6 +7,13 @@ #include "n22_func.h" void _init() { + +} + +void _fini() { +} + +void riscv_clock_init(void) { SystemInit(); //ECLIC init @@ -14,15 +21,4 @@ void _init() { eclic_mode_enable(); set_csr(mstatus, MSTATUS_MIE); - //printf("After ECLIC mode enabled, the mtvec value is %x \n\n\r", read_csr(mtvec)); - - // // It must be NOTED: - // // * In the RISC-V arch, if user mode and PMP supported, then by default if PMP is not configured - // // with valid entries, then user mode cannot access any memory, and cannot execute any instructions. - // // * So if switch to user-mode and still want to continue, then you must configure PMP first - //pmp_open_all_space(); - //switch_m2u_mode(); -} - -void _fini() { } -- GitLab