From bf3475d369e4d240f80555d727f3694c5df7e1cb Mon Sep 17 00:00:00 2001 From: Lee Lup Yuen Date: Fri, 28 Jul 2023 18:40:05 +0800 Subject: [PATCH] Debug Exception --- arch/risc-v/src/common/riscv_exception_common.S | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/risc-v/src/common/riscv_exception_common.S b/arch/risc-v/src/common/riscv_exception_common.S index 1f1180d46b307..b29c7121cb20c 100644 --- a/arch/risc-v/src/common/riscv_exception_common.S +++ b/arch/risc-v/src/common/riscv_exception_common.S @@ -75,6 +75,14 @@ .align 8 exception_common: + /* Begin Debug */ + /* Load UART Base Address to Register t0 */ + li t0, 0x10000000 + /* Load `#` to Register t1 */ + li t1, 0x23 + /* Store byte from Register t1 to UART Base Address, Offset 0 */ + sb t1, 0(t0) + /* End Debug */ #ifdef CONFIG_ARCH_KERNEL_STACK /* Take the kernel stack into use */