10 years, 7 months ago.

NucleoF401RE RE: duplicate UART1& 6 Pin

RE: Nucleo F-401RE

I am a newbie and hobbyist. I peek into 'NUCLEO_F401RE/serial_api.c and saw this code :

static const PinMap PinMap_UART_TX[] = {
    {PA_2,  UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
    {PA_9,  UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
    {PA_11, UART_6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)},
    {PB_6,  UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
    {PC_6,  UART_6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)},
    {NC,    NC,     0}
};
 
static const PinMap PinMap_UART_RX[] = {
    {PA_3,  UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
    {PA_10, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
    {PA_12, UART_6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)},
    {PB_7,  UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
    {PC_7,  UART_6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)},
    {NC,    NC,     0}
};

We have duplicated UART pins ( labeled "UART1 & 6) ?

I want to be able to use/code them correctly.

Question :

Why do we have or what purpose of having duplicate pin Number ?

When and how to use these UART ie. can I choose to use them both at the same time for 2 ports ( like PA_9 & PB_6 ) ? Or I can only pick either one but not both at one time.

Please elaborate.

Thanks.

1 Answer

10 years, 7 months ago.

It is the last one you mention: There is one physicial UART 'UART1', you can make any TX/RX combination you like, but it stays one physicial UART, so you cannot connect it to two sets of pins.

Accepted Answer