Hello, I am trying to handle local interrupts.
That’s what I do, in my handler for timer interrupts:
- disable timer interrupts in mie
- read a current value from mtime
- copy it to mtimecmp (both are 64bit width types)
- add some big value to mtimecmp
- enable timer interrupts in mie.
And I have two boards and the problem is that on one of them interrupts are permanently generated because mip register is always 1 in mtip position, though mtimecmp is greater than mtime, and are not generated at all on the other.
In this piece of code, I turn on interrupts:
la t0, RISCV_Exception_default
csrs mtvec, t0
li t0, 0x88
csrs mie, t0
csrsi mstatus, 0x8