How can I save the image from camra to usb memory directly without LCD?
Hi
I am working on an stm32f4x9i evaluation board.
I want to save camera images in USB memory without LCD.
Of course, I had worked the example shows how to display the camera image on the LCD and save it in memory.
However, the final goal is to save camera images directly to memory without the LCD.
I tried several things with DMA2D, but it failed to file writing.
static void PicturePrepare(void)
{
static DMA2D_HandleTypeDef hdma2d_eval;
uint32_t address1 = CONVERTED_FRAME_BUFFER;
uint32_t address2 = CAMERA_FRAME_BUFFER;
uint32_t index = 0;
/* Configure the DMA2D Mode, Color Mode and output offset */
hdma2d_eval.Init.Mode = DMA2D_M2M_PFC;
hdma2d_eval.Init.ColorMode = DMA2D_RGB888;
hdma2d_eval.Init.OutputOffset = 0;
/* Foreground Configuration */
hdma2d_eval.LayerCfg[1].AlphaMode = DMA2D_NO_MODIF_ALPHA;
hdma2d_eval.LayerCfg[1].InputAlpha = 0xFF;
hdma2d_eval.LayerCfg[1].InputColorMode = DMA2D_INPUT_RGB565;
hdma2d_eval.LayerCfg[1].InputOffset = 0;
hdma2d_eval.Instance = DMA2D;
/* Go to the end of the bitmap file address */
address2 += ((BSP_LCD_GetXSize() * (BSP_LCD_GetYSize() - 1)) * 4);
/* Convert picture to RGB888 pixel format */
for(index = 0; index < (BSP_LCD_GetYSize()); index++)
{
/* DMA2D Initialization */
if(HAL_DMA2D_Init(&hdma2d_eval) == HAL_OK)
{
if(HAL_DMA2D_ConfigLayer(&hdma2d_eval, 1) == HAL_OK)
{
if (HAL_DMA2D_Start(&hdma2d_eval, address2, address1, (BSP_LCD_GetXSize()), 1) == HAL_OK)
{
/* Polling For DMA transfer */
HAL_DMA2D_PollForTransfer(&hdma2d_eval, 10);
}
}
}
/* Increment the source and destination buffers */
address1 += ((BSP_LCD_GetXSize())*3);
address2 -= BSP_LCD_GetXSize()*4;
}
Do you have any ideas , how can I store camera images in memory without LCD?