How to use IRQ and dma from user C module? #17602
boognevatz
started this conversation in
General
Replies: 1 comment
-
This is quite low level stuff. I recommend attaching a debugger and stepping through the problematic function, see when it fails, and what state of registers etc are at that point. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hardware: RP2350 with 2" LCD and OV5640 camera.
Goal: Display the camera image on the LCD in realtime, without delay (using DMA and IRQ), using MicroPython where both the LCD driver and camera driver are C modules.
Here is a C demo program, which achieve the above.
I ported the LCD driver to a MicroPython C module, and I'm stuck porting the camera driver (hence this post:)
Here is the work-in-progress repository, feel free to check it out.
After flashing the board, I can issue the followings:
This is the relevant code snippet where it fails:
It fails at the
irq_set_exclusive_handler(DMA_IRQ_0, cam_handler);
line."Fails" means the MicroPython REPL fails to return; I cannot type in it anymore and need to hardware reboot the device.
So I'm looking for some guidance on how to use IRQ (and DMA) from a C module.
The goal is to put the camera frame to the LCD using IRQ + DMA, with minimal software. This is crucial for realtime behavior.
In the demo C program, there is practically no delay between the camera and the displayed image on the LCD if I move the device around in the room.
Any help is much appreciated.
Here is the compiled .uf2 micropython firmware file (416kB .uf2.zip), just in case.
Beta Was this translation helpful? Give feedback.
All reactions