2020-10-07 07:07 PM
Hello everyone!
I'm developing a firmware to capture video frame from a thermal camera.I was using a F4 chip.But due to the resolution and fps , I had to migrate to H7 (STM32H745).And now I'm having strage problems with the dcmi.
The dcmi start sucessfully and capture every frame but sorpresively the buffer start and finish with zeros, the rest is ok .Strangely the first 12 bytes and the lastes 20 bytes. Even if I put the D0 directly to the 3.3V !.In this case the rest of data is resposive and I can see that the DCMI is capturing well D0 .
In the begining I thought that was a VSYNC , problem but that makes no sense if I'm always putting the data 0 in high and still getting zeros :(.
Thanks in advance !
Following is more information:
Camera Info:
BSP Configuration:
... Clock enable
... GPIO configuration
hdma_handler.Init.Request = DMA_REQUEST_DCMI;
hdma_handler.Init.Direction = DMA_PERIPH_TO_MEMORY;
hdma_handler.Init.PeriphInc = DMA_PINC_DISABLE;
hdma_handler.Init.MemInc = DMA_MINC_ENABLE;
hdma_handler.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD;
hdma_handler.Init.MemDataAlignment = DMA_MDATAALIGN_WORD;
hdma_handler.Init.Mode = DMA_NORMAL;
hdma_handler.Init.Priority = DMA_PRIORITY_HIGH;
hdma_handler.Init.FIFOMode = DMA_FIFOMODE_ENABLE;
hdma_handler.Init.FIFOThreshold = DMA_FIFO_THRESHOLD_FULL;
hdma_handler.Init.MemBurst = DMA_MBURST_SINGLE;
hdma_handler.Init.PeriphBurst = DMA_PBURST_SINGLE;
hdma_handler.Instance = DMA2_Stream3;
DCMI Init:
hdcmi.Instance = DCMI;
hdcmi.Init.SynchroMode = DCMI_SYNCHRO_HARDWARE;
hdcmi.Init.PCKPolarity = DCMI_PCKPOLARITY_FALLING;
hdcmi.Init.VSPolarity = DCMI_VSPOLARITY_LOW;
hdcmi.Init.HSPolarity = DCMI_HSPOLARITY_LOW;
hdcmi.Init.CaptureRate = DCMI_CR_ALL_FRAME;
hdcmi.Init.ExtendedDataMode = DCMI_EXTEND_DATA_8B;
hdcmi.Init.JPEGMode = DCMI_JPEG_DISABLE;
hdcmi.Init.ByteSelectMode = DCMI_BSM_ALL;
hdcmi.Init.ByteSelectStart = DCMI_OEBS_ODD;
hdcmi.Init.LineSelectMode = DCMI_LSM_ALL;
hdcmi.Init.LineSelectStart = DCMI_OELS_ODD;
And finally to start the capturing :
HAL_DCMI_Start_DMA(&hdcmi, DCMI_MODE_CONTINUOUS,
(uint32_t) &frame_byte_buffer[0], (uint32_t) 3200)
I used 3200 ,suposing that the transferring is four by four byte
2020-10-08 12:23 PM
Hello Again!
I feel disappointed :( .I tried disabling the CACHE and now it works.But I need the cache enabled to accelerate the image processing.What can I do ? .I was reading several issues about the cache , but no for the same peripheral .
Thanks , I'll be attentive for any reply!