cancel
Showing results for 
Search instead for 
Did you mean: 

REGARDING STM32F030F4P6 GPIO configuration.

chowdaiah
Associate II
Posted on July 24, 2014 at 05:13

HI,

I have faced one problem with PORTF pin configuration (PF0,PF1).

My GPIO configuration:

RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOF, ENABLE);

InitGpio.GPIO_Pin = (GPIO_Pin_0 | GPIO_Pin_1 );

InitGpio.GPIO_Mode = GPIO_Mode_AF;

InitGpio.GPIO_Speed = GPIO_Speed_Level_1;

InitGpio.GPIO_OType = GPIO_OType_PP;

InitGpio.GPIO_PuPd = GPIO_PuPd_NOPULL;

GPIO_Init(GPIOF, &InitGpio);

I am not getting any output from those PINs, if i tried normal GPIO configuration also. .

please suggest us is there any issue with that configuration.

Regards,

Chowdaiah

7 REPLIES 7
Posted on July 24, 2014 at 05:41

Is this on a Discovery Board? Are there solder bridges related to getting these to header pins?

/* GPIOF Periph clock enable */
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOF, ENABLE);
/* Configure PF0 and PF1 in output pushpull mode */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_Init(GPIOF, &GPIO_InitStructure);

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
chowdaiah
Associate II
Posted on July 24, 2014 at 07:24

it is not evaluation board , we have build for our small project purpose.

zzdz2
Associate II
Posted on July 24, 2014 at 09:20

Reference manual says these pins are special, looks like there is no point in configuring PF0/1 as alternate function.

RM0360:

 

8.3.13 Using the HSE or LSE oscillator pins as GPIOs

 

       When the HSE or LSE oscillator is switched OFF (default state after reset), the related

 

       oscillator pins can be used as normal GPIOs.

 

       When the HSE or LSE oscillator is switched ON (by setting the HSEON or LSEON bit in the

 

       RCC_CSR register) the oscillator takes control of its associated pins and the GPIO

 

       configuration of these pins has no effect.

 

       When the oscillator is configured in a user external clock mode, only the OSC_IN or

 

       OSC32_IN pin is reserved for clock input and the OSC_OUT or OSC32_OUT pin can still be

 

       used as normal GPIO.

 

 

chowdaiah
Associate II
Posted on July 24, 2014 at 10:15

I have already initialized same but it is not executed any output.

zzdz2
Associate II
Posted on July 24, 2014 at 15:04

I can set these pins to output without library:

#include <stm32f0xx.h>
 
 RCC->AHBENR |= RCC_AHBENR_GPIOFEN;
GPIOF->OTYPER = 0;
GPIOF->OSPEEDR = 0;
// PF0/1 output
GPIOF->MODER = GPIO_MODER_MODER0_0 | GPIO_MODER_MODER1_0;
// PF0/1 no pull
GPIOF->PUPDR = 0;
GPIOF->BSRR = GPIO_BSRR_BS_0 | GPIO_BSRR_BS_1;

chowdaiah
Associate II
Posted on July 25, 2014 at 10:53

I have tried this one also but it is not working.

Posted on July 25, 2014 at 15:10

May be it's your board or chip, or how the chip is soldered. Do you have multiple boards exhibiting this problem? I don't have any TTSOP20 parts to evaluate.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..