ESP32C3 - Bare metal - Can not use interrupt

minhnd
Posts: 2
Joined: Wed Jun 21, 2023 9:54 am

ESP32C3 - Bare metal - Can not use interrupt

Postby minhnd » 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
Attachments
vector_table.h
(5.05 KiB) Downloaded 253 times
vector_table.c
(8.47 KiB) Downloaded 239 times
main.c
(5.42 KiB) Downloaded 274 times

JohnnyZ
Posts: 8
Joined: Thu Jan 11, 2024 10:24 am

Re: ESP32C3 - Bare metal - Can not use interrupt

Postby JohnnyZ » Sat Jan 20, 2024 9:14 pm

Did you managed to fix it?
I am also trying to use interrupt (USB JTAG UART RX) on the ESP32-C3, also unsuccessful.

minhnd
Posts: 2
Joined: Wed Jun 21, 2023 9:54 am

Re: ESP32C3 - Bare metal - Can not use interrupt

Postby minhnd » Sun Jan 21, 2024 12:53 pm

No, I have to give up and change to Blue pill.

Who is online

Users browsing this forum: No registered users and 80 guests