Equipping your drone with a GPS module and compass not only gives you useful OSD information but also adds a real safety feature: GPS Rescue. This allows your copter to automatically fly back toward you in an emergency. To make this reliable, both the hardware connection and Betaflight configuration must be correct.
The GPS connects to a free UART on your Flight Controller:
The compass usually connects via the I²C bus (two extra wires, typically labeled SDA and SCL). Connect these to the matching pads on the FC.
⚠️ Check your Flight Controller manual—pin labeling isn’t always consistent across manufacturers.

Your GPS module is probably mounted on top of the frame, sometimes slightly rotated. Betaflight needs to know the compass orientation: