AnsweredAssumed Answered

RT1020 FlexIO Camera Demo - DMA Speed

Question asked by variable_andrew on Oct 10, 2019
Latest reply on Oct 18, 2019 by Kerry Zhou

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:


void FLEXIO_StartNewLine(void) {
    if (rowIndex >= AS0330_FRAME_HEIGHT){
        //reset "row index" - really becoming mod_row
        rowIndex = 0;

        //update DMA pointer to start of rx buffer
        DMA0->TCD[FLEXIO_CAMERA_DMA_CHN].DADDR = (uint32_t)pFlexioCameraFrameBuffer;
    }
    /* Enable DMA channel request. */
    DMA0->SERQ = DMA_SERQ_SERQ(FLEXIO_CAMERA_DMA_CHN);
}

 

void FLEXIO_EndLine(void) {
    FLEXIO_CAMERA_ClearStatusFlags(&s_FlexioCameraDevice, kFLEXIO_CAMERA_RxDataRegFullFlag | kFLEXIO_CAMERA_RxErrorFlag);
    if (frameIndex < 1000){
        linesPerFrame[frameIndex]++;
    }
    rowIndex++;
    totalFrameRowIndex++;

}

 

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?

Outcomes