Skip to content

Compute ‐ Raspberry Pi

JonasFrey96 edited this page Apr 19, 2024 · 40 revisions

We are using the Raspberry Pi Compute Module 4.

Specifications

  • 4GB DDR4 RAM
  • Custom PCB

GPIO Library

https://github.com/joan2937/pigpio http://abyz.me.uk/rpi/pigpio/

Lessons Learned

  • PTP is not straight forward to get running with any Ubuntu Image available (THis I got running with ROS)
  • Therefore using Raspberry Pi OS Lite 64 bit - (This I got running with PTP)
  • Problem here latest version is on Debian Version 12 which does not work with ROS1 Buster

Option 1: Run PI on ROS2 with latest RaspbianOS - Here we can use a docker container for ROS2 installation Option 2: PTP should work also with Debian 10 Buster version of Image and ROS 1 supported (https://github.com/twteamware/raspberrypi-ptp/issues/9)

Flashing the PI with Debian 12

Follow this: https://www.jeffgeerling.com/blog/2020/how-flash-raspberry-pi-os-compute-module-4-emmc-usbboot

  • Use the development board
  • Connect directly to EMMC via USB cable
sudo apt install libusb-1.0-0-dev
cd git
git clone --depth=1 https://github.com/raspberrypi/usbboot
cd usbboot
make

Set jumper to disable eMMC boot Verify good USB micro USB cable Power cycle the dev board

sudo ./rpiboot

Install the RPI Imager

sudo snap install rpi-imager

Raspberry Pi OS Lite 64 bit

rsl@pi:~ $ cat /etc/os-release 
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm

Static IP Configuration Debian 12

Copy to sudo vi /etc/network/interfaces

auto eth0
iface eth0 inet static
    address 192.168.2.57
    netmask 255.255.255.0
    gateway 192.168.2.51
    dns-nameservers 8.8.8.8

PTP Debian 12

Follow tutorial here: https://github.com/jclark/rpi-cm4-ptp-guide/blob/main/os.md

Make the changes to the sudo raspi-config

Then append to /boot/firmware/config.txt

# Enable GPIO pin 18 for PPS (not always necessary, but useful for testing)
dtoverlay=pps-gpio,gpiopin=18
# realtime clock
dtoverlay=i2c-rtc,pcf85063a,i2c_csi_dsi
# fan
dtoverlay=i2c-fan,emc2301,i2c_csi_dsi
# Make /dev/ttyAMA0 be connected to GPIO header pins 8 and 10
# This always disables Bluetooth
dtoverlay=disable-bt
sudo systemctl disable hciuart
sudo dpkg-reconfigure tzdata

Check things

ethtool -T eth0
sudo hwclock --show

Copy over the two ptp services:

Run:

sudo box_configuration/pi/pi_configure.sh

PTP should now be working

Creates two system services. The exact configuration that needs to e added can be found in th ebox configuration. PTP is responsible for timesync between PCs And phc2sys is responsible to synchronize from hardware clock (of ethernet device) to the system clock. The service files need to be copied to: /lib/systemd/system

systemctl status phc2sys_eth0.service
systemctl status ptp4l_eth0.service

Small things change hostname

hostnamectl set-hostname pi

Responsibilities

  • Fan Control
  • Triggering of HDR cameras
  • Sending HDR camera trigger timestamp to NUC
  • Housing Temperature Sensing

Connections

Software

  • OS:
  • ROS Version:

/lib/systemd/system/pigpiod.service pigpiod -s 10

Documentation should contain

  • PTP
  • Kernel Driver ASL - Camera Driver Timestampen RTK?
  • IP
  • ROS1
  • IIO Driver - NTC-Temperature
  • Fan Speed Controller
  • ADIS/STIM

Instructions

Flashen

ROS Installation: Tutorial here

Create GitHub repo for the timer_stamper - Create fork with two branches and include twice as submodules.

time_stamper_adis16475 time_stamper_camera_trigger

build each of the repositories and add the .ko file to the kernel or so ?

PCB

grand_tour_pi_breakout_board.pdf

Links

Clone this wiki locally