Hi
Using ROS Melodic, you should take a look at ROSSerial https://github.com/yoneken/rosserial_..., run this on the board and then connect to your high system computer over serial (Duh).
If you're not constrained to the ROS distro, then I'd highly (very highly) suggest you move to ROS2 and use micro-ros https://micro.ros.org/ which is quite documented and better supported. You'll run micro-ros on the board and connect to the higher system over your desired transport protocol. However, as you'll be running on an STM32F767ZI, you should have access to ethernet. Ethernet is much more a reliable protocol than serial.
Good luck