Skip to content

Commit a888d5a

Browse files
dhylandsdpgeorge
authored andcommitted
stmhal: Improve NUCLEO-F401RE build, with UART2 as REPL.
This enables MICROPY_HW_HAS_FLASH which got missed. The HW has UART2 on the 401 connected to the STLINK procesor which exposes it as USB serial. This connects that up so that you can get a REPL using the USB serial.
1 parent 13a4c12 commit a888d5a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

stmhal/boards/STM32F401NUCLEO/mpconfigboard.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#define MICROPY_HW_MCU_NAME "STM32F401xE"
33

44
#define MICROPY_HW_HAS_SWITCH (1)
5+
#define MICROPY_HW_HAS_FLASH (1)
56
#define MICROPY_HW_ENABLE_RTC (1)
67

78
// HSE is 8MHz, CPU freq set to 84MHz
@@ -16,6 +17,11 @@
1617
#define MICROPY_HW_UART6_PORT (GPIOC)
1718
#define MICROPY_HW_UART6_PINS (GPIO_PIN_6 | GPIO_PIN_7)
1819

20+
// UART 2 connects to the STM32F103 (STLINK) on the Nucleo board
21+
// and this is exposed as a USB Serial port.
22+
#define MICROPY_HW_UART_REPL PYB_UART_2
23+
#define MICROPY_HW_UART_REPL_BAUD 115200
24+
1925
// I2C busses
2026
#define MICROPY_HW_I2C1_SCL (pin_B6)
2127
#define MICROPY_HW_I2C1_SDA (pin_B7)

0 commit comments

Comments
 (0)