XM540-W270-R and STM32 Nucleo-H743ZI2

First of all I haven’t used the STMH7 line and mainly play with the much simpler easier to use STMF4 line of MCUs.

Second I haven’t used RS485 but have used UART plenty of times before. I didn’t even know that STMH7 has native RS485

First thing I always try with serial coms is swap the 2 pins the other way around in-case wiring is backwards. I haven’t used the starter board either but the 2 data pins for the RS485 pins should be the ones with the little resistor between them. Beaware the other pins on the connector will be the full votage for the dynamixel servo so if you connect the data pins to full voltage you will damage your STMH7 board.

Second thing I always check with Asynchronous serial com is the baud rate.

If you have a logic analyzer then attach it to the data lines to see if data is being sent. If you don’t have an logic analyzer then attach 2 LEDs between the 2 lines setup each LED in oppsite polarity with the correct sized resistor so you can see if they flash so you know data is being sent.

Another thing to note is when receiving UART I usually setup a DMA transfer to automatically move the data from the UART input register into a buffer because the hardware UART peripheral will only store 1 byte in the input register and will just throw away any further received bytes until that byte is read and the flag is cleared. If your not goin to use DMA then try removing the delay you have between the sending and the recieving so that as soon as it finishes sending then it starts to receive and clear the 1 byte input register so that it can receive the next byte.