[STM32F4-discovery] setting UART2 in PD5 and PD6
Posted: Tue Oct 03, 2017 2:07 pm
Hello all, I'm trying to use REPL in uart2 pin PD5 (TX) and PD6(RX) in the STM32F4-discovery board, with the code below I got the console output (PD5 is transmitting successfully) but I can not enter any command, it looks like PD6 (RX) is not propertly configured.
Cables and boards (I tested two boards) are ok.
I tryed with the two available ports (stm32f4disc-20170526-v1.9 and stm32f4disc-20170108-v1.8.7).
Do you have any idea what it is happening?
when I get the current pin configuration it looks ok:
PD4 Pin(Pin.cpu.D4, mode=Pin.IN)
PD5 Pin(Pin.cpu.D5, mode=Pin.ALT, pull=Pin.PULL_UP, af=Pin.AF7_USART2)
PD6 Pin(Pin.cpu.D6, mode=Pin.ALT, pull=Pin.PULL_UP, af=Pin.AF7_USART2)
PD7 Pin(Pin.cpu.D7, mode=Pin.IN)
Thank you very much.
import pyb
import micropython
import sys
pinD5 = pyb.Pin(pyb.Pin.board.PD5, mode=pyb.Pin.ALT, pull=pyb.Pin.PULL_UP, af=pyb.Pin.AF7_USART2)
pinD6 = pyb.Pin(pyb.Pin.board.PD6, mode=pyb.Pin.ALT, pull=pyb.Pin.PULL_UP, af=pyb.Pin.AF7_USART2)
uart2 = pyb.UART(2,115200)
pyb.repl_uart(uart2)
Cables and boards (I tested two boards) are ok.
I tryed with the two available ports (stm32f4disc-20170526-v1.9 and stm32f4disc-20170108-v1.8.7).
Do you have any idea what it is happening?
when I get the current pin configuration it looks ok:
PD4 Pin(Pin.cpu.D4, mode=Pin.IN)
PD5 Pin(Pin.cpu.D5, mode=Pin.ALT, pull=Pin.PULL_UP, af=Pin.AF7_USART2)
PD6 Pin(Pin.cpu.D6, mode=Pin.ALT, pull=Pin.PULL_UP, af=Pin.AF7_USART2)
PD7 Pin(Pin.cpu.D7, mode=Pin.IN)
Thank you very much.
import pyb
import micropython
import sys
pinD5 = pyb.Pin(pyb.Pin.board.PD5, mode=pyb.Pin.ALT, pull=pyb.Pin.PULL_UP, af=pyb.Pin.AF7_USART2)
pinD6 = pyb.Pin(pyb.Pin.board.PD6, mode=pyb.Pin.ALT, pull=pyb.Pin.PULL_UP, af=pyb.Pin.AF7_USART2)
uart2 = pyb.UART(2,115200)
pyb.repl_uart(uart2)