Page 1 of 1

ESP32C3 - Bare metal - Can not use interrupt

Posted: Wed Jun 21, 2023 10:11 am
by minhnd
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

Re: ESP32C3 - Bare metal - Can not use interrupt

Posted: Sat Jan 20, 2024 9:14 pm
by JohnnyZ
Did you managed to fix it?
I am also trying to use interrupt (USB JTAG UART RX) on the ESP32-C3, also unsuccessful.

Re: ESP32C3 - Bare metal - Can not use interrupt

Posted: Sun Jan 21, 2024 12:53 pm
by minhnd
No, I have to give up and change to Blue pill.