UP  |  HOME
RSS | RSS Complete

ragna (Raspberry Pi 4 B)

Table of Contents

Summary

TODO

Notes

TODO

Hardware

Make Raspberry Pi
Year 2019
Model 4 B
Chassis Okdo Case
Power Supply Raspberry Pi 5V USB C
Processor BCM2711
Memory 2GB
Ports 2x Micro HDMI
  RJ-45 LAN
  3.5mm Line Out
  2x USB 3.0
  2x USB 2.0
  USB C Power
Graphics VideoCore VI
Storage 32GB Micro SD
Dimensions  
Length/Depth 9.4 cm
Width 6.3 cm
Height/Thickness 3.2 cm
Weight kg (lbs oz)

Software

Operating System  
Unique applications  

Log

[2022-01-10 Mon] Installing Debian on Pi 4

According to https://wiki.debian.org/RaspberryPi4#Using_EFI_Firmware_and_the_regular_Debian_Installer follow the guide at https://forums.raspberrypi.com/viewtopic.php?t=282839&sid=32b6a47b8ded89b64bd1b4a967389655

  1. Pick the install media which will also be the OS drive (>16GB)
  2. Create a EFI System partition (ESP) and format it FAT32
  3. Copy the Debian netinstall iso files and RPi UEFI Firmware files (note there are hidden files to be included, .disk)
  4. Plug in media and boot the Pi
  5. Manually select device for install media. Choose none, then enter: -t vfat -o rw /dev/mmcblk1p1
  6. Customize partitioning (32GB total): 16GB /, 4GB /var, 2GB swap, 2.5GB /tmp, 6GB /home. Make sure to leave ESP partition. Debian partition should NOT create a second one. If so you failed to set the partition type or mark it as a system partition.

[2022-01-10 Mon] UEFI firmware won't boot headless

Set hdmi_force_hotplug to 1 in /boot/EFI/config.txt because the boot gets broken with no display attached. From https://github.com/pftf/RPi4/issues/162

[2022-01-10 Mon] Learning that GPIO support isn't mainline

Note: Before you try to do any of this on a mainline kernel there isn't actually any support for doing GPIO with these libraries. As far as I can see it's a dead end and you should run the raspberry pi kernel if you want to do GPIO things at the moment.

Device tree overlays

Where do they come from?
DTS source files in the pi kernel tree. https://github.com/raspberrypi/linux/blob/rpi-5.10.y/arch/arm/boot/dts/overlays/
How do you combine them?
fdtoverlay seems like a command to do this, but I didn't try it.

I compile an overlay like:

dtc -@ -I dts -O dtb -o gpio-shutdown.dtbo gpio-shutdown-overlay.dts
mv gpio-shutdown.dtbo /boot/efi/overlays/

Then modify /boot/efi/config.txt dtoverlay line to gpio-shutdown.

I boot and nothing works. I tried loading gpio_keys module. gpioinfo doesn't say anything useful.

Debian bullseye release libs (rpi.gpio and gpiozero) are too old to support pi 4. I fetched the dsc from bookworm release packages and built those. Something like this:

dget ....dsc
apt-get build-deps ...

Manually install new build-deps.

dget new deps
debuild -i -us -uc
dpkg -i ../*.deb

Build and install things.

This turned out to be an utter waste of time. rpi.gpio bombs because it tries to figure out what kind of pi it's on based on /proc/cpuinfo and mainline kernel seems to give a very sparse cpuinfo report.

I hardcoded the test to succeed, and return a pi 4 and tried to run my script. This got further along, but gpiozero does it's own /proc probing, and I gave up on trying to modify it.

I thought for a bit this might have to do with the wrong device tree so I manually specified it in /boot/efi/config.txt, but it made no difference.

Tried upgrading to Debian testing (bookworm ~12) for kicks. This puts me on Linux 5.15.5. Nothing changes about the GPIO situation.