I was facing the same issue with the USART RX Pin. The HAL initialisation in usart.c is autogenerated, so I can’t edit the init of the gpio. Instead I reinitialised the pin in the user code under the auto generated function. How did you solved this? The same way? Or is there a better approach?