iNav
iNav supports u-blox GPS via UART and magnetometers via I²C.

1. Wiring
Connect TX/RX to any available UART
SDA/SCL go to the default I²C bus
2. CLI Configuration
Use the CLI to enable GPS and magnetometer:
feature GPS
feature MAG
set gps_baudrate = 115200
set gps_provider = UBLOX
save
Then go to the Configurator:
Run GPS setup
Run Mag calibration
Tip: Use a serial inverter (or softserial) on F4 boards if UARTs are limited.