UART1 Setting Problem on STM32F4Disc. with pins PB6 PB7

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
Post Reply
stmfresser
Posts: 22
Joined: Sat Jun 20, 2015 11:48 am

UART1 Setting Problem on STM32F4Disc. with pins PB6 PB7

Post by stmfresser » Sun Jun 21, 2015 10:35 pm

Hello,
i'm trying to initialize UART1 on STM32F4 Discovery Board with pins PB6 PB7. I can't receive any chars from Computer, but i can send.
does anyone know how to solve it?

thank you.

it was configured like below.
PB6 = pyb.Pin('PB6', mode=pyb.Pin.AF_PP, af=pyb.Pin.AF7_USART1)
PB7 = pyb.Pin('PB7', mode=pyb.Pin.AF_PP, af=pyb.Pin.AF7_USART1)
from pyb import UART
uart = UART(1, 9600)

Damien
Site Admin
Posts: 614
Joined: Mon Dec 09, 2013 5:02 pm

Re: UART1 Setting Problem on STM32F4Disc. with pins PB6 PB7

Post by Damien » Mon Jun 22, 2015 3:23 pm

stmfresser wrote: i'm trying to initialize UART1 on STM32F4 Discovery Board with pins PB6 PB7.
By default UART1 is on PA9 and PA10. To change it to be on PB6 and PB7 you need to change the settings in the stmhal/boards/STM32F4DISC/mpconfigboard.h file (lines 28 and 29, search for MICROPY_HW_UART1).

stmfresser
Posts: 22
Joined: Sat Jun 20, 2015 11:48 am

Re: UART1 Setting Problem on STM32F4Disc. with pins PB6 PB7

Post by stmfresser » Mon Jun 22, 2015 3:50 pm

thank you a lot. it works!!

Post Reply