diff --git a/arch/risc-v/src/mpfs/mpfs_head.S b/arch/risc-v/src/mpfs/mpfs_head.S index e6eb6fc8fb3d0..d4e168762f08b 100644 --- a/arch/risc-v/src/mpfs/mpfs_head.S +++ b/arch/risc-v/src/mpfs/mpfs_head.S @@ -184,7 +184,8 @@ __start: /* Set stack pointer to the idle thread stack */ - riscv_set_inital_sp MPFS_IDLESTACK_BASE, SMP_STACK_SIZE, a0 + addi a1, a0, -1 + riscv_set_inital_sp MPFS_IDLESTACK_BASE, SMP_STACK_SIZE, a1 /* Jump to __mpfs_start with mhartid in a0 */