cancel
Showing results for 
Search instead for 
Did you mean: 

PF0 and PF1 in STM32F072CB

akshat
Associate II
Posted on March 03, 2016 at 14:39

Hi,

I am using STM32F072CB on a custom board in mbed compiler. I have used PF0 and PF1 pin as GPIO instead of HFE. But i am not able to control these pins as normal GPIO's. I have tested these pins having constant 1.85v and 0v.

Can you please suggest me, how to use these pins as GPIO?

Thank you. 

#pf1 #stm32f072 #pf0 #gpio
2 REPLIES 2
mark239955_stm1
Associate II
Posted on March 05, 2016 at 01:01

I'm not specifically familiar with your problem (I haven't used the PF0/1 pins on an STM32F0 as GPIO, afaicr), but a quick look through the reference and user manuals suggests that all you should need to do is keep the HSEON flag clear (it is clear by default).

The startup code generated by mbed may have turned the HSE oscillator driver on, i.e. set the HSEON flag in the RCC->CR register.  Quoting the reference manual,

''For the additional functions like RTC, WKUPx and oscillators, configure the

 

required function in the related RTC, PWR and RCC registers. These functions

 

have priority over the configuration in the standard GPIO registers.'',

so I'd start by debugging and checking whether the HSEON flag is set.

akshat
Associate II
Posted on March 08, 2016 at 11:25

Thanks turner,

I have disabled the HSE function and I am able to control both the pins as normal GPIO.