MP Timer interrupt hanging #10865
-
A while ago I posted a question on getting the address of a function (#10780) to implement an ISR in MP. I huge thank you to @rkompass for the Below is my attempt of doing it. Unfortunately, it does not work as intended. The interrupt is generated but, once it occurrs, MP just hangs. In the test code, I programmed the alarm to occur after 3 seconds. Once I run the Any idea of what I could be missing? Below is the class that installs the ISR. The
The test is based on this example:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I am closing this thread. After several trial and error tests, I am throwing the towel, so to speak. I could not find the cause of the hang. One possibility that occurred to me was the hang has to do with an exception beeing thrown by the memory protection of the Cortex-M0+ core. I suppose interrupts run in privileged mode whereas the regular code, Micropython included run in user mode. I am not sure about it though. Another possibility (more probable) is the ISR coded with Viper is lacking something that the C version has that is essential for it to work correctly. It is not clear to me, though, looking at the source codes of the SDK and timer.c of the examples what exactly it could be. I tried just lighting the onboard LED to see if at least the Viper function was called and nothing. I decided to pursue a different approach. I will try to extend the Pico's/RP2's Timer class to support hard-interrupts. |
Beta Was this translation helpful? Give feedback.
I am closing this thread.
After several trial and error tests, I am throwing the towel, so to speak.
I could not find the cause of the hang. One possibility that occurred to me was the hang has to do with an exception beeing thrown by the memory protection of the Cortex-M0+ core. I suppose interrupts run in privileged mode whereas the regular code, Micropython included run in user mode. I am not sure about it though.
Another possibility (more probable) is the ISR coded with Viper is lacking something that the C version has that is essential for it to work correctly. It is not clear to me, though, looking at the source codes of the SDK and timer.c of the examples what exactly it could be. …