STM32F401 - using OSC_IN/OSC_OUT as GPIO
Hello,
I am having trouble in getting PC14 and PC15 working as GPIOs on the STM32F401. The reference manual says that "The LSE oscillator pins OSC32_IN and OSC32_OUT can be used as general-purpose PC14 and PC15 I/Os, respectively, when the LSE oscillator is off.". However I still cannot use them as GPIOs, despite disabling LSE. I am aware of the current limit and the backup power domain. In my design Vbat is connected directly to Vdd and I enabled the backup power domain in RCC. Is there some special mode that they need to operate?
My design uses external 24kohm pullup resistors on these pins, because I read in the manual that they can only sink current.
Currently, my init code does (in the following order):
- enables backup power
- enables access to RTC registers, sets RTC_CR to zero and backup RTC_CR to zero
- resets backup domain: sets RCC_BDCR |= (1<<16); waits a while, and sets RCC_BDCR &= ~(1<<16);
- enables GPIOC in RCC and sets all pins of GPIOC to be outputs, with internal pullups enabled, slew rate 2MHz, push-pull mode
In this case toggling the GPIOC makes all pins but PC[13-15] change state. Is there something I am missing?
According to the datasheet woding all that RTC code should not be necesary because the LSE is disabled by default
Does anyone have a code example (CubeMX or Libopencm3) which shows how to control these pins?
Best Regards
KL
