Pyboard V1.1 UART1 Pin Change

C programming, build, interpreter/VM.
Target audience: MicroPython Developers.
Post Reply
bradstew
Posts: 10
Joined: Thu Nov 29, 2018 9:29 pm

Pyboard V1.1 UART1 Pin Change

Post by bradstew » Mon Jul 06, 2020 9:58 pm

Hello,
I'm modifying MicroPython for a custom build based on the STM32F405. I am using the Pyboard V11 as a template and making changes to mpconfigboard.h where needed.
I want to use PA10 and PA11 for UART1 and not use the USB OtG (which is an option on the PyBoard).

I changed the lines in mpconfigboard.h and made the following changes.

#define MICROPY_HW_UART1_TX (pin_A9)
#define MICROPY_HW_UART1_RX (pin_A10)

I commented out the lines that previously defined UART1 at pins B6 and B7.

These pins share USB HS/OtG signals which I am not using.

When I tried out the new settings, I see data on UART 1 Tx at PA9, but cannot receive any data on Rx at PA10.

I then tried changing the following to remove USB OtG,

// USB config
#define MICROPY_HW_USB_FS (0)
//#define MICROPY_HW_USB_VBUS_DETECT_PIN (pin_A9)
//#define MICROPY_HW_USB_OTG_ID_PIN (pin_A10)

However, the build generates errors that reference the usbd_xxx source code. This is odd since I'm using the standard USB device interface for REPL, i.e. exact same as with the PyBoard V11.

Any suggestions or recommendations would be appreciated.
Thanks,
Brad

bradstew
Posts: 10
Joined: Thu Nov 29, 2018 9:29 pm

Re: Pyboard V1.1 UART1 Pin Change

Post by bradstew » Wed Jul 08, 2020 5:53 pm

I seem to have it working now.
I can leave the USB FS enabled but comment out the pins associated with it.

// USB config
#define MICROPY_HW_USB_FS (1) //leave as is
//#define MICROPY_HW_USB_VBUS_DETECT_PIN (pin_A9)
//#define MICROPY_HW_USB_OTG_ID_PIN (pin_A10)

Post Reply