SAM V71 Xplained ISI DMA transfer terminated signal

Discussions around product based on ARM Cortex M7 core.

Moderator: nferre

lstark
Posts: 2
Joined: Mon Jul 27, 2015 9:08 pm

SAM V71 Xplained ISI DMA transfer terminated signal

Thu Aug 13, 2015 7:27 pm

We are implementing an image capture on the SAM V71 Xplained development board. We are using the sama53dx example to guide us. We have successfully initialized the camera using TWI and ISI and are at the point of capturing an image using ISI. The code gets stuck waiting for the DMA transfer terminated signal (ISI_SR_CXFR_DONE). We have used a scope to see data coming from the camera and have seen data using the AtmelStudio debugger in the SRAM image data location. We just can't get the final DMA transfer complete signal.

Has anyone successfully used ISI on the SAM V71 Xplained board? Atmel support is still working on app notes for ISI on this board. Code for image capture shown below. An assistance would be greatly appreciated!

Code: Select all

ISI->ISI_DMA_CHDR |= ISI_DMA_CHDR_P_CH_DIS;
ISI->ISI_DMA_CHER |= ISI_DMA_CHER_C_CH_EN;
for (delay = 0; delay < 0xffff; delay++);
ISI->ISI_CR |= ISI_CR_ISI_CDC;
while(( ISI->ISI_SR & ISI_SR_CDC_PND) != ISI_SR_CDC_PND);

while(( ISI->ISI_SR & ISI_SR_CXFR_DONE) != ISI_SR_CXFR_DONE);   // CAUSING INFINITE LOOP

for (delay = 0; delay < 0x5ffff; delay++);
blue_z
Location: USA
Posts: 1496
Joined: Thu Apr 19, 2007 10:15 pm

Re: SAM V71 Xplained ISI DMA transfer terminated signal

Thu Aug 13, 2015 8:20 pm

You need to pay better attention to the datasheet (and code accordingly).
Eight status conditions (including the CXFR_DONE that your code is waiting on) in the ISI_SR register are cleared when the register is read.
That means your code has only one (1) chance of detecting the occurrence of CXFR_DONE being set, since your code never saves the value that was read from the status register and always fetches a fresh value.

IOW if CXFR_DONE is set prior to or at the same time as CDC_PND is set, or if an ISR could also read the ISI_SR and compete with the second while loop, then it's very easy to explain the behavior that you report.

Regards
lstark
Posts: 2
Joined: Mon Jul 27, 2015 9:08 pm

Re: SAM V71 Xplained ISI DMA transfer terminated signal

Thu Aug 13, 2015 8:43 pm

Thanks for the quick reply. Your suggestion worked! We had put in a variable for the loop, having actually read the datasheet to see the read clears the bits... but we only mistakenly put it around the second while loop since the first while loop was happy. We removed the variable save code to go back to following the exact steps the sama53dx code was taking. Not quite sure how their code was working, but your suggestion has gotten on to our next step in the program. Thanks again!

Return to “SAM Cortex-M7 MCU”

Who is online

Users browsing this forum: No registered users and 1 guest