MBED L432KC UART2 disable

Hi,

I would like to disable UART2 which is STDIO_UART_TX so that I can use that as normal GPIO on STM32L432KC. I tried the macro DEVICE_SERIAL=0, but it also disables other UART, which doesn’t allow me to use Bufferedserial.
I also tried modifying the PeripheralPins.c file.

MBED_WEAK const PinMap PinMap_UART_TX[] = {
//    {PA_2,       UART_2,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, // Connected to STDIO_UART_TX
//  {PA_2,       LPUART_1,STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)}, // Connected to STDIO_UART_TX
    {PA_9,       UART_1,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
    {PB_6,       UART_1,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
    {NC, NC, 0}
};

but not quite helpful. Any kind of suggestion or help would be highly appreciated.
Thank you.

Hello,

try this

BR, Jan

Hi,
Thanks for the response. Disabling it in mbed_app.json { “target_overrides”: { “*”: { “target.console-uart”: false } } } works perfectly.

1 Like

Hi,
Continuing from the previous thread, How can I reroute the console to UART1 instead of USBTX/RX in MBED OS 6.

Thank you,

Hello again,

check this topic.

BR, Jan