2020-06-30 03:16 AM
Problem is that the voltage does not rise to 3.3V, I measure it at 1.64V. The pin has nothing connected to it and I tried this on 2 MCUs.
Using STM32CubeIDE 1.2.0 Build: 5034_20200108_0926, I created a simple project and configured pin PB6 as GPIO_INPUT. In the GPIO configuration I set PB6 to pull-up. Nothing else configured, everything else is at default settings. The code generated looks correct:
static void MX_GPIO_Init(void) {
GPIO_InitTypeDef GPIO_InitStruct = {0};
/* GPIO Ports Clock Enable */
__HAL_RCC_GPIOB_CLK_ENABLE();
/*Configure GPIO pin : PB6 */
GPIO_InitStruct.Pin = GPIO_PIN_6;
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
GPIO_InitStruct.Pull = GPIO_PULLUP;
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
}
NRST_MODE in the user option bytes is set to 1, but this shouldn't affect anything.
It's almost as if this pin is bonded to something else that is trying to pull it low. What can I do to get this pin working?
Solved! Go to Solution.
2020-07-03 05:09 AM
Well, I tried DeInit of PA14 as well as clearing the STROBE bits
HAL_GPIO_DeInit(GPIOA, GPIO_PIN_14);
// UCPDx_STROBE bit of the SYSCFG_CFGR1 register
CLEAR_BIT(SYSCFG->CFGR1, 0b00000000000000000000011000000000);
Problem still there.
2020-07-03 05:21 AM
What worked for me is defining PA14 as GPIO input instead of PB6. This moves PA14 away from the reset value SYS_SWCLK thereby disabling the pull-down.
2020-07-03 05:39 AM
Using PA14 instead of PB6 worked! Thanks.