RISCV - how to install interrupt handler?

I’m following the instructions here, which say that for GCC I should use -DportasmHANDLE_INTERRUPT=external_interrupt_handler. I don’t see portasmHANDLE_INTERRUPT anywhere in the FreeRTOS Kernel source (V11.1.0).

What I do see in portASM.S is a weak symbol freertos_risc_v_application_interrupt_handler - is this what I should be defining in my code?

(you’ll gather from this that I’m actually having trouble generating interrupts at all on this ESP32-H2 chip, but that’s not your problem!)

This is how you are supposed to install interrupt handler - FreeRTOS/FreeRTOS/Demo/RISC-V_RV32_SiFive_HiFive1-RevB_IAR/main.c at main · FreeRTOS/FreeRTOS · GitHub.

Those instructions are outdated. We will fix those. Thank you brining it to our attention.

Sorry, but the link you gave tells how to install the trap handler; I’ve already done that, and that section of the document is OK.

If you look down to line 300 there’s a function freertos_risc_v_application_interrupt_handler() which defines the strong version of the symbol I noted above, and that’s what the trap handler calls eventually, and that’s what users need to provide.

If people are defining the interrupt handler in C++, they’ll need to take measures to ensure the right symbol is generated (external (C) {...}, I think?)

Apologies. You are exactly right.

Yes, that is right.