Performing mathematics on data in SRAM while DMA is coping data from DCMI at maximum speed.
Hello, I am making a sensor that uses a camera, and I would like to perform a simple mathematical operation on image data while it is still reading out.
My algorithm is very linear and does not need all data, so in theory, I should be able to do that.
(in FPGA it is extraordinary simple to do in real time)
My main concern is that I will be loading AHB bus while DMA is copying data from DCMI to SRAM. If I set DMA with highest priority, as far as I understand I could get DMA overrun, since ARM core access priority is larger than DMA?
Original idea is to use HSYNC interrupt to count lines, and when I get a new line copied, I could start to do mathematical operations to that line in SRAM, while DMA will be copying the second line. I also get a bit of horizontal blanking time in which DMA is idling.
My Cortex-M33 will be running at 160MHz, and camera will be running at 60MHz
(theoretical maximum is 64MHz (Frequency ratio DCMI_PIXCLK/f HCLK = 0.4). I am also running 10b of data, meaning DMA FIFO will be capturing 2 pixels for a single DMA transfer, effective frequency will be 32MHz. (word is 32b, and 10b is half a word, so 2x packing)
Any advice on how I can make this work ? Hardware is still under way, so I have no way of testing how it works, and if I get corrupted data.