Betaflight SITL - samdrew/betaflight_gazebo GitHub Wiki
Betaflight SITL is build from source. Unfortunately the build process fails on MacOS, so this has to be built and run on Linux. Clone the betaflight repo and build using the following instructions:
git clone https://github.com/betaflight/betaflight.git
cd betaflight
# git checkout 4.5.0
make arm_sdk_install
make TARGET=SITL
Personally I am using the tagged Betaflight version 4.5.0 and Configurator 10.10.0.
To start the virtual flight controller execute
./obj/main/betaflight_SITL.elf
This will start the controller. You will see a UART port open on the network port :5761, which is used to connect and configure Betaflight, as well as ports UDP ports 9003 and 9004, to support state and RC input.
$ netstat -anp | grep obj
tcp 0 0 0.0.0.0:5761 0.0.0.0:* LISTEN 21409/./obj/main/be
udp 0 0 0.0.0.0:9003 0.0.0.0:* 21409/./obj/main/be
udp 0 0 0.0.0.0:9004 0.0.0.0:* 21409/./obj/main/be
Load the Betaflight configurator either as an app or by going to app.betaflight.com. In version 11 and later you will need to ensure that manual connection mode is enabled in Options, before connecting to the open UART port on your VM.

The connection string should be tcp://<ip_address>:5761
, then click Connect. At this point, if you connect successfully, you will be presented with a warning. Close this, as we will fix it shortly.
First, let's enable UART2, to support controller input. Select Ports in the left-hand bar, and Enable UART2 under Configuration/MSP, then Save and Reboot. This will disconnect you and stop the running SITL process, but an eprom dump will occur with the new settings, so when you restart it will save the configuration.

Next let's get the motors working. Restart the SITL process and reconnect with Betaflight configurator, where we now go to Motors. By default the motors are set to DISABLED. This should change to PWM, before another Save and Reboot. Now when you connect via the Betaflight configurator the initial error message should no longer be present.

The final thing to configure is the ARM switch, under Modes. This should be set to AUX 1 and be extended all the way to 2000 or beyond.

The final stage within Betaflight SITL is verifying input from the receiver. But for that we need a control signal, so let's proceed on the msp-node page.