I've modified the RT1020 camera demo to interrupt on every horizontal instead of every frame.
Even if I don't save all my data, and just put a simple row counter to count the number of interrupts I get, it appears that I don't get every row.
Ie - I set the sensor up to send 432 rows of 768 pixels per frame.
I see on the DLA, that the expected data is being sent to the RT1021.
But the RT1021 only gets around 135 to 280 of these row interrupts.
Here is the only code happening in the DMA ISR:
I see every frame has the same # of rows (sometimes the 1st frame has one less).
As the code is "working" (getting the row interrupts, etc), just missing a weird number of the rows, it almost seems like the DMA isn't fast enough to process the FlexIO data with interrupts?
While I'm basing my code off the RT1020 Flexio Camera demo - I used the standard SDK project's clock config from MCUXpresso w/ just the flexIO regs updated (I didn't see anything DMA specific) .
Is the default MCUXpresso SDK (2.6.1) clock setup w/r/t DMA not adequate for pixel data speeds?
Solved! Go to Solution.
Hi variable_andrew,
Thanks a lot for your detail frequency information.
Today, I help you to check your question with our CSI expert, he told me that: Your 49Mhz is too high, and the FlexIO can't support it, from theory, the PCLK can support upto 20Mhz, so maybe you can try 20Mhz or smaller case.
If you still have questions about it, please kindly let me know.
Have a great day,
Kerry
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
any thoughts?
maybe Hui_Ma or others?
Hi variable_andrew,
Sorry for our later reply, because a lot of cases in the queue.
I will help you to check it from our internal side, please keep patient, any updated information, I will let you know.
Thanks a lot for your understanding.
Kerry
After looking thru the clock code - it appears that eDMA is set to run at 500MHz and the FlexIO is set (same as the demo) to run at 120MHz, and according to the clock config tool - it appears this might be where the FlexIO maxes out?
Can you confirm?
Also - let me know about any other ideas for missed data from the FlexIO/DMA?
(side question: at what point are you able to post w/o needing moderation for every single post?)
By slowing down the camera to an extremely slow pixel-rate, FlexIO was able to keep up without dropping any rows in a frame.
Since by slowing down the FlexIO trigger for the timers - this works - does that mean the FlexIO isn't fast enough to keep up with the camera? (FlexIO maxed at 120MHz).
Is the timer for FlexIO running on the flexIO clock or something else? Would speeding that up help?
Hi variable_andrew,
Sorry for my later reply.
You said, when your slow down the camera to an extremely slow pixel-rate, then the FlexIO without dropping the data. Could you tell me the detail pixel-rate? What's the pixel-rate you will meet the data drop problems?
Best Regards,
Kerry
Hi kerryzhou,
I have a camera that provides 2304 pixels by 1296 rows for a single frame.
This - at any slowed data rate, seems impossible for the RT1021, so I've subdivided rows and pixels by 3, so we have:
432 rows of 768 pixels.
A single pixel is 12 bits.
In order for the RT1021 to actually capture all the data via FlexIO (set to 120MHz), using DMA with major loop set to a single row.
The default pixel clk rate is 49MHz - frame time/ row time is shown in the imgs below:
def frame valid time - 25ms
default line (row) valid time (18us):
To get this to work, I had to update the camera's pixel clk to 9 MHz - here is the current captures w/ all the pixels getting captured:
Frame valid time - 0.97 seconds..
line (row) valid time (0.1ms with time between rows going from 61us to 2.24ms ):
Hi variable_andrew,
Thanks a lot for your detail frequency information.
Today, I help you to check your question with our CSI expert, he told me that: Your 49Mhz is too high, and the FlexIO can't support it, from theory, the PCLK can support upto 20Mhz, so maybe you can try 20Mhz or smaller case.
If you still have questions about it, please kindly let me know.
Have a great day,
Kerry
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
got it - thanks kerryzhou
You are welcome!
If you have the new question in the future, welcome to create the new question post.
Have a great day,
Kerry
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------