Hello @unknown;
I recommend you to look at this FAQ How to redirect the printf function to a UART for debug messages. This article explains step by step on how to redirect the printf output to the STM32 UART peripheral that is connected to the UART pins on the embedded ST-LINK that will be transmitted to the host computer and displayed via a windows terminal program, Tera Term. This article is developed with NUCLEO-G070RB but you can get inspired to create your own project using NUCLEO-F411RE.
Also, you can find in this link an UART_Printf example. This example shows how to re-route the C library printf function to the UART. The UART outputs a message on the HyperTerminal. This example has been tested with STMicroelectronics NUCLEO-F411RE RevC boards.
I hope this help you!
Thank you.
Kaouthar