Skip to content

Commit ec37239

Browse files
dhylandsdpgeorge
authored andcommitted
stmhal: Improvements to the STM32F4DISC UART config settings.
1 parent 4b2938a commit ec37239

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

stmhal/boards/STM32F4DISC/mpconfigboard.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,35 @@
2323
#define MICROPY_HW_CLK_PLLQ (7)
2424

2525
// UART config
26+
#if 0
27+
// A9 is used for USB VBUS detect, and A10 is used for USB_FS_ID.
28+
// UART1 is also on PB6/7 but PB6 is tied to the Audio SCL line.
29+
// Without board modifications, this makes UART1 unusable on this board.
2630
#define MICROPY_HW_UART1_PORT (GPIOA)
2731
#define MICROPY_HW_UART1_PINS (GPIO_PIN_9 | GPIO_PIN_10)
32+
#endif
33+
2834
#define MICROPY_HW_UART2_PORT (GPIOA)
2935
#define MICROPY_HW_UART2_PINS (GPIO_PIN_2 | GPIO_PIN_3)
3036
#define MICROPY_HW_UART2_RTS (GPIO_PIN_1)
3137
#define MICROPY_HW_UART2_CTS (GPIO_PIN_0)
38+
3239
#define MICROPY_HW_UART3_PORT (GPIOD)
3340
#define MICROPY_HW_UART3_PINS (GPIO_PIN_8 | GPIO_PIN_9)
3441
#define MICROPY_HW_UART3_RTS (GPIO_PIN_12)
3542
#define MICROPY_HW_UART3_CTS (GPIO_PIN_11)
43+
44+
#if MICROPY_HW_HAS_SWITCH == 0
45+
// NOTE: A0 also connects to the user switch. To use UART4 you should
46+
// set MICROPY_HW_HAS_SWITCH to 0, and also remove SB20 (on the back
47+
// of the board near the USER switch).
3648
#define MICROPY_HW_UART4_PORT (GPIOA)
3749
#define MICROPY_HW_UART4_PINS (GPIO_PIN_0 | GPIO_PIN_1)
50+
#endif
51+
52+
// NOTE: PC7 is connected to MCLK on the Audio chip. This is an input signal
53+
// so I think as long as you're not using the audio chip then it should
54+
// be fine to use as a UART pin.
3855
#define MICROPY_HW_UART6_PORT (GPIOC)
3956
#define MICROPY_HW_UART6_PINS (GPIO_PIN_6 | GPIO_PIN_7)
4057

0 commit comments

Comments
 (0)