The BusBom Project consists of two main components for UART-based communication:
- STM32 firmware (built using STM32CubeIDE 1.18.1)
- Raspberry Pi 4 kernel module-based UART device driver (using serdev)
- STM32 functions as the UART transmitter, Raspberry Pi as the receiver.
- Uses the serdev interface for kernel-level communication.
| Item | Specification |
|---|---|
| MCU | STM32 series microcontroller |
| Development Tool | STM32CubeIDE 1.18.1 |
| SBC | Raspberry Pi 4 (64bit) |
| OS | Raspberry Pi OS 64bit Legacy (Kernel 6.1.21-v8+) |
| Communication | UART (GPIO14: TX, GPIO15: RX) |
| Kernel Driver | serdev-based kernel module (manual build and load) |
- Launch STM32CubeIDE.
- Select
File→Open Projects from File System.... - Set
Directoryto thebusbomproject folder path → Finish. - In Project Explorer, right-click on the
busbomproject →Build Project. - Connect the STM32 board.
- Right-click on the project →
Run As→1 STM32 Cortex-M C/C++ Application.
If the debug configuration window appears, click OK or Run.
| Raspberry Pi Pin | Signal | Example Color |
|---|---|---|
| Pin 6 | GND | Gray |
| Pin 8 (GPIO14) | TX | Purple |
| Pin 10 (GPIO15) | RX | Blue |
sudo apt update
sudo apt install raspberrypi-kernel-headers
ls /lib/modules/$(uname -r)
# Ensure the 'build' folder existssudo chmod +w /boot/config.txt
sudo chmod +w /boot/cmdline.txtenable_uart=1
dtoverlay=disable-bt
dtoverlay=serdev_overlayconsole=serial0,115200sudo systemctl disable hciuart
sudo systemctl stop hciuart
sudo systemctl disable bluetooth
sudo systemctl stop bluetoothsudo raspi-config
# Interface Options → Serial Port
# "Login shell over serial" → No
# "Enable serial port hardware" → Yes
sudo rebootgit clone https://github.com/BusBom/hardware.git
cd hardware/uart/driver
makesudo timedatectl set-ntp true
timedatectl status
# Check that 'System clock synchronized: yes'sudo cp serdev_overlay.dtbo /boot/overlays/
sudo insmod serdev_uart.ko
sudo dmesg -c
# Look for "serdev_echo: probe called"sudo rmmod serdev_uartcd ..
make
sudo ./uartWritten time range: 0830:2130
Written bus array: 1234:5678:A0B1:M1M2
Connection state: CONNECTED-
Set bus numbers:
"BUS1:BUS2:BUS3:BUS4"
Use a space character (' ') for empty platforms.
Example:"6001: :6003:6004" -
Set operating time:
"START_TIME:END_TIME"(24-hour format)
Example:"0910:0012"→ 9:10 AM to 12:12 AM
Example:"1612:2010"→ 4:12 PM to 8:10 PM
echo "0100:2100" | sudo tee /dev/serdev-uart
echo "6001:6002:6003:6004" | sudo tee /dev/serdev-uart- Check connection status:
1: Connected0: Disconnected
cat /dev/serdev-uart⚠ Note: Initial connection may take some time.
| Symptom | Cause and Solution |
|---|---|
No serdev-uart device |
Check /boot/config.txt and kernel module settings |
| No "probe called" message | Verify with dmesg after insmod |
cat /dev/serdev-uart returns 0 |
Check STM32 connection or TX/RX wiring |
write() has no effect |
Format error or /dev/serdev-uart permission issue |

