This is not a TouchGFX issue in itself since it is in the main.c. Maybe try to have a look at one of the examples using UART for the STM322H747-disco in your STM32CubeMX repository (usually here C:\Users\<user name>\STM32Cube\Repository\STM32Cube_FW_H7_V1.9.0\Projects\STM32H747I-DISCO\Examples