REPORT #06 · CAN BUS · LINUX

BeagleBone Black —
Debian 13.5 & CAN Bus
Setup Report

Board BeagleBone Black
OS Debian 13.5 Trixie
Kernel 6.18.32-bone35
Date June 2026
SocketCAN SN65HVD230 eMMC uEnv.txt 500 kbps can-utils
01 — Overview

Project Overview

This report documents the installation of Debian 13.5 on a BeagleBone Black and the configuration of its CAN Bus interface using an SN65HVD230 transceiver.

The primary motivation for upgrading the operating system was CAN Bus support: the previously installed Debian 7.8 did not support SocketCAN, making a fresh OS installation necessary. The installation was performed by booting from a microSD card, then migrating the OS to the internal eMMC flash memory for long-term stability.


02 — Comparison

BBB vs Raspberry Pi & Similar Boards

The BeagleBone Black is targeted at embedded and industrial applications. Here is how it compares to mainstream alternatives like the Raspberry Pi 4/5.

✅ Advantages❌ Disadvantages
Programmable Real-Time Units (PRU) — deterministic hard real-time I/O without an RTOSOnly 512 MB RAM — limiting for modern workloads
Open hardware — full schematics publicly availableSlower CPU (1 GHz Cortex-A8) vs RPi 4 (1.8 GHz Cortex-A72)
Industrial-grade reliability, wide voltage toleranceSmaller community and ecosystem than Raspberry Pi
Built-in eMMC — stable boot without SD cardOnly 4 GB eMMC — most consumed by OS
Native CAN Bus support via SocketCANNo built-in Wi-Fi or Bluetooth
Rich header: I2C, SPI, UART, ADC, PWM, GPIONo GPU — not suited for desktop or media use
Low power consumption — ideal for embedded deploymentFewer ready-made HATs/shields vs Raspberry Pi
Key Differentiator

The PRU (Programmable Real-Time Unit) subsystem is the BBB's strongest advantage over the Raspberry Pi. It allows precise microsecond-level timing for protocols like CAN, without the latency jitter of a general-purpose OS — something the RPi cannot reliably achieve.


03 — Hardware

Hardware Overview

Board Specifications

ComponentDetail
BoardBeagleBone Black (BBB)
ProcessorTI AM335x — ARM Cortex-A8 @ 1 GHz
RAM512 MB DDR3
Internal Storage4 GB eMMC
Operating SystemDebian 13.5 (Trixie) IoT
Kernel6.18.32-bone35

CAN Bus Hardware

ComponentDetail
TransceiverSN65HVD230 — TI CAN Bus Transceiver (3.3 V)
CAN InterfaceCAN0 (SocketCAN)
TX PinP9.20
RX PinP9.19
LED PinP9.14
Bitrate500,000 bps (500 kbps)

04 — OS Upgrade

Why Upgrade from Debian 7.8?

The BBB was originally running Debian 7.8 (Wheezy, 2013 — end-of-life May 2018). An upgrade was mandatory for the following reasons:

  • No SocketCAN support — Debian 7.8 kernels for BBB did not include AF_CAN socket layer required for can-utils and ip link set canX up.
  • Outdated kernel — the 3.x kernel series lacks modern device tree overlay support needed to activate CAN0 via BB-CAN0-00A0.dtbo.
  • End-of-life — no security patches or package updates available.
  • Incompatible toolchain — modern Python and build tools are not available on Debian 7.8.
Solution

Debian 13.5 (Trixie) with kernel 6.18.32-bone35 provides full SocketCAN support, up-to-date device tree overlays, and an active package repository.


05 — Storage

Storage — eMMC Usage & SD Card

The BeagleBone Black includes 4 GB of eMMC internal flash. After installing Debian 13.5 IoT, available free space is limited.

4 GB eMMC — partition layout (approximate)
OS ~2.5 GB
SWAP
~500 MB free
OS + packages (~2.5 GB)
Swap (512 MB)
Free (~500 MB)
Boot/firmware (36 MB)
Storage Note

