2016-01-20 12:52 PM
While trying to use GPIO inputs as inputs for the ADC, I discovered that the ADC control mode was not programmed correctly in the function HAL_GPIO_Init.
I replaced: temp &= ~(GPIO_ASCR_ASC0 << position) ; temp |= (((GPIO_Init->Mode & ANALOG_MODE) >> 3) << position); with temp |= GPIO_ASCR_ASC0 << position; and got it working properly. If you agree, I suggest you correct this in a future release. #adc-stm32l42016-01-21 04:43 AM
Hi verhelst.bas,
I think that your problem is not really related to a bug in the HAL_GPIO_Init function but it’s in the way that you initialize your GPIO mode structure. I guess that you program your structure as below GPIO_InitStruct.Mode = GPIO_MODE_ANALOG ; But it has to be: GPIO_InitStruct.Mode = GPIO_MODE_ANALOG_ADC_CONTROL;-Syrine-2016-01-26 09:37 AM
Syrine, You're right. I how have successfully ported the Motor Control software from F4xx to L476 and IHM07M1 board.
From: SyrinePosted: Thursday, January 21, 2016 1:44 PMSubject: STM32Cube_FW_L4 V1.2.0 bug ?Hi verhelst.bas,
I think that your problem is not really related to a bug in the HAL_GPIO_Init function but it’s in the way that you initialize your GPIO mode structure. I guess that you program your structure as below GPIO_InitStruct.Mode = GPIO_MODE_ANALOG ; But it has to be: GPIO_InitStruct.Mode = GPIO_MODE_ANALOG_ADC_CONTROL; -Syrine-