The Yocto Project on Raspberry Pi 5 Episode 12: Enabling UART on Raspberry Pi 5 with Yocto and Using a NEO-6M GPS Module
Working with hardware interfaces on embedded Linux becomes much more powerful when you control the entire software stack. In this episode of my video tutorial about the Yocto Project and OpenEmbedded, we will enable UART on a Raspberry Pi 5 running a custom Linux image and connect it to a U-Blox NEO-6M-0 GPS module. By the end, you will be able to read live NMEA GPS data over a serial interface.
The demonstration uses the Yocto LTS release Scarthgap and the meta-raspberrypi BSP layer. The GPS module is connected through the ANAVI Gardening uHAT using GPIO14 (Pin 8, TXD) and GPIO15 (Pin 10, RXD) on the Raspberry Pi 5 40-pin header.
Hardware Setup
The U-Blox NEO-6M-0 GPS module communicates over UART at 9600 baud by default. The wiring is as follows:
Raspberry Pi 5 GPIO14 (Pin 8, TXD) → GPS RX
Raspberry Pi 5 GPIO15 (Pin 10, RXD) → GPS TX
GND → GND
3.3V or 5V (depending on module requirements) → VCC
Step 1: Enable UART in Yocto (local.conf)
Edit your local.conf file in your Yocto build directory and add the following configuration:
If you see NMEA sentences like the above, the UART interface is working correctly. Empty fields and status ?V? indicate no satellite fix yet. Move the GPS antenna outdoors or near a window and wait for a valid fix.
Conclusion
By enabling UART in Yocto and configuring gpsd correctly, you can reliably interface a Raspberry Pi 5 with a U-Blox NEO-6M GPS module. This setup is ideal for embedded applications requiring positioning, timing, or speed data, and demonstrates how flexible and powerful a custom Yocto-based Linux image can be.