Only ~500 MB remains free for user projects. This is sufficient for lightweight embedded applications but may be a constraint for data logging, large binaries, or compiled toolchains.

Re-enabling the SD Card for Projects

Since the OS runs from eMMC, the microSD slot is free to be used as additional storage at any time:

# Insert SD card and verify detection
lsblk

# Mount the SD card
sudo mkdir -p /mnt/sdcard
sudo mount /dev/mmcblk0p1 /mnt/sdcard

# For persistent mounting — add to /etc/fstab:
/dev/mmcblk0p1  /mnt/sdcard  auto  defaults,nofail  0  2

06 — Installation

Debian 13.5 Installation

Image Selection

Selected from beagleboard.org/distros:

  • Image: BeagleBone Black Debian 13.5 2026-05-19 IoT (v6.18.x)
  • Kernel branch: am33x-v6.18
  • U-Boot: v2022.04-bbb.io-am335x-am57xx

Writing to SD Card

xzcat bone-debian-13.5-*.img.xz | sudo dd of=/dev/sdX bs=4M status=progress
sync

Migrating to eMMC

After booting from SD, the image was copied directly to eMMC:

dd if=/mnt/usb/am335x-debian-13.5-base-v6.18-armhf-2026-05-19-4gb.img \
   of=/dev/mmcblk1 bs=4M status=progress
sync

Boot Partition & fstab Fix

# Copy boot partition
sudo dd if=/dev/mmcblk0p1 of=/dev/mmcblk1p1 bs=4M status=progress

# Fix fstab — change mmcblk0 → mmcblk1
sudo mount /dev/mmcblk1p3 /mnt
sudo sed -i 's/mmcblk0/mmcblk1/g' /mnt/etc/fstab

Verification

After removing the SD card and rebooting:

lsblk
mmcblk1      179:0    0  3.6G  0 disk
├─mmcblk1p1  179:1    0   36M  0 part  /boot/firmware
├─mmcblk1p2  179:2    0  512M  0 part  [SWAP]
└─mmcblk1p3  179:3    0    3G  0 part  /
Success

Root filesystem (/) is mounted on mmcblk1p3 (eMMC). SD card no longer present — system boots fully from internal flash.


07 — CAN Bus

CAN Bus Configuration

Locating the Overlay

find /boot -name '*.dtbo' | grep -i can
/boot/dtbs/6.18.32-bone35/overlays/BB-CAN0-00A0.dtbo

Enabling via uEnv.txt

Added the following line to /boot/uEnv.txt:

uboot_overlay_addr4=BB-CAN0-00A0.dtbo

Bringing Up CAN0

sudo ip link set can0 up type can bitrate 500000
ip link show can0
4: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UP

Communication Test

candump can0 &          # listen in background
cansend can0 123#DEADBEEF  # send test frame
can0  123   [4]  DE AD BE EF
ID: 0x123 · 4 bytes · payload: 0xDEADBEEF · interface: CAN0 @ 500 kbps

08 — Issues

Issues & Resolutions

IssueResolution
Debian 7.8 had no SocketCAN supportUpgraded to Debian 13.5
SSH not available in Windows PowerShellUsed PuTTY as SSH client
USB driver not recognized (unknown device)Switched to a different USB port
fstab still pointing to mmcblk0 after eMMC copyFixed with sed command
config-pin not found in Debian 13.5Used uEnv.txt overlay instead
No internet connection on BBB during setupcan-utils was already pre-installed in the image
SD card instability caused boot issuesMigrated OS to eMMC for stable operation

09 — Conclusion

Conclusion

The BeagleBone Black was successfully upgraded from Debian 7.8 to Debian 13.5 (Trixie) with kernel 6.18.32-bone35. The OS was migrated from a microSD card to the internal 4 GB eMMC for long-term stability.

CAN Bus communication was configured using the BB-CAN0-00A0.dtbo device tree overlay with an SN65HVD230 transceiver on pins P9.19 (RX) and P9.20 (TX), and verified at 500 kbps using can-utils.

Current State

System boots from eMMC, CAN0 is active at 500 kbps, and the microSD slot is available for additional project storage when needed.

