用CUBE配置DMA的时候,
hdma_adc1.Instance = DMA1_Channel1;
hdma_adc1.Init.Direction = DMA_PERIPH_TO_MEMORY;
hdma_adc1.Init.PeriphInc = DMA_PINC_DISABLE;
hdma_adc1.Init.MemInc = DMA_MINC_ENABLE;
hdma_adc1.Init.PeriphDataAlignment = DMA_PDATAALIGN_HALFWORD;
hdma_adc1.Init.MemDataAlignment = DMA_MDATAALIGN_HALFWORD;
hdma_adc1.Init.Mode = DMA_CIRCULAR;
hdma_adc1.Init.Priority = DMA_PRIORITY_HIGH;
可以看到并没有配置DMA外设基地址和内部基地址,也没有配置DMA通道的DMA缓存大小?
可以看到例子中是有这个配置的,
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
HAL_DMA_Start_IT(hadc->DMA_Handle, (uint32_t)&hadc->Instance->DR, (uint32_t)pData, Length);
而HAL_DMA_Start_IT的参数是
@param hdma: pointer to a DMA_HandleTypeDef structure that contains
* the configuration information for the specified DMA Channel.
* @param SrcAddress: The source memory Buffer address
* @param DstAddress: The destination memory Buffer address
* @param DataLength: The length of data to be transferred from source to destination
难道是这句话?
ADC_Buffer对应pData这个是DMA地址?hadc->Instance->DR对应外设ADC基地址,Length对应例子中的DMA_BufferSize.
一周热门 更多>