Interrupt handling problem - Printable Version +- PULP Community (https://pulp-platform.org/community) +-- Forum: PULP's Community forum (https://pulp-platform.org/community/forumdisplay.php?fid=1) +--- Forum: PULP General questions (https://pulp-platform.org/community/forumdisplay.php?fid=2) +--- Thread: Interrupt handling problem (/showthread.php?tid=227) |
Interrupt handling problem - nikolas - 01-05-2021 Hi there I have a question about the interrupt handling of a PULPissimo with a RI5CY core. The thing is, I am able to generate timer interrupts as long as I use the rt_api.h file and the functions, that are implemented there. Everything works fine then. It would be very nice now, if it is possible to write my own functions. So I took the PULPissimo datasheet and started to set the right registers. For testing reasons I want to generate interrupts from one of the APB Timers, jump into a callback function and toggle an LED. But that does not happen. The program jumps once into the callback function but after never again. If I debug and set a breakpoint in the callback function, this breakpoint will never be reached twice. Also tested the timer if everything works there as expected and it looks like the timer is fine. And in the interrupt pending register the correct bit is set but it does not jump. My question now is, is there something else, maybe an other register or something, that I have to clear or set? Maybe I did not understand the interrupt handling right? Would be nice if someone can help me here. Code: /*============================================================================================================================= If it helps to understand my problem, here is the little test application I would like to run. The functions, that I wrote do not much more than setting the right bits of the right registers. Thank you very much and wish you all a nice evening RE: Interrupt handling problem - nikolas - 01-06-2021 OK found the problem. I did not realize that the core disables the interrupt automatically if the program jumps to the ISR. Found the way to reset the Machine interrupt enable flag in the mstatus register inside my ISR and everything works fine now. RE: Interrupt handling problem - RiscV - 03-04-2021 (01-06-2021, 09:59 AM)nikolas Wrote: OK found the problem. I did not realize that the core disables the interrupt automatically if the program jumps to the ISR. Hi Nikolas, It will be better to post that working code. RE: Interrupt handling problem - nikolas - 03-04-2021 (03-04-2021, 06:32 AM)RiscV Wrote:(01-06-2021, 09:59 AM)nikolas Wrote: OK found the problem. I did not realize that the core disables the interrupt automatically if the program jumps to the ISR. Sorry my fault, was not thinking about that but should be obvious . I made a little repository with the working code that can be found here: https://gitlab.com/d_maurer/pulpissimo_timer_interrupt_testing.git Hope it is usefull for someone and again sorry . |