I would like to move the debug USART from USART2 (Tx = PA2, Rx = PA3) to USART1 (Tx = PA9, Rx = PA10).
The search for “PA_2” and “PA_3” leads to PinNames.h of my TARGET_DISCO_L072CZ_LRWAN1:
#ifdef MBED_CONF_TARGET_STDIO_UART_TX
STDIO_UART_TX = MBED_CONF_TARGET_STDIO_UART_TX,
#else
STDIO_UART_TX = PA_2,
#endif
#ifdef MBED_CONF_TARGET_STDIO_UART_RX
STDIO_UART_RX = MBED_CONF_TARGET_STDIO_UART_RX,
#else
STDIO_UART_RX = PA_3,
#endif
Changing the values 2 → 9 and 3 → 10 directly leads to the desired functionality. But of course that’s not the way to go.
I should probably use custom_targets.json instead. But the content I tried has no effect:
{
“MY_DEVICE”: {
“inherits”: [“DISCO_L072CZ_LRWAN1”],
“MBED_CONF_TARGET_STDIO_UART_TX”: “PA_9”,
“MBED_CONF_TARGET_STDIO_UART_RX”: “PA_10”
}
}
Help is very much appreciated.
Greetings Thomas