How to use global interrupts #53
-
Hi! I am trying to write a simple demo application to interact with UART interrupts using the baremetal library. Right now, to keep it as simple at possible I am only interacting with HART 0. If I use local interrupts on hart0 (i.e. using MSS_UART_enable_local_irq() on UART0) this simple program (https://hastebin.com/ucemunudik.cpp) works as expected, in the sense that if I type something on the keyboard from my UART output, the "hart0 MMUART0 local IRQ." is printed correctly. If I want to use interrupts via the PLIC (i.e. using MSS_UART_enable_irq() on UART0) instead the program (https://hastebin.com/aqodotenar.cpp) in not working, in the sense that the message which should be printed by MSS_UART_irq_tx() does not appear on the UART output, nor the input from the keyboard triggers the rx handler. Is there something else I am missing to be able to make it work? Thanks in advance!!! |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
Hey @fcuzzocrea have you also enabled the PLIC interrupts and set the interrupt priority for the UART you're using? Have a look at this example You can find IRQ names here in the mss_plic.h file. |
Beta Was this translation helpful? Give feedback.
-
Actually, sorry, this example is much better! |
Beta Was this translation helpful? Give feedback.
-
Thanks! I was missing to call PLIC_SetPriority() ! |
Beta Was this translation helpful? Give feedback.
-
If everything's working ok would you be able to mark the issue as closed? If you have any further issues on this please let me know :) |
Beta Was this translation helpful? Give feedback.
-
Yeah of course! Thanks for you help! |
Beta Was this translation helpful? Give feedback.
Actually, sorry, this example is much better!