ESP32C3 - Bare metal - Can not use interrupt
Posted: Wed Jun 21, 2023 10:11 am
I am trying to construct bare metal programs for ESP32C3. I setup interrupt routines as guided in RISCV documents. All registers (mtvec, mstatus interrupt enable, ...) are setup. I also use the ROM-based function intr_matrix_set to map interrupts from sources to CPU interrupts. However, when I tried to raise a CPU interrupt by setting the register SYSTEM_CPU_INTR_FROM_CPU_0_REG. The register INTERRUPT_CORE0_INTR_STATUS_0_REG reflected that the interrupt appeared. However the interrupt routine is not called.
When I used the asm instruction "ecall", the exception was raised and the exception handler is called as expected.
Is there anybody successfully using interrupts in bare metal programs? Could you please give me some hint to debug that.
Thank you in advance.
Minh
PS: Attached is my code
When I used the asm instruction "ecall", the exception was raised and the exception handler is called as expected.
Is there anybody successfully using interrupts in bare metal programs? Could you please give me some hint to debug that.
Thank you in advance.
Minh
PS: Attached is my code