Skip to content

STM32: RESET GPIO during init is configurable #14032

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions targets/TARGET_STM/mbed_overrides.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -309,8 +311,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();
Expand Down
7 changes: 7 additions & 0 deletions targets/targets.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -3200,6 +3204,9 @@
"macro_name": "CLOCK_SOURCE"
}
},
"overrides": {
"gpio_reset_at_init": true
},
"device_has_add": [
"ANALOGOUT",
"SERIAL_ASYNCH",
Expand Down