求助: 我这边使用STM32F446E-EVAL的开发板,SDRAM做保存要显示的图片,同时屏也是FMC驱动,显示使用DMA将SDAM中的图片发送到屏,但是DMA进了中断,但是屏没有显示,不知道是什么问题,请高手协助下。
用MCU将SDAM中的数据发送到屏已经OK,下面是DMA初始化代码:
DMA_InitTypeDef DMA_InitStructure;
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_DMA2, ENABLE);
DMA_ClearFlag(SDRAM_DMA_STREAM, SDRAM_DMA_FLAG_FEIF | SDRAM_DMA_FLAG_DMEIF | SDRAM_DMA_FLAG_TEIF | SDRAM_DMA_FLAG_HTIF | SDRAM_DMA_FLAG_TCIF);
/* DMA2 Stream0 or Stream7 disable */
DMA_Cmd(SDRAM_DMA_STREAM, DISABLE);
/* DMA2 Stream0 or Stream7 Config */
DMA_DeInit(SDRAM_DMA_STREAM);
DMA_InitStructure.DMA_Channel = SDRAM_DMA_CHANNEL;
DMA_InitStructure.DMA_PeripheralBaseAddr = (uint32_t)(SDRAM_BANK_ADDR);
DMA_InitStructure.DMA_Memory0BaseAddr = (uint32_t)(&(FMC_BANK1->RAM));//(FMC_BANK1_RAM);
DMA_InitStructure.DMA_DIR = DMA_DIR_MemoryToMemory;
DMA_InitStructure.DMA_BufferSize = (uint32_t)38400;
DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Enable;
DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Disable;
DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_HalfWord;
DMA_InitStructure.DMA_MemoryDataSize = DMA_PeripheralDataSize_HalfWord;
DMA_InitStructure.DMA_Mode = DMA_Mode_Normal;
DMA_InitStructure.DMA_Priority = DMA_Priority_VeryHigh;
DMA_InitStructure.DMA_FIFOMode = DMA_FIFOMode_Disable;
DMA_InitStructure.DMA_FIFOThreshold = DMA_FIFOThreshold_Full;
DMA_InitStructure.DMA_MemoryBurst = DMA_MemoryBurst_Single;
DMA_InitStructure.DMA_PeripheralBurst = DMA_MemoryBurst_Single;
DMA_Init(SDRAM_DMA_STREAM, &DMA_InitStructure);
DMA_ITConfig(SDRAM_DMA_STREAM, DMA_IT_TC, ENABLE); |