[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Sample Baremetal program with Interrupt

From: vijayvithal jahagirdar
Subject: Sample Baremetal program with Interrupt
Date: Fri, 5 Feb 2021 03:12:41 +0530

I am extending hw/riscv/virt.c to model some custom hardware.
At some point in the code, I am calling
I was expecting this to trigger the corresponding routine in my baremetal program. But the routine was not triggered.

Is there a reference  baremetal program with interrupt for qemu+riscv that I can use as a reference to debug my code??
Is  qemu_irq_raise(s->irq); correct & complete method for raising an Interrupt?
Note: As a part of the debug process, I tried the following:
uint64_t mie_reg;
mie_reg = read_csr(mie);
 mie_reg = mie_reg | 0x0000000000000800;
write_csr(mie, mie_reg);
 mie_reg = read_csr(mie);
printf(" mie_reg after write_csr fun %lx  \n",mie_reg);

I was expecting the print to return 0x800, but it returned 0x00, I am not sure what next steps I should take to debug this.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]