Using different UART pins on STM32 Nucleo
Along with SWD flashing, the debug interface chip on the Nucleo provides a USB&lt;>serial functionality to allow the target chip to communicate with a PC.

But this functionality is hard wired to the default UART pins of the target.

If you wish to use different UART pins, you will need something to connect those to your PC as well or instead - either an external 3v3 USB-UART, or to somehow rewire the on board one.

The signals to the on-board one are routed via resistors which can be removed, and there are header footprints which could help with re-routing. For the 64-pin STM32 Nucleo, these can be seen in the schematic (circled in red).