|
ADC用DMA,分配16K的BufferSize不能有效分配
[复制链接]
用STM32F103VET6的芯片,分配16K的空间用做ADC1的DMA缓存尺寸,初始化是可以的,使能DMA函数后, DMA_DeInit(DMA1_Channel1); DMA_InitStructure.DMA_PeripheralBaseAddr = ADC1_BASE + 0x4c ; //base + 0x4c DMA_InitStructure.DMA_MemoryBaseAddr = (u32)&ADCConvertedValue; DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralSRC; DMA_InitStructure.DMA_BufferSize = 0x2000; //64 * 256; DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable; DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable; DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_HalfWord; DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_HalfWord; DMA_InitStructure.DMA_Mode = DMA_Mode_Circular; DMA_InitStructure.DMA_Priority = DMA_Priority_VeryHigh; DMA_InitStructure.DMA_M2M = DMA_M2M_Disable; DMA_Init(DMA1_Channel1, &DMA_InitStructure); /* Enable DMA1 channel1 */ DMA_Cmd(DMA1_Channel1, ENABLE);
运行的DMA_Init函数 DMA_CNDTR1 0x2000
运行DMA_Cmd函数后 DMA_CNDTR1 变成一个随机的数,但总不是0x2000
|
|