diff --git a/arch/risc-v/common/tos_cpu.c b/arch/risc-v/common/tos_cpu.c
index 6edd6079..311396f2 100644
--- a/arch/risc-v/common/tos_cpu.c
+++ b/arch/risc-v/common/tos_cpu.c
@@ -99,6 +99,10 @@ __KERNEL__ k_stack_t *cpu_task_stk_init(void *entry,
#undef _V
}
+ cpu_data_t gp;
+ asm("mv %0, gp"::"r"(gp));
+
+ regs->gp = (cpu_data_t)gp; // gp: global pointer
regs->a0 = (cpu_data_t)arg; // a0: argument
regs->ra = (cpu_data_t)0xACE00ACE; // ra: return address
regs->mstatus = (cpu_data_t)(MSTATUS_MPP | MSTATUS_MPIE); // return to machine mode and enable interrupt
diff --git a/board/GD32VF103C_START/eclipse/hello_world/.cproject b/board/GD32VF103C_START/eclipse/hello_world/.cproject
index 10165b10..c4535ca2 100644
--- a/board/GD32VF103C_START/eclipse/hello_world/.cproject
+++ b/board/GD32VF103C_START/eclipse/hello_world/.cproject
@@ -175,7 +175,7 @@
-
+