cancel
Showing results for 
Search instead for 
Did you mean: 

Using PB7/6 port of STMF051

paul0208
Associate III
Posted on July 15, 2016 at 02:51

Hi,

I configured USART1 to PA9/10. And I want to use PB6/7 to GPIO.

First I initial the USART1 function(using PA9/10), and works well(putchar works well). But when I initial PB6/7 to GPIO by GPIO_Init() function, USART1 function does not work at this moment.

PB6/7 can be configured USART1 also. I think something is related this.

Please help me.

Paul

3 REPLIES 3
Posted on July 15, 2016 at 02:56

Perhaps you should show the code, it might be more apparent then what the problem actually is...

Is this on some specific board, if so state which and the connectivity.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Walid FTITI_O
Senior II
Posted on July 15, 2016 at 13:21

Hi sangdo.lee,

Check GPIO_Init configuration, if you are not assigning the PB6/PB7 to UASRT1 AF also. As mentionned in STM32F0xx reference manual , part 8.3.2 I/O pin alternate function multiplixer and mapping:

''

The device I/O pins are connected to on-board peripherals/modules through a multiplexer that allows only one peripheral alternate function (AF) connected to an I/O pin at a time. In this way, there can be no conflict between peripherals available on the same I/O pin.

''

If it is the casen PA9/PA10 no more assigned to USART1 but PB6/7 instead.

-Hannibal-

paul0208
Associate III
Posted on July 17, 2016 at 12:46

Hi, Hannibal,

I had a mistake to call GPIO_Init, passing ridiculous parameter for GPIO_TypeDef* GPIOx ...

THX for help

Paul