BeagleBone Black Debian 13.5 Kernel 6.18.32-bone35 SocketCAN SN65HVD230 500 kbps eMMC boot

10 — Session 2

Session 2 — GPIO & CAN Bus Testing

This session focused on building the infrastructure for BBB ↔ ESP32 CAN Bus communication and GPIO-controlled LED testing. Approximately 1 hour was spent resolving GPIO pin compatibility issues caused by API changes in the modern kernel (v6.18).

Session Summary

Achieved

GPIO test on P9.12 (gpiochip0 line 28) — LED on/off/blink successful. CAN interface can0 active at 500 kbit/s, ERROR-ACTIVE (healthy, TX=0 RX=0).

GPIO Pin Map

BBB PingpiochipLineStatus
P9.14gpiochip018I2C / ehrpwm1a — UNAVAILABLE
P9.12gpiochip028Free GPIO — IN USE ✓
Kernel Note

On BBB kernel v6.18, sysfs GPIO (/sys/class/gpio/export) is deprecated. libgpiod v2 API is required. P9.14 was initially attempted but found to be in I2C mode (mode 8) — switched to P9.12 (gpiochip0 line 28).

Issues & Resolutions — Session 2

StepIssueResolution
GPIO export (P9.14)write error: Invalid argument — pin in I2C mode (mode 8)Switched to P9.12 (gpiochip0 line 28)
config-pin commandcommand not found — bb-cape-overlays not available, no internetUsed gpioinfo to scan all chips manually
devmem2 pinmux overridecommand not foundPython /dev/mem approach attempted — restricted in kernel v6.18
sysfs GPIO (gpio50)No such file or directory — P9.12 = mmc0_dat1 (SD card conflict)Scanned with gpioinfo, found gpiochip0 line 28 = P9_12
gpioset v1 syntaxinvalid line value — libgpiod v2.2.1 installedSwitched to gpioset -c /dev/gpiochip0 -t 0 28=1 syntax
Python gpiod blinkgpiod v1 API deprecated (Chip/get_line)Used gpiod.request_lines() v2 API — blink test successful

CAN Interface Status

ParameterValue
Interfacecan0 (BBB internal DCAN — 481cc000.can)
Bitrate500,000 bit/s (matches ESP32)
StateERROR-ACTIVE — healthy, TX=0 RX=0 ✓
Kernel6.18.32-bone35 (Debian Trixie)
Previous testcan0 123 [4] DE AD BE EF — verified in Session 1

Working Commands

GPIO — LED on/off
# LED ON
gpioset -c /dev/gpiochip0 -t 0 28=1 &

# LED OFF
killall gpioset
gpioset -c /dev/gpiochip0 -t 0 28=0 &
GPIO — Python blink test (gpiod v2 API)
python3 -c "
import gpiod, time
with gpiod.request_lines('/dev/gpiochip0', consumer='led',
    config={28: gpiod.LineSettings(
        direction=gpiod.line.Direction.OUTPUT)}) as req:
    for i in range(5):
        req.set_value(28, gpiod.line.Value.ACTIVE)
        time.sleep(0.5)
        req.set_value(28, gpiod.line.Value.INACTIVE)
        time.sleep(0.5)
"
CAN — status & test
ip -details link show can0   # detailed status
candump can0                   # listen mode
cansend can0 123#01            # LED ON command
cansend can0 123#00            # LED OFF command

11 — Next Steps

Next Steps

  • Flash Arduino firmware to ESP32 (TX=GPIO17, RX=GPIO16, 500 kbit/s)
  • Send cansend can0 123#01 from BBB → ESP32 LED turns on
  • Send cansend can0 123#00 from BBB → ESP32 LED turns off
  • Verify signals with logic analyzer (D0=CAN_H, D1=CAN_L, D2=ESP32 TX, D3=ESP32 RX, D4=BBB TX, D5=BBB RX)
  • Develop can_send.c for bidirectional communication
ESP32 TWAI Arduino C++ Logic Analyzer PulseView can_send.c