2022-04-12 02:57 AM
I have designed a target board based on STM32G484VE and I am encountering a problem with GPIO outputs while powering on.
The requirement is no output should get high status while powering on or during reset. So I have configured the IOs using CUBEMX and all the outputs are configured as PushPull with Pulldown enabled.
But when the board is powered on all the outputs are activated momentarily and it gets to its normal status of being low.
BOR level is set at 3. Is there anything else , that I should take care of .
HAL program on GPIO - for reference :
/*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(GPIOE, SUC_VAL_Pin|IRRIG_VAL_Pin|ALT_VAL_Pin|VAC_VAL_Pin
|EJE_VAL_Pin|SPARE_Pin|REF_VAL_Pin|CUTTERB_Pin
|CUTTERA_Pin, GPIO_PIN_RESET);
/*Configure GPIO pins : SUC_VAL_Pin IRRIG_VAL_Pin ALT_VAL_Pin VAC_VAL_Pin
EJE_VAL_Pin SPARE_Pin REF_VAL_Pin CUTTERB_Pin
CUTTERA_Pin */
GPIO_InitStruct.Pin = SUC_VAL_Pin|IRRIG_VAL_Pin|ALT_VAL_Pin|VAC_VAL_Pin
|EJE_VAL_Pin|SPARE_Pin|REF_VAL_Pin|CUTTERB_Pin
|CUTTERA_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_PULLDOWN;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
Solved! Go to Solution.
2022-04-12 04:50 AM
Most GPIO pins are in high impedance analog mode during startup. There is no way to change this. The configuration you choose in CubeMX doesn't get activated until your program starts to run. There are some exceptions, but they are all listed in the GPIOx register values in the reference manual.
If you need pins to stay low, you will need to add an external pulldown.
Specifying a pulldown on an output pin does nothing but potentially waste current if the pull resistor is fighting the current output level.
2022-04-12 04:50 AM
Most GPIO pins are in high impedance analog mode during startup. There is no way to change this. The configuration you choose in CubeMX doesn't get activated until your program starts to run. There are some exceptions, but they are all listed in the GPIOx register values in the reference manual.
If you need pins to stay low, you will need to add an external pulldown.
Specifying a pulldown on an output pin does nothing but potentially waste current if the pull resistor is fighting the current output level.
2022-04-13 12:46 AM
Thanks a lot TDK. I will go with your suggestion of adding an external pulldown.