2015-04-13 05:17 AM
HI
I just have a simple question; I think I�m missing something.
I using cubeMX for getting the ADC up running with 2 ch ( IN8 and IN15)
And the DMA for transferring the data to a buffer.
I have added a picture showing the cubeMX ADC setup
And I Use the:
if( HAL_ADC_Start_DMA( mpHadc, (uint32_t *)rawAnalogData, 4 ) == HAL_OK )
For starting the ADC.
And I have implemented the:
void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc)
{
analogConvDone = true;
HAL_ADC_Stop_DMA(mpHadc);
}
The problem is that I only get data from ch8 (rank 1) and NOT from ch15Hops someone can give a hint. #adc-dma-cubemx2015-04-13 11:39 PM
HI
It seems to be a error in the ADC software for cubeMx. continuous mode does not work.When you set continuous mode to enable (in cubeMX) it only just convert the first rank.example:/* ADC1 init function */void MX_ADC1_Init(void){ ADC_ChannelConfTypeDef sConfig; /**Common config */ hadc1.Instance = ADC1; hadc1.Init.ScanConvMode = ENABLE; hadc1.Init.ContinuousConvMode = ENABLE; hadc1.Init.DiscontinuousConvMode = DISABLE; hadc1.Init.ExternalTrigConv = ADC_SOFTWARE_START; hadc1.Init.DataAlign = ADC_DATAALIGN_RIGHT; hadc1.Init.NbrOfConversion = 4; HAL_ADC_Init(&hadc1); /**Configure Regular Channel */ sConfig.Channel = ADC_CHANNEL_8; sConfig.Rank = 1; sConfig.SamplingTime = ADC_SAMPLETIME_239CYCLES_5; HAL_ADC_ConfigChannel(&hadc1, &sConfig); /**Configure Regular Channel */ sConfig.Channel = ADC_CHANNEL_15; sConfig.Rank = 2; HAL_ADC_ConfigChannel(&hadc1, &sConfig); /**Configure Regular Channel */ sConfig.Channel = ADC_CHANNEL_TEMPSENSOR; sConfig.Rank = 3; HAL_ADC_ConfigChannel(&hadc1, &sConfig); /**Configure Regular Channel */ sConfig.Channel = ADC_CHANNEL_VREFINT; sConfig.Rank = 4; HAL_ADC_ConfigChannel(&hadc1, &sConfig);}And in HAL_ADC_Init() if (hadc->Init.ScanConvMode == ADC_SCAN_ENABLE) { tmp_sqr1 = ADC_SQR1_L_SHIFT(hadc->Init.NbrOfConversion); }Problem in Init.ScanConvMode: ADC_SCAN_ENABLE and ENABLE is not the same value!!Best regardsSøren PanduroI have tried to post a ticket in the online support, but it keeps telling me: The submit action was successfully cancelled. -> super
L
2015-04-22 01:35 AM
Hipanduro.soeren.002,
This issue has been reported in following threads: - - It should be already fixed in current CubeMX release (4.7). So, could you please let me know if you are using this one or a previous version? If 4.7 is used, please tell me what product are you using. Thanks -Mayla-To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2016-11-23 04:41 PM
This still occurs on the STM32F746VGTx and the latest FW-F7 (V1.5.0 and V1.5.1) do not generate valid Atollic TrueStudio projects.
Nick