Connecting the Flight controller and RPi Hardware,Connect the flight controller’s TELEM2 port to the RPi’s Ground, TX and RX pins .
Connect to the flight controller with a ground station (i.e. Mission Planner) and set the following parameters:
SERIAL2_PROTOCOL = 2 (the default) to enable MAVLink 2 on the serial port.
SERIAL2_BAUD = 921 so the flight controller can communicate with the RPi at 921600 baud.
LOG_BACKEND_TYPE = 3 if you are using APSync to stream the dataflash log files to the RPi