2016-06-10 02:39 AM
Hello,
I noticed that the STM32CubeMx doesn't generate default struct initialization in the code. This doesn't usually raise an error because all fields are tipically initialized, but sometimes this doesn't apply. I.E in MX_ADC1_Init:ADC_MultiModeTypeDef multimode;
/**Configure the ADC multi-mode
*/
multimode.Mode = ADC_MODE_INDEPENDENT;
if (HAL_ADCEx_MultiModeConfigChannel(&hadc1, &multimode) != HAL_OK)
{
Error_Handler();
}
these lines cause an error because sometime the other two fields DMAAccessMode and
TwoSamplingDelay aren't initialized at 0 as supposed. The correct solution is a default initializatio for the struct:
ADC_MultiModeTypeDef multimode = {0};
as in the examples in the various STM32Cube_FW_*.
Regards
#cubemx
2016-06-10 02:57 AM
Hi dallagiovanna.luca,
I confirm this bug that concerns STM32L4. Please note that it will be fixed in next CubeMX version.-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.