STM32 receiving and transmitting data at the same time


Hello, I am new to the stm32 world.
I'm trying to use my stm32f103c8t6 board as an intermediary to enable communication between the computer and arduino.
The project is simply based on receiving a message from the computer, and the STM32 sending a different message package to Arduino according to the incoming message.
That is, receive and transmit operations must occur simultaneously.
For this, at first I was receiving data via USB CDC and transmitting data via UART and I was successful. But for reasons beyond my control, I need to use a communication method other than USB-CDC.
Even though I tried to use uart for data exchange, I was not successful, there is an example code I shared at the image (pink ones are message I sent, black ones message I get) I would appreciate it if you could tell me the changes I should make for this process or the protocols you recommend me to use.
