Merge pull request #14032 from jeromecoutant/PR_RESET_GPIO

STM32: RESET GPIO during init is configurable
pull/14162/head
Martin Kojtal 2021-01-15 15:49:11 +00:00 committed by GitHub
commit eff0d4c8b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -94,6 +94,7 @@ MBED_WEAK void TargetBSP_Init(void) {
/** Do nothing */
}
#if MBED_CONF_TARGET_GPIO_RESET_AT_INIT
void GPIO_Full_Init(void) {
GPIO_InitTypeDef GPIO_InitStruct;
@ -160,6 +161,7 @@ void GPIO_Full_Init(void) {
__HAL_RCC_GPIOK_CLK_DISABLE();
#endif
}
#endif
// This function is called after RAM initialization and before main.
void mbed_sdk_init()
@ -311,8 +313,10 @@ void mbed_sdk_init()
#endif /* ! MBED_CONF_TARGET_LSE_AVAILABLE */
#endif /* DEVICE_RTC */
#if MBED_CONF_TARGET_GPIO_RESET_AT_INIT
/* Reset all GPIO */
GPIO_Full_Init();
#endif
/* BSP initialization hook (external RAM, etc) */
TargetBSP_Init();

View File

@ -1157,6 +1157,10 @@
"lpticker_lptim_clock": {
"help": "Default value for LPTIM clock (lpticker_lptim == 1). Value is the dividing factor. Choose 1, 2 or 4",
"value": 1
},
"gpio_reset_at_init": {
"help": "if value set, all GPIO are reset during init",
"value": false
}
},
"overrides": {
@ -3285,6 +3289,9 @@
"macro_name": "CLOCK_SOURCE"
}
},
"overrides": {
"gpio_reset_at_init": true
},
"device_has_add": [
"ANALOGOUT",
"SERIAL_ASYNCH",