2017-08-23 12:56 AM
I'm using a STM32F030R8 and configured the pin PF0 as a GPIO-Input. But when i read the pin it is randomly 1 or 0.
The code was generated with the CubeMX SW. When i try an other pin for exsample PB1 it works fine.
The same issue i have with the STM32F302R8 board
Does anyone know this problem?
2017-08-23 01:24 AM
What's connected to that pin externally? What happens if you switch on a pullup or pulldown in GPIO_PUPDR?
JW
2017-08-23 02:19 AM
For both devices, PF0 is the HSE oscillator input pin.
Make sure HSE is not enabled because it takes precedence over the GPIO configuration.
2017-08-23 03:30 AM
I just put the pin on GND or 3.3V. Pullup or pulldown makes no differents.
2017-08-23 03:36 AM
How do you check that input, in the debugger?
Post the relevant RCC and GPIO registers' content.
JW
2017-08-23 04:12 AM
PF0 is OSC_IN. Do you have RCC_CSR.HSEON set? (See 8.3.13 Using the HSE or LSE oscillator pins as GPIOs in RM0360.)
JW
2017-08-23 04:29 AM
I found my mistake. On the Nucleo-Board is the PF0 default not with the pinheader connected.
But thanks for all your help
Simon
2017-08-23 05:27 AM
The RCC clock is disable and the PF0 is set to GPIO_Input.
2017-08-23 11:23 PM
On the nucleo boards, in the default hardware configuration, PF0 is connected to the STLink MCU clock out (MCO).
The purpose is to be able to use HSE set in bypass mode.
This is done this way to save the cost of one crystal and free PF1 while still having a precise clock.