https://elinux.org/api.php?action=feedcontributions&user=JetForMe&feedformat=atomeLinux.org - User contributions [en]2024-03-29T01:20:26ZUser contributionsMediaWiki 1.31.0https://elinux.org/index.php?title=Beagleboard:BeagleBoneBlack_Debian&diff=461636Beagleboard:BeagleBoneBlack Debian2018-02-09T20:15:05Z<p>JetForMe: Added link to Flashing eMMC section in note added under Testing images section.</p>
<hr />
<div>[[Category: Linux]]<br />
[[Category: OMAP]]<br />
[[Category:Development Boards]]<br />
[[Category: BeagleBoard]]<br />
This page is about running the [https://wiki.debian.org/ArmHardFloatPort armhf] port of [http://www.debian.org/ Debian] distribution at [[BeagleBoard]]. The latest release beagleboard.org image can be found at: http://beagleboard.org/latest-images<br />
<br />
= Checking The Debian Image Version =<br />
<br />
You should check the version of the image on the microSD/eMMC by opening the ID.txt file in the FAT partition.<br />
<br />
root@beaglebone:~# cat /etc/dogtag<br />
BeagleBoard.org BeagleBone Debian Image 2014-03-19<br />
<br />
This file can also be accessed via a PC (Windows/Mac/Linux) via either mounting the FAT partition directly off the microSD card or via the usb interface (flash drive).<br />
<br />
= Installing =<br />
<br />
== Oracle Java 8 ==<br />
<br />
Information:<br />
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html<br />
<br />
Install:<br />
sudo apt-get update<br />
sudo apt-get install oracle-java8-installer<br />
<br />
Verify:<br />
debian@beaglebone:~$ java -version<br />
java version "1.8.0_151"<br />
Java(TM) SE Runtime Environment (build 1.8.0_151-b12)<br />
Java HotSpot(TM) Client VM (build 25.151-b12, mixed mode)<br />
<br />
Oracle Java 9: no ARM binaries listed: http://www.oracle.com/technetwork/java/javase/downloads/jdk9-downloads-3848520.html<br />
<br />
== TI PRU Code Generation Tools ==<br />
<br />
http://software-dl.ti.com/codegen/non-esd/downloads/download.htm#PRU<br />
<br />
Install:<br />
sudo apt-get update<br />
sudo apt-get install ti-pru-cgt-installer<br />
<br />
Older rootfs (when above package doesn't exist):<br />
wget http://downloads.ti.com/codegen/esd/cgt_public_sw/PRU/2.1.1/ti_cgt_pru_2.1.1_armlinuxa8hf_busybox_installer.sh<br />
chmod +x ti_cgt_pru_2.1.1_armlinuxa8hf_busybox_installer.sh<br />
sudo ./ti_cgt_pru_2.1.1_armlinuxa8hf_busybox_installer.sh<br />
<br />
= FAQ =<br />
<br />
== PocketBeagle Support ==<br />
Any images after 2017-09-21 will have support for the [https://beagleboard.org/pocket PocketBeagle]<br />
<br />
== Expanding File System Partition On A microSD ==<br />
By default the microSD image is only about 2GB in size, to fully expand the partition to the full size of your microSD card simple run.<br />
<br />
cd /opt/scripts/tools/<br />
git pull || true<br />
sudo ./grow_partition.sh<br />
sudo reboot<br />
<br />
On the next reboot, [df -h] should show the full microSD card size.<br />
<br />
== Flashing eMMC ==<br />
To set up the standalone microSD image to automatically flash the eMMC on powerup. Login as debian (password = temppwd) and edit /boot/uEnv.txt with nano (sudo nano /boot/uEnv.txt) or your preferred editor.<br />
<br />
In /boot/uEnv.txt:<br />
##enable BBB: eMMC Flasher:<br />
#cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh<br />
<br />
Change to:<br />
##enable BBB: eMMC Flasher:<br />
cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh<br />
<br />
Optional, update Flasher Scripts:<br />
cd /opt/scripts/<br />
git pull<br />
<br />
and reboot the system, it'll flash the eMMC on the next bootup. (make sure to remove the microSD after flashing is complete, otherwise it'll just keep on re-flashing the eMMC)<br />
<br />
== Kernel Upgrade ==<br />
We can't ship support for everything on release day, so we push out new kernels as fixes, support for new capes, etc are posted on the beagleboard.org mainline list.<br />
<br />
cd /opt/scripts/tools/<br />
git pull<br />
sudo ./update_kernel.sh<br />
sudo reboot<br />
<br />
=== Installing kernel headers ===<br />
If you want to build a kernel module natively, you'll need to install the correct kernel headers.<br />
<br />
sudo apt-get install linux-headers-`uname -r`<br />
<br />
In a Makefile, perform:<br />
<br />
sudo apt-get install linux-headers-$(shell uname -r)<br />
<br />
== Loading custom capes ==<br />
<br />
'''WARNING, this is now deprecated, please use U-Boot overlays'''<br />
<br />
Due to limitations in debian wheezy's userspace, the use of an initramfs, and having firmware builtin to the kernel. It is currently not possible to load "custom" capes via: capemgr.enable_partno=xyz. Instead an init script has been set up to load the cape/capes as soon as possible.<br />
<br />
Built-in Cape:<br />
capemgr.enable_partno=BB-SPIDEV1<br />
<br />
slot #7: Requesting part number/version based 'BB-SPIDEV1-00A0.dtbo<br />
slot #7: Requesting firmware 'BB-SPIDEV1-00A0.dtbo' for board-name 'Override Board Name', version '00A0'<br />
slot #7: dtbo 'BB-SPIDEV1-00A0.dtbo' loaded; converting to live tree<br />
<br />
Custom External Cape:<br />
capemgr.enable_partno=BB-SPI1-01<br />
<br />
slot #7: Requesting part number/version based 'BB-SPI1-01-00A0.dtbo<br />
slot #7: Requesting firmware 'BB-SPI1-01-00A0.dtbo' for board-name 'Override Board Name', version '00A0'<br />
failed to load firmware 'BB-SPI1-01-00A0.dtbo'<br />
loader: failed to load slot-7 BB-SPI1-01:00A0 (prio 0)<br />
<br />
Workaround:<br />
add "CAPE=BB-SPI1-01" to /etc/default/capemgr<br />
<br />
== Privileged echo ==<br />
As a normal user, you can not "sudo echo 'something' >> /etc/privilegedfile"<br />
<br />
sudo sh -c "echo 'something' >> /etc/privilegedfile"<br />
<br />
== Timezone ==<br />
By default this image is set up to display time in [http://en.wikipedia.org/wiki/Coordinated_Universal_Time utc] mode. If you would like to change this to your local region.<br />
<br />
dpkg-reconfigure tzdata<br />
<br />
or:<br />
echo "Europe/Zurich" > /etc/timezone <br />
dpkg-reconfigure -f noninteractive tzdata<br />
<br />
=== Jessie Timezone ===<br />
<br />
List of available timezones:<br />
timedatectl list-timezones<br />
<br />
Set timezone:<br />
sudo timedatectl set-timezone America/North_Dakota/Center<br />
<br />
== W: GPG error: http://debian.beagleboard.org wheezy-bbb ==<br />
<br />
W: GPG error: http://debian.beagleboard.org wheezy-bbb Release:<br />
The following signatures were invalid:<br />
KEYEXPIRED 1418840246 KEYEXPIRED 1418840304 KEYEXPIRED 1418840246 KEYEXPIRED 1418840246 KEYEXPIRED 1418840304<br />
<br />
Note this directions are version dependent, so double check your version:<br />
<br />
debian@beaglebone:~$ cat /etc/dogtag <br />
BeagleBoard.org BeagleBone Debian Image 2014-05-14<br />
<br />
=== 2014-05-14 GPG error: Disable: http://debian.beagleboard.org repo: ===<br />
<br />
sudo nano /etc/apt/sources.list<br />
<br />
Change:<br />
deb [arch=armhf] http://debian.beagleboard.org/packages wheezy-bbb main<br />
#deb-src [arch=armhf] http://debian.beagleboard.org/packages wheezy-bbb main<br />
<br />
To:<br />
#deb [arch=armhf] http://debian.beagleboard.org/packages wheezy-bbb main<br />
#deb-src [arch=armhf] http://debian.beagleboard.org/packages wheezy-bbb main<br />
<br />
sudo apt-get update<br />
<br />
=== 2014-05-14 GPG error: Optional enable: http://repos.rcn-ee.com/ ===<br />
<br />
Download archive-keyring:<br />
wget https://rcn-ee.com/repos/debian/pool/main/r/rcn-ee-archive-keyring/rcn-ee-archive-keyring_2016.04.24~bpo70+20160424+1_all.deb<br />
sudo dpkg -i rcn-ee-archive-keyring_*_all.deb<br />
<br />
Add repo to /etc/apt/sources.list<br />
sudo sh -c "echo 'deb [arch=armhf] http://repos.rcn-ee.com/debian wheezy main' >> /etc/apt/sources.list"<br />
sudo sh -c "echo '#deb-src [arch=armhf] http://repos.rcn-ee.com/debian wheezy main' >> /etc/apt/sources.list"<br />
<br />
Update packages:<br />
sudo apt-get update<br />
sudo apt-get upgrade<br />
sudo apt-get install npm c9-core-installer --reinstall<br />
<br />
== Adding bb.org-overlays to jessie console image ==<br />
<br />
Currently by default, the console image doesn't include the *.dtbo overlays.<br />
<br />
Install build requirements: (add's 145Mb to the console image)<br />
sudo apt-get update<br />
sudo apt-get install build-essential git-core device-tree-compiler<br />
<br />
Clone bb.org-overlays repo:<br />
git clone https://github.com/beagleboard/bb.org-overlays/<br />
cd ./bb.org-overlays/<br />
./install.sh<br />
<br />
== i take full responsibility for knowing my beagle is now insecure ==<br />
<br />
as of 2017-02-19, BeagleBoard images now longer enable these insecure options by default, you are free to recreate them as you wish.<br />
<br />
=== remove root password ===<br />
root_password=$(cat /etc/shadow | grep root | awk -F ':' '{print $2}')<br />
sed -i -e 's:'$root_password'::g' /etc/shadow<br />
<br />
=== ssh root@beaglebone.local ===<br />
sed -i -e 's:PermitEmptyPasswords no:PermitEmptyPasswords yes:g' /etc/ssh/sshd_config<br />
sed -i -e 's:UsePAM yes:UsePAM no:g' /etc/ssh/sshd_config<br />
sed -i -e 's:PermitRootLogin without-password:PermitRootLogin yes:g' /etc/ssh/sshd_config<br />
<br />
=== sudo no password required ===<br />
echo "debian ALL=NOPASSWD: ALL" >>/etc/sudoers<br />
<br />
== U-Boot Overlays ==<br />
<br />
Check via serial<br />
U-Boot SPL 2018.01-rc2-00002-g23388d96ac (Dec 19 2017 - 13:20:06)<br />
Trying to boot from MMC1<br />
<br />
U-Boot 2018.01-rc2-00002-g23388d96ac (Dec 19 2017 - 13:20:06 -0600), Build: jenkins-github_Bootloader-Builder-19<br />
<br />
Check via system<br />
debian@beaglebone:~$ cd /opt/scripts/tools/<br />
debian@beaglebone:/opt/scripts/tools$ git pull<br />
debian@beaglebone:/opt/scripts/tools$ sudo ./version.sh | grep bootloader<br />
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2018.01-rc2-00002-g23388d]<br />
<br />
To upgrade your version of U-Boot:<br />
debian@beaglebone:~$ cd /opt/scripts/tools/developers/<br />
debian@beaglebone:/opt/scripts/tools/developers$ sudo ./update_bootloader.sh<br />
debian@beaglebone:/opt/scripts/tools/developers$ sudo reboot<br />
<br />
=== U-Boot Capes added: ===<br />
NHD-7.0CTP-CAPE Family<br />
BB-BONE-NH7C-01-A0.dtbo (first added in: 2017.05-rc2-00002-g86566339a9 (Apr 28 2017 - 10:18:57))<br />
<br />
=== U-Boot /boot/uEnv.txt configuration ===<br />
<br />
/boot/uEnv.txt:<br />
enable_uboot_overlays=1<br />
<br />
=== U-Boot Disable on-board devices ===<br />
To Disable eMMC:<br />
disable_uboot_overlay_emmc=1<br />
<br />
To Disable HDMI VIDEO & AUDIO:<br />
disable_uboot_overlay_video=1<br />
<br />
To Disable HDMI AUDIO:<br />
disable_uboot_overlay_audio=1<br />
<br />
To Disable WL1835:<br />
disable_uboot_overlay_wireless=1<br />
<br />
To Disable BB-ADC: (first added in: 2017.05-rc1-00002-g35aecb22fe (Apr 05 2017 - 16:51:58))<br />
disable_uboot_overlay_adc=1<br />
<br />
=== U-Boot Override external capes ===<br />
Cape device tree overlays (src): https://github.com/beagleboard/bb.org-overlays/<br />
Debian package: bb-cape-overlays<br />
<br />
uboot_overlay_addr0=/lib/firmware/<file0>.dtbo<br />
uboot_overlay_addr1=/lib/firmware/<file1>.dtbo<br />
uboot_overlay_addr2=/lib/firmware/<file2>.dtbo<br />
uboot_overlay_addr3=/lib/firmware/<file3>.dtbo<br />
<br />
If for some reason you need to disable the auto-loading of any of ^ those, use the option that matches your addrX: (first added in: 2017.03-00002-gbfe60d6057 (Mar 28 2017 - 15:32:51))<br />
disable_uboot_overlay_addr0=1<br />
disable_uboot_overlay_addr1=1<br />
disable_uboot_overlay_addr2=1<br />
disable_uboot_overlay_addr3=1<br />
<br />
4 more capes can be loaded via: (first added in: 2017.03-00002-gbfe60d6057 (Mar 28 2017 - 15:32:51))<br />
uboot_overlay_addr4=/lib/firmware/<file4>.dtbo<br />
uboot_overlay_addr5=/lib/firmware/<file5>.dtbo<br />
uboot_overlay_addr6=/lib/firmware/<file6>.dtbo<br />
uboot_overlay_addr7=/lib/firmware/<file7>.dtbo<br />
<br />
Plus one custom cape:<br />
dtb_overlay=/lib/firmware/<file8>.dtbo<br />
<br />
=== U-Boot PRU Options ===<br />
<br />
With v4.4.x-ti PRU via remoteproc can be enabled by:<br />
uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-4-TI-00A0.dtbo<br />
<br />
With mainline (boneX) PRU via uio (doesn't work with v4.9.x-ti yet)<br />
uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo<br />
<br />
=== U-Boot Cape Universal ===<br />
Utilize https://github.com/cdsteinkuehler/beaglebone-universal-io config-pin.<br />
<br />
Cape Universal Supported Boards:<br />
BeagleBone Black<br />
BeagleBone Black Wireless<br />
BeagleBone Green<br />
BeagleBone Green Wireless<br />
Element14 BeagleBone Black Industrial<br />
MENTOREL BeagleBone uSomIQ<br />
SanCloud BeagleBone Enhanced<br />
<br />
Not Supported needs work/testing/etc<br />
Arrow BeagleBone Black Industrial (different video phy)<br />
Neuromeka BeagleBone Air (untested)<br />
<br />
To enable, in /boot/uEnv.txt add:<br />
enable_uboot_cape_universal=1<br />
<br />
== Where did the slots file go? ==<br />
Kernel Overlays are going bye-bye, too many bugs, too many race conditions, no kernel maintainers interested. We've said our farewells and U-Boot Overlays is the way forward: https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_Overlays With multiple parties working on the U-Boot infrastructure.<br />
<br />
The rough transition plan is:<br />
<br />
Stage 1: Disable Kernel Overlays (bone_capemgr.uboot_capemgr_enabled=1 is passed thru /proc/cmdline)<br />
Stage 2: Disable the slots file (/sys/devices/platform/bone_capemgr/slots) (v4.4.x -> 4.14.x)<br />
Stage 3: Disable bone_capemgr dir (/sys/devices/platform/bone_capemgr/) (v4.15.x+)<br />
<br />
Stage 1 is complete, all current images use U-Boot Overlays by default. Stage 2 is currently in progress, as it is not recommended to "load" anything into the slots file while U-Boot Overlays are in control. Stage 3, will take longer, as many applications only need to know the "bone_capemgr" directory is available.<br />
<br />
''If you don't like the direction we are heading, simply disable, "enable_uboot_overlays=1" in /boot/uEnv.txt..'' <br />
<br />
#I will be on my own with Kernel Overlays:<br />
#enable_uboot_overlays=1<br />
<br />
= Debian Build Instructions =<br />
<br />
You'll want a fairly beefy ARM system to run this script.<br />
<br />
git clone git://github.com/beagleboard/image-builder.git<br />
cd image-builder<br />
./beagleboard.org_image.sh<br />
<br />
Output of the autobuilder can be found at http://builds.beagleboard.org.<br />
<br />
= Debian Releases =<br />
http://beagleboard.org/latest-images<br />
<br />
= Debian Image Testing Snapshots =<br />
<br />
To turn “microSD/Standalone” images into eMMC flasher images, edit the '''/boot/uEnv.txt''' file on the Linux partition on the microSD card and uncomment the line with '''cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh'''. Enabling this will cause booting the microSD card to flash the eMMC. “Flasher” images already enable this line. See [[BeagleBoneBlack_Debian#Flashing_eMMC| Flashing eMMC]]<br />
<br />
== 2018-02-01 - Debian 8 (Jessie) - Monthly ==<br />
<br />
=== BBW/BBB (All Revs) Machinekit ===<br />
<br />
==== microSD/Standalone: (machinekit) Based on Debian Jessie with 3.8.x kernel ====<br />
Get prebuilt image:<br />
wget https://rcn-ee.com/rootfs/bb.org/testing/2017-02-12/machinekit/bone-debian-8.7-machinekit-armhf-2017-02-12-4gb.img.xz<br />
<br />
Verify Image with:<br />
sha256sum bone-debian-8.7-machinekit-armhf-2017-02-12-4gb*<br />
18361e0426715974b5a0e7f014ff1bf26db2421cbf8d61622efd2856cd8c6214 bone-debian-8.7-machinekit-armhf-2017-02-12-4gb.img.xz<br />
<br />
Windows/Mac/Linux gui<br />
http://etcher.io<br />
<br />
Linux: (dd)<br />
xzcat bone-debian-8.7-machinekit-armhf-2017-02-12-4gb.img.xz | sudo dd of=/dev/sdX<br />
<br />
=== Jessie Snapshot lxqt ===<br />
<br />
2018-02-01 notes<br />
* U-Boot: v2018.01<br />
* default username:password is [debian:temppwd]<br />
<br />
==== Flasher: (lxqt-4gb) (All BeagleBone Variants with a 4GB eMMC) ====<br />
* Kernel: 4.4.113-ti-r145<br />
<br />
Get prebuilt image:<br />
wget https://rcn-ee.com/rootfs/bb.org/testing/2018-02-01/lxqt-4gb/BBB-blank-debian-8.10-lxqt-4gb-armhf-2018-02-01-4gb.img.xz<br />
<br />
Verify Image with:<br />
sha256sum BBB-blank-debian-8.10-lxqt-4gb-armhf-2018-02-01-4gb*<br />
ab166302beada41fad706529344c88ccec0b8a84393d6544fed46053c6f1e230 BBB-blank-debian-8.10-lxqt-4gb-armhf-2018-02-01-4gb.img.xz<br />
<br />
Windows/Mac/Linux gui<br />
http://etcher.io<br />
<br />
Linux: (dd)<br />
xzcat BBB-blank-debian-8.10-lxqt-4gb-armhf-2018-02-01-4gb.img.xz | sudo dd of=/dev/sdX<br />
<br />
==== microSD/Standalone: (lxqt-4gb) (All BeagleBone Variants & PocketBeagle) ====<br />
* Kernel: 4.4.113-ti-r145<br />
<br />
Get prebuilt image:<br />
wget https://rcn-ee.com/rootfs/bb.org/testing/2018-02-01/lxqt-4gb/bone-debian-8.10-lxqt-4gb-armhf-2018-02-01-4gb.img.xz<br />
<br />
Verify Image with:<br />
sha256sum bone-debian-8.10-lxqt-4gb-armhf-2018-02-01-4gb*<br />
5593788b55811975979223b4add180a585b31280cc12cac024263b2af162c497 bone-debian-8.10-lxqt-4gb-armhf-2018-02-01-4gb.img.xz<br />
<br />
Windows/Mac/Linux gui<br />
http://etcher.io<br />
<br />
Linux: (dd)<br />
xzcat bone-debian-8.10-lxqt-4gb-armhf-2018-02-01-4gb.img.xz | sudo dd of=/dev/sdX<br />
<br />
==== microSD/Standalone: (lxqt-4gb) (BeagleBoard-X15) ====<br />
* Kernel: 4.4.113-ti-r145<br />
<br />
Get prebuilt image:<br />
wget https://rcn-ee.com/rootfs/bb.org/testing/2018-02-01/lxqt-4gb/bbx15-debian-8.10-lxqt-4gb-armhf-2018-02-01-4gb.img.xz<br />
<br />
Verify Image with:<br />
sha256sum bbx15-debian-8.10-lxqt-4gb-armhf-2018-02-01-4gb*<br />
dfe30d3e577f3c2843a1d708d71a0b89b932be4bddbc0adb04fadcf2b03c68d5 bbx15-debian-8.10-lxqt-4gb-armhf-2018-02-01-4gb.img.xz<br />
<br />
Windows/Mac/Linux gui<br />
http://etcher.io<br />
<br />
Linux: (dd)<br />
xzcat bbx15-debian-8.10-lxqt-4gb-armhf-2018-02-01-4gb.img.xz | sudo dd of=/dev/sdX<br />
<br />
==== microSD/Standalone: (lxqt-2gb) (All BeagleBone Variants & PocketBeagle) ====<br />
* Kernel: 4.4.113-ti-r145<br />
<br />
Get prebuilt image:<br />
wget https://rcn-ee.com/rootfs/bb.org/testing/2018-02-01/lxqt-2gb/bone-debian-8.10-lxqt-2gb-armhf-2018-02-01-2gb.img.xz<br />
<br />
Verify Image with:<br />
sha256sum bone-debian-8.10-lxqt-2gb-armhf-2018-02-01-2gb*<br />
e8d77ccfe39077bc8ef61222ab98abe613e5859a276f3b4ab53167ac544bd312 bone-debian-8.10-lxqt-2gb-armhf-2018-02-01-2gb.img.xz<br />
<br />
Windows/Mac/Linux gui<br />
http://etcher.io<br />
<br />
Linux: (dd)<br />
xzcat bone-debian-8.10-lxqt-2gb-armhf-2018-02-01-2gb.img.xz | sudo dd of=/dev/sdX<br />
<br />
==== Flasher: (lxqt-2gb) (All BeagleBone Variants) ====<br />
* Kernel: 4.4.113-ti-r145<br />
<br />
Get prebuilt image:<br />
wget https://rcn-ee.com/rootfs/bb.org/testing/2018-02-01/lxqt-2gb/BBB-blank-debian-8.10-lxqt-2gb-armhf-2018-02-01-2gb.img.xz<br />
<br />
Verify Image with:<br />
sha256sum BBB-blank-debian-8.10-lxqt-2gb-armhf-2018-02-01-2gb*<br />
37e0ae27dd33532ca9dc7ce7f32c70bf583780429cc071b97d29e3b1c6d6afd3 BBB-blank-debian-8.10-lxqt-2gb-armhf-2018-02-01-2gb.img.xz<br />
<br />
Windows/Mac/Linux gui<br />
http://etcher.io<br />
<br />
Linux: (dd)<br />
xzcat BBB-blank-debian-8.10-lxqt-2gb-armhf-2018-02-01-2gb.img.xz | sudo dd of=/dev/sdX<br />
<br />
==== microSD/Standalone: (lxqt-xm-4gb) (BeagleBoard xM) ====<br />
* Kernel: 4.14.16-armv7-x4<br />
<br />
Get prebuilt image:<br />
wget https://rcn-ee.com/rootfs/bb.org/testing/2018-02-01/lxqt-xm-4gb/bbxm-debian-8.10-lxqt-xm-4gb-armhf-2018-02-01-4gb.img.xz<br />
<br />
Verify Image with:<br />
sha256sum bbxm-debian-8.10-lxqt-xm-4gb-armhf-2018-02-01-4gb*<br />
7204275af42527f89c500da58b9f91698efddfa51e680f6cd48e63d389ddda38 bbxm-debian-8.10-lxqt-xm-4gb-armhf-2018-02-01-4gb.img.xz<br />
<br />
Windows/Mac/Linux gui<br />
http://etcher.io<br />
<br />
Linux: (dd)<br />
xzcat bbxm-debian-8.10-lxqt-xm-4gb-armhf-2018-02-01-4gb.img.xz | sudo dd of=/dev/sdX<br />
<br />
=== Jessie Snapshot iot ===<br />
<br />
==== Flasher: (iot) (All BeagleBone Variants) ====<br />
* Kernel: 4.4.113-ti-r145<br />
<br />
Get prebuilt image:<br />
wget https://rcn-ee.com/rootfs/bb.org/testing/2018-02-01/iot/BBB-blank-debian-8.10-iot-armhf-2018-02-01-4gb.img.xz<br />
<br />
Verify Image with:<br />
sha256sum BBB-blank-debian-8.10-iot-armhf-2018-02-01-4gb*<br />
2c72eaf332fb799c91d88bb38f75e099500de5fefce2f86e542caf12b8a12318 BBB-blank-debian-8.10-iot-armhf-2018-02-01-4gb.img.xz<br />
<br />
Windows/Mac/Linux gui<br />
http://etcher.io<br />
<br />
Linux: (dd)<br />
xzcat BBB-blank-debian-8.10-iot-armhf-2018-02-01-4gb.img.xz | sudo dd of=/dev/sdX<br />
<br />
==== microSD/Standalone: (iot) (All BeagleBone Variants & PocketBeagle) ====<br />
* Kernel: 4.4.113-ti-r145<br />
<br />
Get prebuilt image:<br />
wget https://rcn-ee.com/rootfs/bb.org/testing/2018-02-01/iot/bone-debian-8.10-iot-armhf-2018-02-01-4gb.img.xz<br />
<br />
Verify Image with:<br />
sha256sum bone-debian-8.10-iot-armhf-2018-02-01-4gb*<br />
857708a018044facf177e6e8fd8aca772b45f872a5f1cf998036c91927081925 bone-debian-8.10-iot-armhf-2018-02-01-4gb.img.xz<br />
<br />
Windows/Mac/Linux gui<br />
http://etcher.io<br />
<br />
Linux: (dd)<br />
xzcat bone-debian-8.10-iot-armhf-2018-02-01-4gb.img.xz | sudo dd of=/dev/sdX<br />
<br />
==== microSD/Standalone: (iot) (BeagleBoard-X15) ====<br />
* Kernel: 4.4.113-ti-r145<br />
<br />
Get prebuilt image:<br />
wget https://rcn-ee.com/rootfs/bb.org/testing/2018-02-01/iot/bbx15-debian-8.10-iot-armhf-2018-02-01-4gb.img.xz<br />
<br />
Verify Image with:<br />
sha256sum bbx15-debian-8.10-iot-armhf-2018-02-01-4gb*<br />
8af94acd35f3b4c4aaaa1714e3d372f9c1942b24b2ca3fc6392ab2beb6236b87 bbx15-debian-8.10-iot-armhf-2018-02-01-4gb.img.xz<br />
<br />
Windows/Mac/Linux gui<br />
http://etcher.io<br />
<br />
Linux: (dd)<br />
xzcat bbx15-debian-8.10-iot-armhf-2018-02-01-4gb.img.xz | sudo dd of=/dev/sdX<br />
<br />
=== Jessie Snapshot console ===<br />
<br />
==== microSD/Standalone: (console) (All BeagleBone Variants & PocketBeagle) ====<br />
* Kernel: 4.4.113-ti-r145<br />
<br />
Get prebuilt image:<br />
wget https://rcn-ee.com/rootfs/bb.org/testing/2018-02-01/console/bone-debian-8.10-console-armhf-2018-02-01-1gb.img.xz<br />
<br />
Verify Image with:<br />
sha256sum bone-debian-8.10-console-armhf-2018-02-01-1gb*<br />
992cedbdb180b83ca42729449c8490632071dcd24a7e14b3983e6a46135de099 bone-debian-8.10-console-armhf-2018-02-01-1gb.img.xz<br />
<br />
Windows/Mac/Linux gui<br />
http://etcher.io<br />
<br />
Linux: (dd)<br />
xzcat bone-debian-8.10-console-armhf-2018-02-01-1gb.img.xz | sudo dd of=/dev/sdX<br />
<br />
==== microSD/Standalone: (console) (BeagleBoard-X15) ====<br />
* Kernel: 4.4.113-ti-r145<br />
<br />
Get prebuilt image:<br />
wget https://rcn-ee.com/rootfs/bb.org/testing/2018-02-01/console/bbx15-debian-8.10-console-armhf-2018-02-01-1gb.img.xz<br />
<br />
Verify Image with:<br />
sha256sum bbx15-debian-8.10-console-armhf-2018-02-01-1gb*<br />
b68d7cd7dbf290537fb8c2475c62db5be4b636928e43e6673fff6def5a0d8e3a bbx15-debian-8.10-console-armhf-2018-02-01-1gb.img.xz<br />
<br />
Windows/Mac/Linux gui<br />
http://etcher.io<br />
<br />
Linux: (dd)<br />
xzcat bbx15-debian-8.10-console-armhf-2018-02-01-1gb.img.xz | sudo dd of=/dev/sdX<br />
<br />
== 2018-02-04 - Debian 9 (Stretch) - Weekly ==<br />
<br />
https://wiki.debian.org/DebianStretch<br />
<br />
2018-02-04 notes<br />
* U-Boot: v2018.01<br />
* default username:password is [debian:temppwd]<br />
<br />
=== BBW/BBB (All Revs) Machinekit ===<br />
<br />
==== microSD/Standalone: (machinekit) Based on Debian Stretch with 4.14.x rt kernel with U-Boot Overlays====<br />
Get prebuilt image:<br />
wget https://rcn-ee.com/rootfs/bb.org/testing/2018-02-04/stretch-machinekit/bone-debian-9.3-machinekit-armhf-2018-02-04-4gb.img.xz<br />
<br />
Verify Image with:<br />
sha256sum bone-debian-9.3-machinekit-armhf-2018-02-04-4gb*<br />
3480e74c9ca2a5014ae8e8d42d7457e6f89823772b6992a272ba16dffa15d2d9 bone-debian-9.3-machinekit-armhf-2018-02-04-4gb.img.xz<br />
<br />
Windows/Mac/Linux gui<br />
http://etcher.io<br />
<br />
Linux: (dd)<br />
xzcat bone-debian-9.3-machinekit-armhf-2018-02-04-4gb.img.xz | sudo dd of=/dev/sdX<br />
<br />
=== Stretch Snapshot lxqt ===<br />
<br />
==== Flasher: (stretch-lxqt) (All BeagleBone Variants with a 4GB eMMC) ====<br />
* Kernel: 4.9.79-ti-r96<br />
<br />
Get prebuilt image:<br />
wget https://rcn-ee.com/rootfs/bb.org/testing/2018-02-04/stretch-lxqt/BBB-blank-debian-9.3-lxqt-armhf-2018-02-04-4gb.img.xz<br />
<br />
Verify Image with:<br />
sha256sum BBB-blank-debian-9.3-lxqt-armhf-2018-02-04-4gb*<br />
ad2e34f50159fcd105c7e9616a6f1cd9fb9400fee52603533740861016953451 BBB-blank-debian-9.3-lxqt-armhf-2018-02-04-4gb.img.xz<br />
<br />
Windows/Mac/Linux gui<br />
http://etcher.io<br />
<br />
Linux: (dd)<br />
xzcat BBB-blank-debian-9.3-lxqt-armhf-2018-02-04-4gb.img.xz | sudo dd of=/dev/sdX<br />
<br />
==== microSD/Standalone: (stretch-lxqt) (All BeagleBone Variants & PocketBeagle) ====<br />
* Kernel: 4.9.79-ti-r96<br />
<br />
Get prebuilt image:<br />
wget https://rcn-ee.com/rootfs/bb.org/testing/2018-02-04/stretch-lxqt/bone-debian-9.3-lxqt-armhf-2018-02-04-4gb.img.xz<br />
<br />
Verify Image with:<br />
sha256sum bone-debian-9.3-lxqt-armhf-2018-02-04-4gb*<br />
30794ed4fc06ba6b53ba08d30250be2685c935034c31a9d67243c33c7cf40c79 bone-debian-9.3-lxqt-armhf-2018-02-04-4gb.img.xz<br />
<br />
Windows/Mac/Linux gui<br />
http://etcher.io<br />
<br />
Linux: (dd)<br />
xzcat bone-debian-9.3-lxqt-armhf-2018-02-04-4gb.img.xz | sudo dd of=/dev/sdX<br />
<br />
==== microSD/Standalone: (stretch-lxqt) (BeagleBoard-X15) ====<br />
* Kernel: 4.9.79-ti-r96<br />
<br />
Get prebuilt image:<br />
wget https://rcn-ee.com/rootfs/bb.org/testing/2018-02-04/stretch-lxqt/bbx15-debian-9.3-lxqt-armhf-2018-02-04-4gb.img.xz<br />
<br />
Verify Image with:<br />
sha256sum bbx15-debian-9.3-lxqt-armhf-2018-02-04-4gb*<br />
32784a0b0df15f9cba343fdd148ad90b58d061f3bcebd13f36e5bab5c2530cda bbx15-debian-9.3-lxqt-armhf-2018-02-04-4gb.img.xz<br />
<br />
Windows/Mac/Linux gui<br />
http://etcher.io<br />
<br />
Linux: (dd)<br />
xzcat bbx15-debian-9.3-lxqt-armhf-2018-02-04-4gb.img.xz | sudo dd of=/dev/sdX<br />
<br />
==== microSD/Standalone: (lxqt-xm) (BeagleBoard xM) ====<br />
* Kernel: 4.14.16-armv7-x4<br />
<br />
Get prebuilt image:<br />
wget https://rcn-ee.com/rootfs/bb.org/testing/2018-02-04/lxqt-xm/bbxm-debian-9.3-lxqt-xm-armhf-2018-02-04-4gb.img.xz<br />
<br />
Verify Image with:<br />
sha256sum bbxm-debian-9.3-lxqt-xm-armhf-2018-02-04-4gb*<br />
2a4dc4e86f21f1860e0dab08d7fdbedeb4fca2ccd21ae150ca7015ade3a36b88 bbxm-debian-9.3-lxqt-xm-armhf-2018-02-04-4gb.img.xz<br />
<br />
Windows/Mac/Linux gui<br />
http://etcher.io<br />
<br />
Linux: (dd)<br />
xzcat bbxm-debian-9.3-lxqt-xm-armhf-2018-02-04-4gb.img.xz | sudo dd of=/dev/sdX<br />
<br />
=== Stretch Snapshot iot ===<br />
<br />
==== Flasher: (stretch-iot) (All BeagleBone Variants with a 4GB eMMC) ====<br />
* Kernel: 4.9.79-ti-r96<br />
<br />
Get prebuilt image:<br />
wget https://rcn-ee.com/rootfs/bb.org/testing/2018-02-04/stretch-iot/BBB-blank-debian-9.3-iot-armhf-2018-02-04-4gb.img.xz<br />
<br />
Verify Image with:<br />
sha256sum BBB-blank-debian-9.3-iot-armhf-2018-02-04-4gb*<br />
e05fa96e46cfa100855db5bad4326e5977971a7604fa751507d8650eb1e57d03 BBB-blank-debian-9.3-iot-armhf-2018-02-04-4gb.img.xz<br />
<br />
Windows/Mac/Linux gui<br />
http://etcher.io<br />
<br />
Linux: (dd)<br />
xzcat BBB-blank-debian-9.3-iot-armhf-2018-02-04-4gb.img.xz | sudo dd of=/dev/sdX<br />
<br />
==== microSD/Standalone: (stretch-iot) (All BeagleBone Variants & PocketBeagle) ====<br />
* Kernel: 4.9.79-ti-r96<br />
<br />
Get prebuilt image:<br />
wget https://rcn-ee.com/rootfs/bb.org/testing/2018-02-04/stretch-iot/bone-debian-9.3-iot-armhf-2018-02-04-4gb.img.xz<br />
<br />
Verify Image with:<br />
sha256sum bone-debian-9.3-iot-armhf-2018-02-04-4gb*<br />
6a1f0b0e498e2765cde8eb871cf3382709bbc9b47c1fd16075d1ee752be02c7b bone-debian-9.3-iot-armhf-2018-02-04-4gb.img.xz<br />
<br />
Windows/Mac/Linux gui<br />
http://etcher.io<br />
<br />
Linux: (dd)<br />
xzcat bone-debian-9.3-iot-armhf-2018-02-04-4gb.img.xz | sudo dd of=/dev/sdX<br />
<br />
==== microSD/Standalone: (stretch-iot) (BeagleBoard-X15) ====<br />
* Kernel: 4.9.79-ti-r96<br />
<br />
Get prebuilt image:<br />
wget https://rcn-ee.com/rootfs/bb.org/testing/2018-02-04/stretch-iot/bbx15-debian-9.3-iot-armhf-2018-02-04-4gb.img.xz<br />
<br />
Verify Image with:<br />
sha256sum bbx15-debian-9.3-iot-armhf-2018-02-04-4gb*<br />
79f93109119383b6a789ac8fa9cf3697feb3ad17b8481f34d921bd30a5468fc2 bbx15-debian-9.3-iot-armhf-2018-02-04-4gb.img.xz<br />
<br />
Windows/Mac/Linux gui<br />
http://etcher.io<br />
<br />
Linux: (dd)<br />
xzcat bbx15-debian-9.3-iot-armhf-2018-02-04-4gb.img.xz | sudo dd of=/dev/sdX<br />
<br />
=== Stretch Snapshot console ===<br />
<br />
==== microSD/Standalone: (stretch-console) (All BeagleBone Variants & PocketBeagle) ====<br />
* Kernel: 4.9.79-ti-r96<br />
<br />
Get prebuilt image:<br />
wget https://rcn-ee.com/rootfs/bb.org/testing/2018-02-04/stretch-console/bone-debian-9.3-console-armhf-2018-02-04-1gb.img.xz<br />
<br />
Verify Image with:<br />
sha256sum bone-debian-9.3-console-armhf-2018-02-04-1gb*<br />
5e98046f34480aca1022cc091fcf6287fa5c5b75f9511eda36bacf5e9ae0097a bone-debian-9.3-console-armhf-2018-02-04-1gb.img.xz<br />
<br />
Windows/Mac/Linux gui<br />
http://etcher.io<br />
<br />
Linux: (dd)<br />
xzcat bone-debian-9.3-console-armhf-2018-02-04-1gb.img.xz | sudo dd of=/dev/sdX<br />
<br />
==== microSD/Standalone: (stretch-console) (BeagleBoard-X15) ====<br />
* Kernel: 4.9.79-ti-r96<br />
<br />
Get prebuilt image:<br />
wget https://rcn-ee.com/rootfs/bb.org/testing/2018-02-04/stretch-console/bbx15-debian-9.3-console-armhf-2018-02-04-1gb.img.xz<br />
<br />
Verify Image with:<br />
sha256sum bbx15-debian-9.3-console-armhf-2018-02-04-1gb*<br />
f04cbc47b24abdd2a96b6b84e2d684e6211b7b4ee1b0924786241732b101dfd3 bbx15-debian-9.3-console-armhf-2018-02-04-1gb.img.xz<br />
<br />
Windows/Mac/Linux gui<br />
http://etcher.io<br />
<br />
Linux: (dd)<br />
xzcat bbx15-debian-9.3-console-armhf-2018-02-04-1gb.img.xz | sudo dd of=/dev/sdX<br />
<br />
= Kernel Options =<br />
<br />
General apt syntax for searching and installing a specific kernel:<br />
sudo apt-get update<br />
sudo apt-cache search linux-image | grep <branch><br />
sudo apt-get install linux-image-<specific version><br />
sudo reboot<br />
<br />
Latest kernel script<br />
cd /opt/scripts/tools/<br />
git pull<br />
sudo ./update_kernel.sh <OPTIONS><br />
<br />
== 3.8.x ==<br />
This is the first beagleboard.org long term kernel tree with capemanager support, it's been the default install for Debian Wheezy<br />
beagleboard.org patchset: https://github.com/beagleboard/linux/tree/3.8<br />
<br />
3.8.x BeagleBone/BeagleBone Black FULL Cape Support<br />
--bone-channel --stable<br />
<br />
3.8.x BeagleBone/BeagleBone Black FULL Cape Support + Xenomai<br />
--bone-xenomai-channel --stable<br />
<br />
== 4.4.x-ti ==<br />
beagleboard.org patchset: https://github.com/beagleboard/linux/tree/4.4<br />
Based on: http://git.ti.com/gitweb/?p=ti-linux-kernel/ti-linux-kernel.git;a=shortlog;h=refs/heads/ti-rt-linux-4.4.y<br />
<br />
4.4.x-ti All BeagleBone Variants and BeagleBoard-X15<br />
--ti-channel --lts-4_4<br />
<br />
4.4.x-ti All BeagleBone Variants and BeagleBoard-X15 + RT<br />
--ti-rt-channel --lts-4_4<br />
<br />
== 4.9.x-ti ==<br />
beagleboard.org patchset: https://github.com/beagleboard/linux/tree/4.9<br />
<br />
4.9.x-ti All BeagleBone Variants and BeagleBoard-X15<br />
--ti-channel --lts-4_9<br />
<br />
4.9.x-ti All BeagleBone Variants and BeagleBoard-X15 + RT<br />
--ti-rt-channel --lts-4_9<br />
<br />
== 4.14.x-ti ==<br />
beagleboard.org patchset: https://github.com/beagleboard/linux/tree/4.14<br />
<br />
4.14.x-ti All BeagleBone Variants and BeagleBoard-X15<br />
--ti-channel --lts-4_14<br />
<br />
4.14.x-ti All BeagleBone Variants and BeagleBoard-X15 + RT<br />
--ti-rt-channel --lts-4_14<br />
<br />
== Mainline (4.4.x lts) ==<br />
<br />
4.4.x All BeagleBone Variants<br />
--bone-kernel --lts-4_4<br />
<br />
4.4.x All BeagleBone Variants + RT<br />
--bone-rt-kernel --lts-4_4<br />
<br />
== Mainline (4.9.x lts) ==<br />
<br />
4.9.x All BeagleBone Variants<br />
--bone-kernel --lts-4_9<br />
<br />
4.9.x All BeagleBone Variants + RT<br />
--bone-rt-kernel --lts-4_9<br />
<br />
== Mainline (4.14.x lts) ==<br />
<br />
4.14.x All BeagleBone Variants<br />
--bone-kernel --lts-4_14<br />
<br />
4.14.x All BeagleBone Variants + RT<br />
--bone-rt-kernel --lts-4_14<br />
<br />
== Debian 8: jessie ==<br />
sudo apt-get install linux-image-armmp</div>JetForMehttps://elinux.org/index.php?title=Beagleboard:BeagleBoneBlack_Debian&diff=461631Beagleboard:BeagleBoneBlack Debian2018-02-09T20:12:19Z<p>JetForMe: Added note about converting standalone images to flasher images (taken from latest-images page).</p>
<hr />
<div>[[Category: Linux]]<br />
[[Category: OMAP]]<br />
[[Category:Development Boards]]<br />
[[Category: BeagleBoard]]<br />
This page is about running the [https://wiki.debian.org/ArmHardFloatPort armhf] port of [http://www.debian.org/ Debian] distribution at [[BeagleBoard]]. The latest release beagleboard.org image can be found at: http://beagleboard.org/latest-images<br />
<br />
= Checking The Debian Image Version =<br />
<br />
You should check the version of the image on the microSD/eMMC by opening the ID.txt file in the FAT partition.<br />
<br />
root@beaglebone:~# cat /etc/dogtag<br />
BeagleBoard.org BeagleBone Debian Image 2014-03-19<br />
<br />
This file can also be accessed via a PC (Windows/Mac/Linux) via either mounting the FAT partition directly off the microSD card or via the usb interface (flash drive).<br />
<br />
= Installing =<br />
<br />
== Oracle Java 8 ==<br />
<br />
Information:<br />
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html<br />
<br />
Install:<br />
sudo apt-get update<br />
sudo apt-get install oracle-java8-installer<br />
<br />
Verify:<br />
debian@beaglebone:~$ java -version<br />
java version "1.8.0_151"<br />
Java(TM) SE Runtime Environment (build 1.8.0_151-b12)<br />
Java HotSpot(TM) Client VM (build 25.151-b12, mixed mode)<br />
<br />
Oracle Java 9: no ARM binaries listed: http://www.oracle.com/technetwork/java/javase/downloads/jdk9-downloads-3848520.html<br />
<br />
== TI PRU Code Generation Tools ==<br />
<br />
http://software-dl.ti.com/codegen/non-esd/downloads/download.htm#PRU<br />
<br />
Install:<br />
sudo apt-get update<br />
sudo apt-get install ti-pru-cgt-installer<br />
<br />
Older rootfs (when above package doesn't exist):<br />
wget http://downloads.ti.com/codegen/esd/cgt_public_sw/PRU/2.1.1/ti_cgt_pru_2.1.1_armlinuxa8hf_busybox_installer.sh<br />
chmod +x ti_cgt_pru_2.1.1_armlinuxa8hf_busybox_installer.sh<br />
sudo ./ti_cgt_pru_2.1.1_armlinuxa8hf_busybox_installer.sh<br />
<br />
= FAQ =<br />
<br />
== PocketBeagle Support ==<br />
Any images after 2017-09-21 will have support for the [https://beagleboard.org/pocket PocketBeagle]<br />
<br />
== Expanding File System Partition On A microSD ==<br />
By default the microSD image is only about 2GB in size, to fully expand the partition to the full size of your microSD card simple run.<br />
<br />
cd /opt/scripts/tools/<br />
git pull || true<br />
sudo ./grow_partition.sh<br />
sudo reboot<br />
<br />
On the next reboot, [df -h] should show the full microSD card size.<br />
<br />
== Flashing eMMC ==<br />
To set up the standalone microSD image to automatically flash the eMMC on powerup. Login as debian (password = temppwd) and edit /boot/uEnv.txt with nano (sudo nano /boot/uEnv.txt) or your preferred editor.<br />
<br />
In /boot/uEnv.txt:<br />
##enable BBB: eMMC Flasher:<br />
#cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh<br />
<br />
Change to:<br />
##enable BBB: eMMC Flasher:<br />
cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh<br />
<br />
Optional, update Flasher Scripts:<br />
cd /opt/scripts/<br />
git pull<br />
<br />
and reboot the system, it'll flash the eMMC on the next bootup. (make sure to remove the microSD after flashing is complete, otherwise it'll just keep on re-flashing the eMMC)<br />
<br />
== Kernel Upgrade ==<br />
We can't ship support for everything on release day, so we push out new kernels as fixes, support for new capes, etc are posted on the beagleboard.org mainline list.<br />
<br />
cd /opt/scripts/tools/<br />
git pull<br />
sudo ./update_kernel.sh<br />
sudo reboot<br />
<br />
=== Installing kernel headers ===<br />
If you want to build a kernel module natively, you'll need to install the correct kernel headers.<br />
<br />
sudo apt-get install linux-headers-`uname -r`<br />
<br />
In a Makefile, perform:<br />
<br />
sudo apt-get install linux-headers-$(shell uname -r)<br />
<br />
== Loading custom capes ==<br />
<br />
'''WARNING, this is now deprecated, please use U-Boot overlays'''<br />
<br />
Due to limitations in debian wheezy's userspace, the use of an initramfs, and having firmware builtin to the kernel. It is currently not possible to load "custom" capes via: capemgr.enable_partno=xyz. Instead an init script has been set up to load the cape/capes as soon as possible.<br />
<br />
Built-in Cape:<br />
capemgr.enable_partno=BB-SPIDEV1<br />
<br />
slot #7: Requesting part number/version based 'BB-SPIDEV1-00A0.dtbo<br />
slot #7: Requesting firmware 'BB-SPIDEV1-00A0.dtbo' for board-name 'Override Board Name', version '00A0'<br />
slot #7: dtbo 'BB-SPIDEV1-00A0.dtbo' loaded; converting to live tree<br />
<br />
Custom External Cape:<br />
capemgr.enable_partno=BB-SPI1-01<br />
<br />
slot #7: Requesting part number/version based 'BB-SPI1-01-00A0.dtbo<br />
slot #7: Requesting firmware 'BB-SPI1-01-00A0.dtbo' for board-name 'Override Board Name', version '00A0'<br />
failed to load firmware 'BB-SPI1-01-00A0.dtbo'<br />
loader: failed to load slot-7 BB-SPI1-01:00A0 (prio 0)<br />
<br />
Workaround:<br />
add "CAPE=BB-SPI1-01" to /etc/default/capemgr<br />
<br />
== Privileged echo ==<br />
As a normal user, you can not "sudo echo 'something' >> /etc/privilegedfile"<br />
<br />
sudo sh -c "echo 'something' >> /etc/privilegedfile"<br />
<br />
== Timezone ==<br />
By default this image is set up to display time in [http://en.wikipedia.org/wiki/Coordinated_Universal_Time utc] mode. If you would like to change this to your local region.<br />
<br />
dpkg-reconfigure tzdata<br />
<br />
or:<br />
echo "Europe/Zurich" > /etc/timezone <br />
dpkg-reconfigure -f noninteractive tzdata<br />
<br />
=== Jessie Timezone ===<br />
<br />
List of available timezones:<br />
timedatectl list-timezones<br />
<br />
Set timezone:<br />
sudo timedatectl set-timezone America/North_Dakota/Center<br />
<br />
== W: GPG error: http://debian.beagleboard.org wheezy-bbb ==<br />
<br />
W: GPG error: http://debian.beagleboard.org wheezy-bbb Release:<br />
The following signatures were invalid:<br />
KEYEXPIRED 1418840246 KEYEXPIRED 1418840304 KEYEXPIRED 1418840246 KEYEXPIRED 1418840246 KEYEXPIRED 1418840304<br />
<br />
Note this directions are version dependent, so double check your version:<br />
<br />
debian@beaglebone:~$ cat /etc/dogtag <br />
BeagleBoard.org BeagleBone Debian Image 2014-05-14<br />
<br />
=== 2014-05-14 GPG error: Disable: http://debian.beagleboard.org repo: ===<br />
<br />
sudo nano /etc/apt/sources.list<br />
<br />
Change:<br />
deb [arch=armhf] http://debian.beagleboard.org/packages wheezy-bbb main<br />
#deb-src [arch=armhf] http://debian.beagleboard.org/packages wheezy-bbb main<br />
<br />
To:<br />
#deb [arch=armhf] http://debian.beagleboard.org/packages wheezy-bbb main<br />
#deb-src [arch=armhf] http://debian.beagleboard.org/packages wheezy-bbb main<br />
<br />
sudo apt-get update<br />
<br />
=== 2014-05-14 GPG error: Optional enable: http://repos.rcn-ee.com/ ===<br />
<br />
Download archive-keyring:<br />
wget https://rcn-ee.com/repos/debian/pool/main/r/rcn-ee-archive-keyring/rcn-ee-archive-keyring_2016.04.24~bpo70+20160424+1_all.deb<br />
sudo dpkg -i rcn-ee-archive-keyring_*_all.deb<br />
<br />
Add repo to /etc/apt/sources.list<br />
sudo sh -c "echo 'deb [arch=armhf] http://repos.rcn-ee.com/debian wheezy main' >> /etc/apt/sources.list"<br />
sudo sh -c "echo '#deb-src [arch=armhf] http://repos.rcn-ee.com/debian wheezy main' >> /etc/apt/sources.list"<br />
<br />
Update packages:<br />
sudo apt-get update<br />
sudo apt-get upgrade<br />
sudo apt-get install npm c9-core-installer --reinstall<br />
<br />
== Adding bb.org-overlays to jessie console image ==<br />
<br />
Currently by default, the console image doesn't include the *.dtbo overlays.<br />
<br />
Install build requirements: (add's 145Mb to the console image)<br />
sudo apt-get update<br />
sudo apt-get install build-essential git-core device-tree-compiler<br />
<br />
Clone bb.org-overlays repo:<br />
git clone https://github.com/beagleboard/bb.org-overlays/<br />
cd ./bb.org-overlays/<br />
./install.sh<br />
<br />
== i take full responsibility for knowing my beagle is now insecure ==<br />
<br />
as of 2017-02-19, BeagleBoard images now longer enable these insecure options by default, you are free to recreate them as you wish.<br />
<br />
=== remove root password ===<br />
root_password=$(cat /etc/shadow | grep root | awk -F ':' '{print $2}')<br />
sed -i -e 's:'$root_password'::g' /etc/shadow<br />
<br />
=== ssh root@beaglebone.local ===<br />
sed -i -e 's:PermitEmptyPasswords no:PermitEmptyPasswords yes:g' /etc/ssh/sshd_config<br />
sed -i -e 's:UsePAM yes:UsePAM no:g' /etc/ssh/sshd_config<br />
sed -i -e 's:PermitRootLogin without-password:PermitRootLogin yes:g' /etc/ssh/sshd_config<br />
<br />
=== sudo no password required ===<br />
echo "debian ALL=NOPASSWD: ALL" >>/etc/sudoers<br />
<br />
== U-Boot Overlays ==<br />
<br />
Check via serial<br />
U-Boot SPL 2018.01-rc2-00002-g23388d96ac (Dec 19 2017 - 13:20:06)<br />
Trying to boot from MMC1<br />
<br />
U-Boot 2018.01-rc2-00002-g23388d96ac (Dec 19 2017 - 13:20:06 -0600), Build: jenkins-github_Bootloader-Builder-19<br />
<br />
Check via system<br />
debian@beaglebone:~$ cd /opt/scripts/tools/<br />
debian@beaglebone:/opt/scripts/tools$ git pull<br />
debian@beaglebone:/opt/scripts/tools$ sudo ./version.sh | grep bootloader<br />
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2018.01-rc2-00002-g23388d]<br />
<br />
To upgrade your version of U-Boot:<br />
debian@beaglebone:~$ cd /opt/scripts/tools/developers/<br />
debian@beaglebone:/opt/scripts/tools/developers$ sudo ./update_bootloader.sh<br />
debian@beaglebone:/opt/scripts/tools/developers$ sudo reboot<br />
<br />
=== U-Boot Capes added: ===<br />
NHD-7.0CTP-CAPE Family<br />
BB-BONE-NH7C-01-A0.dtbo (first added in: 2017.05-rc2-00002-g86566339a9 (Apr 28 2017 - 10:18:57))<br />
<br />
=== U-Boot /boot/uEnv.txt configuration ===<br />
<br />
/boot/uEnv.txt:<br />
enable_uboot_overlays=1<br />
<br />
=== U-Boot Disable on-board devices ===<br />
To Disable eMMC:<br />
disable_uboot_overlay_emmc=1<br />
<br />
To Disable HDMI VIDEO & AUDIO:<br />
disable_uboot_overlay_video=1<br />
<br />
To Disable HDMI AUDIO:<br />
disable_uboot_overlay_audio=1<br />
<br />
To Disable WL1835:<br />
disable_uboot_overlay_wireless=1<br />
<br />
To Disable BB-ADC: (first added in: 2017.05-rc1-00002-g35aecb22fe (Apr 05 2017 - 16:51:58))<br />
disable_uboot_overlay_adc=1<br />
<br />
=== U-Boot Override external capes ===<br />
Cape device tree overlays (src): https://github.com/beagleboard/bb.org-overlays/<br />
Debian package: bb-cape-overlays<br />
<br />
uboot_overlay_addr0=/lib/firmware/<file0>.dtbo<br />
uboot_overlay_addr1=/lib/firmware/<file1>.dtbo<br />
uboot_overlay_addr2=/lib/firmware/<file2>.dtbo<br />
uboot_overlay_addr3=/lib/firmware/<file3>.dtbo<br />
<br />
If for some reason you need to disable the auto-loading of any of ^ those, use the option that matches your addrX: (first added in: 2017.03-00002-gbfe60d6057 (Mar 28 2017 - 15:32:51))<br />
disable_uboot_overlay_addr0=1<br />
disable_uboot_overlay_addr1=1<br />
disable_uboot_overlay_addr2=1<br />
disable_uboot_overlay_addr3=1<br />
<br />
4 more capes can be loaded via: (first added in: 2017.03-00002-gbfe60d6057 (Mar 28 2017 - 15:32:51))<br />
uboot_overlay_addr4=/lib/firmware/<file4>.dtbo<br />
uboot_overlay_addr5=/lib/firmware/<file5>.dtbo<br />
uboot_overlay_addr6=/lib/firmware/<file6>.dtbo<br />
uboot_overlay_addr7=/lib/firmware/<file7>.dtbo<br />
<br />
Plus one custom cape:<br />
dtb_overlay=/lib/firmware/<file8>.dtbo<br />
<br />
=== U-Boot PRU Options ===<br />
<br />
With v4.4.x-ti PRU via remoteproc can be enabled by:<br />
uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-4-TI-00A0.dtbo<br />
<br />
With mainline (boneX) PRU via uio (doesn't work with v4.9.x-ti yet)<br />
uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo<br />
<br />
=== U-Boot Cape Universal ===<br />
Utilize https://github.com/cdsteinkuehler/beaglebone-universal-io config-pin.<br />
<br />
Cape Universal Supported Boards:<br />
BeagleBone Black<br />
BeagleBone Black Wireless<br />
BeagleBone Green<br />
BeagleBone Green Wireless<br />
Element14 BeagleBone Black Industrial<br />
MENTOREL BeagleBone uSomIQ<br />
SanCloud BeagleBone Enhanced<br />
<br />
Not Supported needs work/testing/etc<br />
Arrow BeagleBone Black Industrial (different video phy)<br />
Neuromeka BeagleBone Air (untested)<br />
<br />
To enable, in /boot/uEnv.txt add:<br />
enable_uboot_cape_universal=1<br />
<br />
== Where did the slots file go? ==<br />
Kernel Overlays are going bye-bye, too many bugs, too many race conditions, no kernel maintainers interested. We've said our farewells and U-Boot Overlays is the way forward: https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_Overlays With multiple parties working on the U-Boot infrastructure.<br />
<br />
The rough transition plan is:<br />
<br />
Stage 1: Disable Kernel Overlays (bone_capemgr.uboot_capemgr_enabled=1 is passed thru /proc/cmdline)<br />
Stage 2: Disable the slots file (/sys/devices/platform/bone_capemgr/slots) (v4.4.x -> 4.14.x)<br />
Stage 3: Disable bone_capemgr dir (/sys/devices/platform/bone_capemgr/) (v4.15.x+)<br />
<br />
Stage 1 is complete, all current images use U-Boot Overlays by default. Stage 2 is currently in progress, as it is not recommended to "load" anything into the slots file while U-Boot Overlays are in control. Stage 3, will take longer, as many applications only need to know the "bone_capemgr" directory is available.<br />
<br />
''If you don't like the direction we are heading, simply disable, "enable_uboot_overlays=1" in /boot/uEnv.txt..'' <br />
<br />
#I will be on my own with Kernel Overlays:<br />
#enable_uboot_overlays=1<br />
<br />
= Debian Build Instructions =<br />
<br />
You'll want a fairly beefy ARM system to run this script.<br />
<br />
git clone git://github.com/beagleboard/image-builder.git<br />
cd image-builder<br />
./beagleboard.org_image.sh<br />
<br />
Output of the autobuilder can be found at http://builds.beagleboard.org.<br />
<br />
= Debian Releases =<br />
http://beagleboard.org/latest-images<br />
<br />
= Debian Image Testing Snapshots =<br />
<br />
To turn “microSD/Standalone” images into eMMC flasher images, edit the '''/boot/uEnv.txt''' file on the Linux partition on the microSD card and uncomment the line with '''cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh'''. Enabling this will cause booting the microSD card to flash the eMMC. “Flasher” images already enable this line.<br />
<br />
== 2018-02-01 - Debian 8 (Jessie) - Monthly ==<br />
<br />
=== BBW/BBB (All Revs) Machinekit ===<br />
<br />
==== microSD/Standalone: (machinekit) Based on Debian Jessie with 3.8.x kernel ====<br />
Get prebuilt image:<br />
wget https://rcn-ee.com/rootfs/bb.org/testing/2017-02-12/machinekit/bone-debian-8.7-machinekit-armhf-2017-02-12-4gb.img.xz<br />
<br />
Verify Image with:<br />
sha256sum bone-debian-8.7-machinekit-armhf-2017-02-12-4gb*<br />
18361e0426715974b5a0e7f014ff1bf26db2421cbf8d61622efd2856cd8c6214 bone-debian-8.7-machinekit-armhf-2017-02-12-4gb.img.xz<br />
<br />
Windows/Mac/Linux gui<br />
http://etcher.io<br />
<br />
Linux: (dd)<br />
xzcat bone-debian-8.7-machinekit-armhf-2017-02-12-4gb.img.xz | sudo dd of=/dev/sdX<br />
<br />
=== Jessie Snapshot lxqt ===<br />
<br />
2018-02-01 notes<br />
* U-Boot: v2018.01<br />
* default username:password is [debian:temppwd]<br />
<br />
==== Flasher: (lxqt-4gb) (All BeagleBone Variants with a 4GB eMMC) ====<br />
* Kernel: 4.4.113-ti-r145<br />
<br />
Get prebuilt image:<br />
wget https://rcn-ee.com/rootfs/bb.org/testing/2018-02-01/lxqt-4gb/BBB-blank-debian-8.10-lxqt-4gb-armhf-2018-02-01-4gb.img.xz<br />
<br />
Verify Image with:<br />
sha256sum BBB-blank-debian-8.10-lxqt-4gb-armhf-2018-02-01-4gb*<br />
ab166302beada41fad706529344c88ccec0b8a84393d6544fed46053c6f1e230 BBB-blank-debian-8.10-lxqt-4gb-armhf-2018-02-01-4gb.img.xz<br />
<br />
Windows/Mac/Linux gui<br />
http://etcher.io<br />
<br />
Linux: (dd)<br />
xzcat BBB-blank-debian-8.10-lxqt-4gb-armhf-2018-02-01-4gb.img.xz | sudo dd of=/dev/sdX<br />
<br />
==== microSD/Standalone: (lxqt-4gb) (All BeagleBone Variants & PocketBeagle) ====<br />
* Kernel: 4.4.113-ti-r145<br />
<br />
Get prebuilt image:<br />
wget https://rcn-ee.com/rootfs/bb.org/testing/2018-02-01/lxqt-4gb/bone-debian-8.10-lxqt-4gb-armhf-2018-02-01-4gb.img.xz<br />
<br />
Verify Image with:<br />
sha256sum bone-debian-8.10-lxqt-4gb-armhf-2018-02-01-4gb*<br />
5593788b55811975979223b4add180a585b31280cc12cac024263b2af162c497 bone-debian-8.10-lxqt-4gb-armhf-2018-02-01-4gb.img.xz<br />
<br />
Windows/Mac/Linux gui<br />
http://etcher.io<br />
<br />
Linux: (dd)<br />
xzcat bone-debian-8.10-lxqt-4gb-armhf-2018-02-01-4gb.img.xz | sudo dd of=/dev/sdX<br />
<br />
==== microSD/Standalone: (lxqt-4gb) (BeagleBoard-X15) ====<br />
* Kernel: 4.4.113-ti-r145<br />
<br />
Get prebuilt image:<br />
wget https://rcn-ee.com/rootfs/bb.org/testing/2018-02-01/lxqt-4gb/bbx15-debian-8.10-lxqt-4gb-armhf-2018-02-01-4gb.img.xz<br />
<br />
Verify Image with:<br />
sha256sum bbx15-debian-8.10-lxqt-4gb-armhf-2018-02-01-4gb*<br />
dfe30d3e577f3c2843a1d708d71a0b89b932be4bddbc0adb04fadcf2b03c68d5 bbx15-debian-8.10-lxqt-4gb-armhf-2018-02-01-4gb.img.xz<br />
<br />
Windows/Mac/Linux gui<br />
http://etcher.io<br />
<br />
Linux: (dd)<br />
xzcat bbx15-debian-8.10-lxqt-4gb-armhf-2018-02-01-4gb.img.xz | sudo dd of=/dev/sdX<br />
<br />
==== microSD/Standalone: (lxqt-2gb) (All BeagleBone Variants & PocketBeagle) ====<br />
* Kernel: 4.4.113-ti-r145<br />
<br />
Get prebuilt image:<br />
wget https://rcn-ee.com/rootfs/bb.org/testing/2018-02-01/lxqt-2gb/bone-debian-8.10-lxqt-2gb-armhf-2018-02-01-2gb.img.xz<br />
<br />
Verify Image with:<br />
sha256sum bone-debian-8.10-lxqt-2gb-armhf-2018-02-01-2gb*<br />
e8d77ccfe39077bc8ef61222ab98abe613e5859a276f3b4ab53167ac544bd312 bone-debian-8.10-lxqt-2gb-armhf-2018-02-01-2gb.img.xz<br />
<br />
Windows/Mac/Linux gui<br />
http://etcher.io<br />
<br />
Linux: (dd)<br />
xzcat bone-debian-8.10-lxqt-2gb-armhf-2018-02-01-2gb.img.xz | sudo dd of=/dev/sdX<br />
<br />
==== Flasher: (lxqt-2gb) (All BeagleBone Variants) ====<br />
* Kernel: 4.4.113-ti-r145<br />
<br />
Get prebuilt image:<br />
wget https://rcn-ee.com/rootfs/bb.org/testing/2018-02-01/lxqt-2gb/BBB-blank-debian-8.10-lxqt-2gb-armhf-2018-02-01-2gb.img.xz<br />
<br />
Verify Image with:<br />
sha256sum BBB-blank-debian-8.10-lxqt-2gb-armhf-2018-02-01-2gb*<br />
37e0ae27dd33532ca9dc7ce7f32c70bf583780429cc071b97d29e3b1c6d6afd3 BBB-blank-debian-8.10-lxqt-2gb-armhf-2018-02-01-2gb.img.xz<br />
<br />
Windows/Mac/Linux gui<br />
http://etcher.io<br />
<br />
Linux: (dd)<br />
xzcat BBB-blank-debian-8.10-lxqt-2gb-armhf-2018-02-01-2gb.img.xz | sudo dd of=/dev/sdX<br />
<br />
==== microSD/Standalone: (lxqt-xm-4gb) (BeagleBoard xM) ====<br />
* Kernel: 4.14.16-armv7-x4<br />
<br />
Get prebuilt image:<br />
wget https://rcn-ee.com/rootfs/bb.org/testing/2018-02-01/lxqt-xm-4gb/bbxm-debian-8.10-lxqt-xm-4gb-armhf-2018-02-01-4gb.img.xz<br />
<br />
Verify Image with:<br />
sha256sum bbxm-debian-8.10-lxqt-xm-4gb-armhf-2018-02-01-4gb*<br />
7204275af42527f89c500da58b9f91698efddfa51e680f6cd48e63d389ddda38 bbxm-debian-8.10-lxqt-xm-4gb-armhf-2018-02-01-4gb.img.xz<br />
<br />
Windows/Mac/Linux gui<br />
http://etcher.io<br />
<br />
Linux: (dd)<br />
xzcat bbxm-debian-8.10-lxqt-xm-4gb-armhf-2018-02-01-4gb.img.xz | sudo dd of=/dev/sdX<br />
<br />
=== Jessie Snapshot iot ===<br />
<br />
==== Flasher: (iot) (All BeagleBone Variants) ====<br />
* Kernel: 4.4.113-ti-r145<br />
<br />
Get prebuilt image:<br />
wget https://rcn-ee.com/rootfs/bb.org/testing/2018-02-01/iot/BBB-blank-debian-8.10-iot-armhf-2018-02-01-4gb.img.xz<br />
<br />
Verify Image with:<br />
sha256sum BBB-blank-debian-8.10-iot-armhf-2018-02-01-4gb*<br />
2c72eaf332fb799c91d88bb38f75e099500de5fefce2f86e542caf12b8a12318 BBB-blank-debian-8.10-iot-armhf-2018-02-01-4gb.img.xz<br />
<br />
Windows/Mac/Linux gui<br />
http://etcher.io<br />
<br />
Linux: (dd)<br />
xzcat BBB-blank-debian-8.10-iot-armhf-2018-02-01-4gb.img.xz | sudo dd of=/dev/sdX<br />
<br />
==== microSD/Standalone: (iot) (All BeagleBone Variants & PocketBeagle) ====<br />
* Kernel: 4.4.113-ti-r145<br />
<br />
Get prebuilt image:<br />
wget https://rcn-ee.com/rootfs/bb.org/testing/2018-02-01/iot/bone-debian-8.10-iot-armhf-2018-02-01-4gb.img.xz<br />
<br />
Verify Image with:<br />
sha256sum bone-debian-8.10-iot-armhf-2018-02-01-4gb*<br />
857708a018044facf177e6e8fd8aca772b45f872a5f1cf998036c91927081925 bone-debian-8.10-iot-armhf-2018-02-01-4gb.img.xz<br />
<br />
Windows/Mac/Linux gui<br />
http://etcher.io<br />
<br />
Linux: (dd)<br />
xzcat bone-debian-8.10-iot-armhf-2018-02-01-4gb.img.xz | sudo dd of=/dev/sdX<br />
<br />
==== microSD/Standalone: (iot) (BeagleBoard-X15) ====<br />
* Kernel: 4.4.113-ti-r145<br />
<br />
Get prebuilt image:<br />
wget https://rcn-ee.com/rootfs/bb.org/testing/2018-02-01/iot/bbx15-debian-8.10-iot-armhf-2018-02-01-4gb.img.xz<br />
<br />
Verify Image with:<br />
sha256sum bbx15-debian-8.10-iot-armhf-2018-02-01-4gb*<br />
8af94acd35f3b4c4aaaa1714e3d372f9c1942b24b2ca3fc6392ab2beb6236b87 bbx15-debian-8.10-iot-armhf-2018-02-01-4gb.img.xz<br />
<br />
Windows/Mac/Linux gui<br />
http://etcher.io<br />
<br />
Linux: (dd)<br />
xzcat bbx15-debian-8.10-iot-armhf-2018-02-01-4gb.img.xz | sudo dd of=/dev/sdX<br />
<br />
=== Jessie Snapshot console ===<br />
<br />
==== microSD/Standalone: (console) (All BeagleBone Variants & PocketBeagle) ====<br />
* Kernel: 4.4.113-ti-r145<br />
<br />
Get prebuilt image:<br />
wget https://rcn-ee.com/rootfs/bb.org/testing/2018-02-01/console/bone-debian-8.10-console-armhf-2018-02-01-1gb.img.xz<br />
<br />
Verify Image with:<br />
sha256sum bone-debian-8.10-console-armhf-2018-02-01-1gb*<br />
992cedbdb180b83ca42729449c8490632071dcd24a7e14b3983e6a46135de099 bone-debian-8.10-console-armhf-2018-02-01-1gb.img.xz<br />
<br />
Windows/Mac/Linux gui<br />
http://etcher.io<br />
<br />
Linux: (dd)<br />
xzcat bone-debian-8.10-console-armhf-2018-02-01-1gb.img.xz | sudo dd of=/dev/sdX<br />
<br />
==== microSD/Standalone: (console) (BeagleBoard-X15) ====<br />
* Kernel: 4.4.113-ti-r145<br />
<br />
Get prebuilt image:<br />
wget https://rcn-ee.com/rootfs/bb.org/testing/2018-02-01/console/bbx15-debian-8.10-console-armhf-2018-02-01-1gb.img.xz<br />
<br />
Verify Image with:<br />
sha256sum bbx15-debian-8.10-console-armhf-2018-02-01-1gb*<br />
b68d7cd7dbf290537fb8c2475c62db5be4b636928e43e6673fff6def5a0d8e3a bbx15-debian-8.10-console-armhf-2018-02-01-1gb.img.xz<br />
<br />
Windows/Mac/Linux gui<br />
http://etcher.io<br />
<br />
Linux: (dd)<br />
xzcat bbx15-debian-8.10-console-armhf-2018-02-01-1gb.img.xz | sudo dd of=/dev/sdX<br />
<br />
== 2018-02-04 - Debian 9 (Stretch) - Weekly ==<br />
<br />
https://wiki.debian.org/DebianStretch<br />
<br />
2018-02-04 notes<br />
* U-Boot: v2018.01<br />
* default username:password is [debian:temppwd]<br />
<br />
=== BBW/BBB (All Revs) Machinekit ===<br />
<br />
==== microSD/Standalone: (machinekit) Based on Debian Stretch with 4.14.x rt kernel with U-Boot Overlays====<br />
Get prebuilt image:<br />
wget https://rcn-ee.com/rootfs/bb.org/testing/2018-02-04/stretch-machinekit/bone-debian-9.3-machinekit-armhf-2018-02-04-4gb.img.xz<br />
<br />
Verify Image with:<br />
sha256sum bone-debian-9.3-machinekit-armhf-2018-02-04-4gb*<br />
3480e74c9ca2a5014ae8e8d42d7457e6f89823772b6992a272ba16dffa15d2d9 bone-debian-9.3-machinekit-armhf-2018-02-04-4gb.img.xz<br />
<br />
Windows/Mac/Linux gui<br />
http://etcher.io<br />
<br />
Linux: (dd)<br />
xzcat bone-debian-9.3-machinekit-armhf-2018-02-04-4gb.img.xz | sudo dd of=/dev/sdX<br />
<br />
=== Stretch Snapshot lxqt ===<br />
<br />
==== Flasher: (stretch-lxqt) (All BeagleBone Variants with a 4GB eMMC) ====<br />
* Kernel: 4.9.79-ti-r96<br />
<br />
Get prebuilt image:<br />
wget https://rcn-ee.com/rootfs/bb.org/testing/2018-02-04/stretch-lxqt/BBB-blank-debian-9.3-lxqt-armhf-2018-02-04-4gb.img.xz<br />
<br />
Verify Image with:<br />
sha256sum BBB-blank-debian-9.3-lxqt-armhf-2018-02-04-4gb*<br />
ad2e34f50159fcd105c7e9616a6f1cd9fb9400fee52603533740861016953451 BBB-blank-debian-9.3-lxqt-armhf-2018-02-04-4gb.img.xz<br />
<br />
Windows/Mac/Linux gui<br />
http://etcher.io<br />
<br />
Linux: (dd)<br />
xzcat BBB-blank-debian-9.3-lxqt-armhf-2018-02-04-4gb.img.xz | sudo dd of=/dev/sdX<br />
<br />
==== microSD/Standalone: (stretch-lxqt) (All BeagleBone Variants & PocketBeagle) ====<br />
* Kernel: 4.9.79-ti-r96<br />
<br />
Get prebuilt image:<br />
wget https://rcn-ee.com/rootfs/bb.org/testing/2018-02-04/stretch-lxqt/bone-debian-9.3-lxqt-armhf-2018-02-04-4gb.img.xz<br />
<br />
Verify Image with:<br />
sha256sum bone-debian-9.3-lxqt-armhf-2018-02-04-4gb*<br />
30794ed4fc06ba6b53ba08d30250be2685c935034c31a9d67243c33c7cf40c79 bone-debian-9.3-lxqt-armhf-2018-02-04-4gb.img.xz<br />
<br />
Windows/Mac/Linux gui<br />
http://etcher.io<br />
<br />
Linux: (dd)<br />
xzcat bone-debian-9.3-lxqt-armhf-2018-02-04-4gb.img.xz | sudo dd of=/dev/sdX<br />
<br />
==== microSD/Standalone: (stretch-lxqt) (BeagleBoard-X15) ====<br />
* Kernel: 4.9.79-ti-r96<br />
<br />
Get prebuilt image:<br />
wget https://rcn-ee.com/rootfs/bb.org/testing/2018-02-04/stretch-lxqt/bbx15-debian-9.3-lxqt-armhf-2018-02-04-4gb.img.xz<br />
<br />
Verify Image with:<br />
sha256sum bbx15-debian-9.3-lxqt-armhf-2018-02-04-4gb*<br />
32784a0b0df15f9cba343fdd148ad90b58d061f3bcebd13f36e5bab5c2530cda bbx15-debian-9.3-lxqt-armhf-2018-02-04-4gb.img.xz<br />
<br />
Windows/Mac/Linux gui<br />
http://etcher.io<br />
<br />
Linux: (dd)<br />
xzcat bbx15-debian-9.3-lxqt-armhf-2018-02-04-4gb.img.xz | sudo dd of=/dev/sdX<br />
<br />
==== microSD/Standalone: (lxqt-xm) (BeagleBoard xM) ====<br />
* Kernel: 4.14.16-armv7-x4<br />
<br />
Get prebuilt image:<br />
wget https://rcn-ee.com/rootfs/bb.org/testing/2018-02-04/lxqt-xm/bbxm-debian-9.3-lxqt-xm-armhf-2018-02-04-4gb.img.xz<br />
<br />
Verify Image with:<br />
sha256sum bbxm-debian-9.3-lxqt-xm-armhf-2018-02-04-4gb*<br />
2a4dc4e86f21f1860e0dab08d7fdbedeb4fca2ccd21ae150ca7015ade3a36b88 bbxm-debian-9.3-lxqt-xm-armhf-2018-02-04-4gb.img.xz<br />
<br />
Windows/Mac/Linux gui<br />
http://etcher.io<br />
<br />
Linux: (dd)<br />
xzcat bbxm-debian-9.3-lxqt-xm-armhf-2018-02-04-4gb.img.xz | sudo dd of=/dev/sdX<br />
<br />
=== Stretch Snapshot iot ===<br />
<br />
==== Flasher: (stretch-iot) (All BeagleBone Variants with a 4GB eMMC) ====<br />
* Kernel: 4.9.79-ti-r96<br />
<br />
Get prebuilt image:<br />
wget https://rcn-ee.com/rootfs/bb.org/testing/2018-02-04/stretch-iot/BBB-blank-debian-9.3-iot-armhf-2018-02-04-4gb.img.xz<br />
<br />
Verify Image with:<br />
sha256sum BBB-blank-debian-9.3-iot-armhf-2018-02-04-4gb*<br />
e05fa96e46cfa100855db5bad4326e5977971a7604fa751507d8650eb1e57d03 BBB-blank-debian-9.3-iot-armhf-2018-02-04-4gb.img.xz<br />
<br />
Windows/Mac/Linux gui<br />
http://etcher.io<br />
<br />
Linux: (dd)<br />
xzcat BBB-blank-debian-9.3-iot-armhf-2018-02-04-4gb.img.xz | sudo dd of=/dev/sdX<br />
<br />
==== microSD/Standalone: (stretch-iot) (All BeagleBone Variants & PocketBeagle) ====<br />
* Kernel: 4.9.79-ti-r96<br />
<br />
Get prebuilt image:<br />
wget https://rcn-ee.com/rootfs/bb.org/testing/2018-02-04/stretch-iot/bone-debian-9.3-iot-armhf-2018-02-04-4gb.img.xz<br />
<br />
Verify Image with:<br />
sha256sum bone-debian-9.3-iot-armhf-2018-02-04-4gb*<br />
6a1f0b0e498e2765cde8eb871cf3382709bbc9b47c1fd16075d1ee752be02c7b bone-debian-9.3-iot-armhf-2018-02-04-4gb.img.xz<br />
<br />
Windows/Mac/Linux gui<br />
http://etcher.io<br />
<br />
Linux: (dd)<br />
xzcat bone-debian-9.3-iot-armhf-2018-02-04-4gb.img.xz | sudo dd of=/dev/sdX<br />
<br />
==== microSD/Standalone: (stretch-iot) (BeagleBoard-X15) ====<br />
* Kernel: 4.9.79-ti-r96<br />
<br />
Get prebuilt image:<br />
wget https://rcn-ee.com/rootfs/bb.org/testing/2018-02-04/stretch-iot/bbx15-debian-9.3-iot-armhf-2018-02-04-4gb.img.xz<br />
<br />
Verify Image with:<br />
sha256sum bbx15-debian-9.3-iot-armhf-2018-02-04-4gb*<br />
79f93109119383b6a789ac8fa9cf3697feb3ad17b8481f34d921bd30a5468fc2 bbx15-debian-9.3-iot-armhf-2018-02-04-4gb.img.xz<br />
<br />
Windows/Mac/Linux gui<br />
http://etcher.io<br />
<br />
Linux: (dd)<br />
xzcat bbx15-debian-9.3-iot-armhf-2018-02-04-4gb.img.xz | sudo dd of=/dev/sdX<br />
<br />
=== Stretch Snapshot console ===<br />
<br />
==== microSD/Standalone: (stretch-console) (All BeagleBone Variants & PocketBeagle) ====<br />
* Kernel: 4.9.79-ti-r96<br />
<br />
Get prebuilt image:<br />
wget https://rcn-ee.com/rootfs/bb.org/testing/2018-02-04/stretch-console/bone-debian-9.3-console-armhf-2018-02-04-1gb.img.xz<br />
<br />
Verify Image with:<br />
sha256sum bone-debian-9.3-console-armhf-2018-02-04-1gb*<br />
5e98046f34480aca1022cc091fcf6287fa5c5b75f9511eda36bacf5e9ae0097a bone-debian-9.3-console-armhf-2018-02-04-1gb.img.xz<br />
<br />
Windows/Mac/Linux gui<br />
http://etcher.io<br />
<br />
Linux: (dd)<br />
xzcat bone-debian-9.3-console-armhf-2018-02-04-1gb.img.xz | sudo dd of=/dev/sdX<br />
<br />
==== microSD/Standalone: (stretch-console) (BeagleBoard-X15) ====<br />
* Kernel: 4.9.79-ti-r96<br />
<br />
Get prebuilt image:<br />
wget https://rcn-ee.com/rootfs/bb.org/testing/2018-02-04/stretch-console/bbx15-debian-9.3-console-armhf-2018-02-04-1gb.img.xz<br />
<br />
Verify Image with:<br />
sha256sum bbx15-debian-9.3-console-armhf-2018-02-04-1gb*<br />
f04cbc47b24abdd2a96b6b84e2d684e6211b7b4ee1b0924786241732b101dfd3 bbx15-debian-9.3-console-armhf-2018-02-04-1gb.img.xz<br />
<br />
Windows/Mac/Linux gui<br />
http://etcher.io<br />
<br />
Linux: (dd)<br />
xzcat bbx15-debian-9.3-console-armhf-2018-02-04-1gb.img.xz | sudo dd of=/dev/sdX<br />
<br />
= Kernel Options =<br />
<br />
General apt syntax for searching and installing a specific kernel:<br />
sudo apt-get update<br />
sudo apt-cache search linux-image | grep <branch><br />
sudo apt-get install linux-image-<specific version><br />
sudo reboot<br />
<br />
Latest kernel script<br />
cd /opt/scripts/tools/<br />
git pull<br />
sudo ./update_kernel.sh <OPTIONS><br />
<br />
== 3.8.x ==<br />
This is the first beagleboard.org long term kernel tree with capemanager support, it's been the default install for Debian Wheezy<br />
beagleboard.org patchset: https://github.com/beagleboard/linux/tree/3.8<br />
<br />
3.8.x BeagleBone/BeagleBone Black FULL Cape Support<br />
--bone-channel --stable<br />
<br />
3.8.x BeagleBone/BeagleBone Black FULL Cape Support + Xenomai<br />
--bone-xenomai-channel --stable<br />
<br />
== 4.4.x-ti ==<br />
beagleboard.org patchset: https://github.com/beagleboard/linux/tree/4.4<br />
Based on: http://git.ti.com/gitweb/?p=ti-linux-kernel/ti-linux-kernel.git;a=shortlog;h=refs/heads/ti-rt-linux-4.4.y<br />
<br />
4.4.x-ti All BeagleBone Variants and BeagleBoard-X15<br />
--ti-channel --lts-4_4<br />
<br />
4.4.x-ti All BeagleBone Variants and BeagleBoard-X15 + RT<br />
--ti-rt-channel --lts-4_4<br />
<br />
== 4.9.x-ti ==<br />
beagleboard.org patchset: https://github.com/beagleboard/linux/tree/4.9<br />
<br />
4.9.x-ti All BeagleBone Variants and BeagleBoard-X15<br />
--ti-channel --lts-4_9<br />
<br />
4.9.x-ti All BeagleBone Variants and BeagleBoard-X15 + RT<br />
--ti-rt-channel --lts-4_9<br />
<br />
== 4.14.x-ti ==<br />
beagleboard.org patchset: https://github.com/beagleboard/linux/tree/4.14<br />
<br />
4.14.x-ti All BeagleBone Variants and BeagleBoard-X15<br />
--ti-channel --lts-4_14<br />
<br />
4.14.x-ti All BeagleBone Variants and BeagleBoard-X15 + RT<br />
--ti-rt-channel --lts-4_14<br />
<br />
== Mainline (4.4.x lts) ==<br />
<br />
4.4.x All BeagleBone Variants<br />
--bone-kernel --lts-4_4<br />
<br />
4.4.x All BeagleBone Variants + RT<br />
--bone-rt-kernel --lts-4_4<br />
<br />
== Mainline (4.9.x lts) ==<br />
<br />
4.9.x All BeagleBone Variants<br />
--bone-kernel --lts-4_9<br />
<br />
4.9.x All BeagleBone Variants + RT<br />
--bone-rt-kernel --lts-4_9<br />
<br />
== Mainline (4.14.x lts) ==<br />
<br />
4.14.x All BeagleBone Variants<br />
--bone-kernel --lts-4_14<br />
<br />
4.14.x All BeagleBone Variants + RT<br />
--bone-rt-kernel --lts-4_14<br />
<br />
== Debian 8: jessie ==<br />
sudo apt-get install linux-image-armmp</div>JetForMehttps://elinux.org/index.php?title=User:JetForMe&diff=407681User:JetForMe2016-04-20T22:52:51Z<p>JetForMe: </p>
<hr />
<div>iOS expert. Lots of embedded stuff in my spare time. Love space.<br />
<br />
[[BBBDebianCompatibility]]</div>JetForMehttps://elinux.org/index.php?title=BBBDebianCompatibility&diff=407676BBBDebianCompatibility2016-04-20T22:52:27Z<p>JetForMe: </p>
<hr />
<div>'''Note:''' This page is currently very much a work-in-progress, while I figure out the best way to display this information.<br />
<br />
The following table summarizes feature compatibility among various Beaglebone boards and Linux kernel versions.<br />
<br />
{| class="wikitable"<br />
|-<br />
|Version<br />
|Cape Manager<br />
|PRUSS<br />
|ADC<br />
|-<br />
|4.4.6-bone-rt-r9<br />
!align="center"|Yes<br />
!align="center"|Yes<br />
!align="center"|Yes<br />
|}</div>JetForMehttps://elinux.org/index.php?title=BBBDebianCompatibility&diff=407671BBBDebianCompatibility2016-04-20T22:51:28Z<p>JetForMe: </p>
<hr />
<div>The following table summarizes feature compatibility among various Beaglebone boards and Linux kernel versions.<br />
<br />
{| class="wikitable"<br />
|-<br />
|Version<br />
|Cape Manager<br />
|PRUSS<br />
|ADC<br />
|-<br />
|4.4.6-bone-rt-r9<br />
!align="center"|Yes<br />
!align="center"|Yes<br />
!align="center"|Yes<br />
|}</div>JetForMehttps://elinux.org/index.php?title=BBBDebianCompatibility&diff=407666BBBDebianCompatibility2016-04-20T22:48:57Z<p>JetForMe: Created page with "The following table summarizes feature compatibility among various Beaglebone boards and Linux kernel versions. {| class="wikitable" |- |Version |Cape Manager |PRUSS |ADC |}"</p>
<hr />
<div>The following table summarizes feature compatibility among various Beaglebone boards and Linux kernel versions.<br />
<br />
{| class="wikitable"<br />
|-<br />
|Version<br />
|Cape Manager<br />
|PRUSS<br />
|ADC<br />
|}</div>JetForMehttps://elinux.org/index.php?title=Build_Systems&diff=391231Build Systems2015-10-06T22:46:24Z<p>JetForMe: Fix grammar</p>
<hr />
<div>* [[Open Embedded]] - System for building full embedded images from scratch. Note that this is used by the [[Yocto Project]] as its build system (but see note below for more detail).<br />
* [[Buildroot]] - Easy-to-use embedded Linux build system<br />
* [http://www.openadk.org OpenADK] - Open Source Appliance Development Kit<br />
* [http://www.pengutronix.de/software/ptxdist/index_en.html PTXdist]<br />
** Kconfig based build system developed by [http://www.pengutronix.de/index_en.html Pengutronix] <br />
** GPL licensed<br />
** [http://free-electrons.com/pub/video/2009/fosdem/fosdem2009-schwebel-ptxdist.ogv Video] of a talk given by PTXdist maintainer Robert Schwebel at [http://www.fosdem.org FOSDEM 2009]<br />
* [http://www.linuxfromscratch.org/ Linux From Scratch]<br />
* [http://www.arbetsmyra.dyndns.org/nard/ Nard SDK] For industrial embedded systems<br />
* LTIB - Linux Target Image Builder (by Stuart Hughes of FreeScale) - see http://savannah.nongnu.org/projects/ltib<br />
** [http://www.bitshrine.org/celf_ltib_bof_v1.2.pdf Slides] and [http://free-electrons.com/pub/video/2008/ols/ols2008-stuart-hughes-ltib.ogg video] of a talk on LTIB at the Ottawa Linux Symposium 2008<br />
* [[OpenBricks]] - Embedded Linux Framework<br />
** OpenBricks provides a set of packages, patches and shell-based rules that creates a toolchain and a rootfs with customized packages and features selection.<br />
** Currently supports x86_32, x86_64, PowerPC, PowerPC64 and ARM architectures with either uClibc, Glibc or eGlibc C library.<br />
* [http://www.mvista.com/download/fetchdoc.php?docid=342 Building Embedded Userlands] - Presentation by Ned Miljevic & Klaas van Gend at the ELC 2008 which compares different configuration and build systems. [http://free-electrons.com/pub/video/2008/elce/elce2008-miljevic-van-gend-embedded-userlands.ogv Video] of the conference available.<br />
* [[Scratchbox]] Cross-Compilation Toolkit, with support for x86 and arm.<br />
* [[Open_Wrt|OpenWRT]] Cross-Compilation Toolkit mainly geared towards wireless routers but can be extended to other platforms, with support for x86, MIPS and ARM.<br />
* [[Yocto Project]] - The Yocto Project is an umbrella project which uses [[Open Embedded]] as its build system.<br />
** I have heard it argued that the Poky meta-data for Open Embedded actually constitute the primary build system for the Yocto Project. Since Open Embedded somewhat conflates the package data and the build scripts in the recipe files, there is some truth to this.<br />
<br />
See also [[Toolchains]]<br />
<br />
[[Category:Development Tools]]</div>JetForMehttps://elinux.org/index.php?title=Capemgr&diff=390296Capemgr2015-09-20T19:01:14Z<p>JetForMe: Fixed typo from my last edit.</p>
<hr />
<div>[[Category: Linux]]<br />
[[Category: BeagleBoard]]<br />
[[Category: BeagleBone]]<br />
[[Category: Kernel]]<br />
<br />
This page contains information on Capemgr, an in-kernel mechanism for dynamically loading [[Device Tree]] fragments from userspace.<br />
<br />
<br><br />
<br />
= About =<br />
<br />
Capemgr was created out of a need for boards like the [[BeagleBone|BeagleBone]] to be able to detect installed expansion boards at boot time and allocate appropriate resources (load drivers, allocate GPIO, reserve bus addresses, etc) on kernels which use Device Tree. Traditionally, a Device Tree was a static file (or set of files) which described a machine (often an Embedded SoC and the board it's installed on). This of course is not able to support dynamically changing hardware, such as the BeagleBone and its add-on capes.<br />
<br />
Further, it is one of the goals of the BeagleBone to allow 3rd parties to create their own capes and to allow users to install and use these capes without re-compiling the kernel.<br />
<br />
A key feature of Capemgr is the ability to load Device Tree fragments as overlays to the existing Device Tree at runtime. On the BeagleBone, each cape has a Device Tree fragment which describes it.<br />
<br />
= Implementation =<br />
<br />
Capemgr is completely implemented in the kernel. There is no userspace component. Since the BeagleBone runs best with a kernel which is downstream from mainline, the Capemgr implementation is currently located in the BeagleBone kernel patch set at https://github.com/beagleboard/kernel/tree/3.8 and https://github.com/beagleboard/kernel/tree/4.1.<br />
<br />
In the BeagleBone kernel, cape Device Tree fragments are located in <code>firmware/capes</code>. Each cape is represented by a single DTS (Device Tree Source) fragment file. At kernel build time, these fragments are compiled by the Device Tree Compiler into dtbo files (Device Tree Blob Object). At install time, these dtbo objects are copied to <code>/lib/firmware</code>.<br />
<br />
Each BeagleBone capes has an EEPROM on I2C bus 2 which contains information about the cape. The format of the data in the EEPROM is described in the System Reference Manual (SRM). The Board Name EEPROM field is used by Capemgr to determine which cape fragment to load. There are two ways this board name can be used. The first method is that the Board Name can be mapped in the BeagleBone's main Device Tree Source file (<code>arch/arm/boot/dts/am335x-bone-common.dtsi</code>) to a filename using a structure like the following:<br />
<br />
/* mrf24j40 cape */<br />
cape@10 {<br />
part-number = "BB-BONE-MRF24J40";<br />
version@00A0 {<br />
version = "00A0";<br />
dtbo = "cape-bone-mrf24j40-00A0.dtbo";<br />
};<br />
};<br />
<br />
The above DT snippet maps the device named BB-BONE-MRF24J40 version 00A0 to the file <code>/lib/firmware/cape-bone-mrf24j40-00A0.dtbo</code><br />
<br />
Alternatively, if there is no mapping in the main DTS file, the Capemgr loader will attempt to load a filename which matches the Board Name and Version fields in the EEPROM. For example, for a board named BB-BONE-LCD7-01 with version 00A2, the Capemgr loader will try to load <code>/lib/firmware/BB-BONE-LCD7-01-00A2.dtbo</code> . This way capes can be added to a system without modifying the BeagleBone's main Device Tree (<code>arch/arm/boot/dts/am335x-bone-common.dtsi</code>).<br />
<br />
== Loading a Fragment at Runtime ==<br />
<br />
Capemgr provides a sysfs interface to load Device Tree fragments at runtime. <code>/sys/devices/bone_capemgr*/</code>contains information and controls for the Capemgr system. To manually load a DTBO fragment, one can run:<br />
<br />
echo BB-BONE-MRF24J40 >/sys/devices/bone_capemgr.7/slots<br />
<br />
The above command will cause Capemgr to act as though a device with a Board Name of BB-BONE-MRF24J40 was detected. It will then check if there is a mapping in <code>arch/arm/boot/dts/am335x-bone-common.dtsi</code> and load the appropriate dtbo file from <code>/lib/firmware</code>. If not, it will attempt to load <code>/lib/firmware/BB-BONE-MRF24J40-00A0.dtbo</code> as described in the above section.<br />
<br />
One can also specify a version number on the command line:<br />
<br />
echo BB-BONE-MRF24J40:00A1 >/sys/devices/bone_capemgr.7/slots<br />
<br />
This will attempt to load revision 00A1, first using the mapping in <code>arch/arm/boot/dts/am335x-bone-common.dtsi</code>, and then trying to load <code>/lib/firmware/BB-BONE-MRF24J40-00A1.dtbo</code>.<br />
<br />
== Compiling a DTS Fragment Outside the kernel build ==<br />
<br />
On a BeagleBone, with the default Angstrom image, use the <code>dtc</code> compiler located at <code>/usr/bin/dtc</code> to compile Device Tree sources into DTBO Device Tree objects without modifying any kernel source. The resulting dtbo can be manually copied into <code>/lib/firmware</code>.<br />
<br />
More on compilation can be read [[BeagleBone_and_the_3.8_Kernel#Cape_Manager_and_Device_Tree_Overlays|here]].<br />
<br />
= Updates =<br />
<br />
* Post on LKML against 4.1: https://lkml.org/lkml/2015/5/13/157<br />
* Some of the traffic regarding the 4.1 kernel with capemgr on the Beagle list:<br />
** TESTERS WANTED: beaglebone's cape manager - http://beagleboard.org/Community/Forums?place=msg%2Fbeagleboard%2FT5bjaKxH99c%2FQGyUZ64h6YIJ<br />
** 4.1 repo - http://beagleboard.org/Community/Forums?place=msg%2Fbeagleboard%2FTMGEWjBLsok%2FStLZ7lvUmRYJ<br />
** cape-universal & 4.1.x = default.. ;) - http://beagleboard.org/Community/Forums?place=msg%2Fbeagleboard%2F2D5Pz3r7ZZ8%2Fmlcb4xMQNYkJ<br />
** v4.1.x + overlay migration notes... - https://github.com/adafruit/adafruit-beaglebone-io-python/issues/80<br />
* Installing the 4.1 kernel with CapeMgr support: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian#4.1.x_BeagleBone.2FBeagleBone_Black</div>JetForMehttps://elinux.org/index.php?title=Capemgr&diff=390291Capemgr2015-09-20T19:00:31Z<p>JetForMe: Corrected EEPROM bus information.</p>
<hr />
<div>[[Category: Linux]]<br />
[[Category: BeagleBoard]]<br />
[[Category: BeagleBone]]<br />
[[Category: Kernel]]<br />
<br />
This page contains information on Capemgr, an in-kernel mechanism for dynamically loading [[Device Tree]] fragments from userspace.<br />
<br />
<br><br />
<br />
= About =<br />
<br />
Capemgr was created out of a need for boards like the [[BeagleBone|BeagleBone]] to be able to detect installed expansion boards at boot time and allocate appropriate resources (load drivers, allocate GPIO, reserve bus addresses, etc) on kernels which use Device Tree. Traditionally, a Device Tree was a static file (or set of files) which described a machine (often an Embedded SoC and the board it's installed on). This of course is not able to support dynamically changing hardware, such as the BeagleBone and its add-on capes.<br />
<br />
Further, it is one of the goals of the BeagleBone to allow 3rd parties to create their own capes and to allow users to install and use these capes without re-compiling the kernel.<br />
<br />
A key feature of Capemgr is the ability to load Device Tree fragments as overlays to the existing Device Tree at runtime. On the BeagleBone, each cape has a Device Tree fragment which describes it.<br />
<br />
= Implementation =<br />
<br />
Capemgr is completely implemented in the kernel. There is no userspace component. Since the BeagleBone runs best with a kernel which is downstream from mainline, the Capemgr implementation is currently located in the BeagleBone kernel patch set at https://github.com/beagleboard/kernel/tree/3.8 and https://github.com/beagleboard/kernel/tree/4.1.<br />
<br />
In the BeagleBone kernel, cape Device Tree fragments are located in <code>firmware/capes</code>. Each cape is represented by a single DTS (Device Tree Source) fragment file. At kernel build time, these fragments are compiled by the Device Tree Compiler into dtbo files (Device Tree Blob Object). At install time, these dtbo objects are copied to <code>/lib/firmware</code>.<br />
<br />
Each BeagleBone capes has an EEPROM on I2 bus 2 which contains information about the cape. The format of the data in the EEPROM is described in the System Reference Manual (SRM). The Board Name EEPROM field is used by Capemgr to determine which cape fragment to load. There are two ways this board name can be used. The first method is that the Board Name can be mapped in the BeagleBone's main Device Tree Source file (<code>arch/arm/boot/dts/am335x-bone-common.dtsi</code>) to a filename using a structure like the following:<br />
<br />
/* mrf24j40 cape */<br />
cape@10 {<br />
part-number = "BB-BONE-MRF24J40";<br />
version@00A0 {<br />
version = "00A0";<br />
dtbo = "cape-bone-mrf24j40-00A0.dtbo";<br />
};<br />
};<br />
<br />
The above DT snippet maps the device named BB-BONE-MRF24J40 version 00A0 to the file <code>/lib/firmware/cape-bone-mrf24j40-00A0.dtbo</code><br />
<br />
Alternatively, if there is no mapping in the main DTS file, the Capemgr loader will attempt to load a filename which matches the Board Name and Version fields in the EEPROM. For example, for a board named BB-BONE-LCD7-01 with version 00A2, the Capemgr loader will try to load <code>/lib/firmware/BB-BONE-LCD7-01-00A2.dtbo</code> . This way capes can be added to a system without modifying the BeagleBone's main Device Tree (<code>arch/arm/boot/dts/am335x-bone-common.dtsi</code>).<br />
<br />
== Loading a Fragment at Runtime ==<br />
<br />
Capemgr provides a sysfs interface to load Device Tree fragments at runtime. <code>/sys/devices/bone_capemgr*/</code>contains information and controls for the Capemgr system. To manually load a DTBO fragment, one can run:<br />
<br />
echo BB-BONE-MRF24J40 >/sys/devices/bone_capemgr.7/slots<br />
<br />
The above command will cause Capemgr to act as though a device with a Board Name of BB-BONE-MRF24J40 was detected. It will then check if there is a mapping in <code>arch/arm/boot/dts/am335x-bone-common.dtsi</code> and load the appropriate dtbo file from <code>/lib/firmware</code>. If not, it will attempt to load <code>/lib/firmware/BB-BONE-MRF24J40-00A0.dtbo</code> as described in the above section.<br />
<br />
One can also specify a version number on the command line:<br />
<br />
echo BB-BONE-MRF24J40:00A1 >/sys/devices/bone_capemgr.7/slots<br />
<br />
This will attempt to load revision 00A1, first using the mapping in <code>arch/arm/boot/dts/am335x-bone-common.dtsi</code>, and then trying to load <code>/lib/firmware/BB-BONE-MRF24J40-00A1.dtbo</code>.<br />
<br />
== Compiling a DTS Fragment Outside the kernel build ==<br />
<br />
On a BeagleBone, with the default Angstrom image, use the <code>dtc</code> compiler located at <code>/usr/bin/dtc</code> to compile Device Tree sources into DTBO Device Tree objects without modifying any kernel source. The resulting dtbo can be manually copied into <code>/lib/firmware</code>.<br />
<br />
More on compilation can be read [[BeagleBone_and_the_3.8_Kernel#Cape_Manager_and_Device_Tree_Overlays|here]].<br />
<br />
= Updates =<br />
<br />
* Post on LKML against 4.1: https://lkml.org/lkml/2015/5/13/157<br />
* Some of the traffic regarding the 4.1 kernel with capemgr on the Beagle list:<br />
** TESTERS WANTED: beaglebone's cape manager - http://beagleboard.org/Community/Forums?place=msg%2Fbeagleboard%2FT5bjaKxH99c%2FQGyUZ64h6YIJ<br />
** 4.1 repo - http://beagleboard.org/Community/Forums?place=msg%2Fbeagleboard%2FTMGEWjBLsok%2FStLZ7lvUmRYJ<br />
** cape-universal & 4.1.x = default.. ;) - http://beagleboard.org/Community/Forums?place=msg%2Fbeagleboard%2F2D5Pz3r7ZZ8%2Fmlcb4xMQNYkJ<br />
** v4.1.x + overlay migration notes... - https://github.com/adafruit/adafruit-beaglebone-io-python/issues/80<br />
* Installing the 4.1 kernel with CapeMgr support: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian#4.1.x_BeagleBone.2FBeagleBone_Black</div>JetForMehttps://elinux.org/index.php?title=Ti_AM33XX_PRUSSv2&diff=365528Ti AM33XX PRUSSv22014-12-20T21:48:37Z<p>JetForMe: Fix external MII link</p>
<hr />
<div><br />
[[Category:ECE497 |PRU]]<br />
[[Category:BeagleBone]]<br />
[[Category:PRU]]<br />
<br />
<br />
The PRUSS (Programmable Real-time Unit Sub System) consists of two 32-bit 200MHz real-time cores, each with 8KB of program memory and direct access to general I/O. These cores are connected to various data memories, peripheral modules and an interrupt controller for access to the entire system-on-a-chip via a 32-bit interconnect bus.<br />
<br />
PRUs are programmed in [http://en.wikipedia.org/wiki/Assembly_language Assembly], with most commands executing in a single cycle and with no caching or pipe-lining, allowing for 100% predictable timings. At 200MHz, most operations will take 5ns (nanoseconds) to execute, with the exception of accessing memory external to PRU.<br />
<br />
====This is a Work In Progress====<br />
<br />
== Available PRU Resources ==<br />
[[File:PRUSS.png|AM335x PRUSS]]<br />
<br />
[[PRUSSv2 Memory Map|Click here for a full list of register mappings.]]<br />
<br />
=== Per PRU ===<br />
; 8KB program memory<br />
: Memory used to store instructions and static data AKA Instruction Memory (IRAM). This is the memory in which PRU programs are loaded.<br />
<br />
; Enhanced GPIO (EGPIO)<br />
: High-speed direct access to 16 general purpose output and 17 general purpose input pins for each PRU.<br />
:; PRU0<br />
:: ''pr1_pru_0_pru_r30[15:0]'' (PRU0 Register R30 Outputs)<br />
:: ''pr1_pru_0_pru_r31[16:0]'' (PRU0 Register R31 Inputs)<br />
:; PRU1<br />
:: ''pr1_pru_1_pru_r30[15:0]'' (PRU1 Register R30 Outputs)<br />
:: ''pr1_pru_1_pru_r31[16:0]'' (PRU1 Register R31 Inputs)<br />
:; Hardware capture modes<br />
:: Serial 28-bit shift in and out.<br />
:: Parallel 16-bit capture on clock.<br />
:: [http://en.wikipedia.org/wiki/Media_Independent_Interface MII] standardised capture mode, used for implementing media independent Fast Ethernet (100Mbps - 25MHz 4-bit).<br />
<br />
; A 32-bit multiply and accumulate unit (MAC)<br />
: Enables single-cycle integer multiplications with a 64-bit overflow (useful for decimal results).<br />
<br />
; 8KB data memory<br />
: Memory used to store dynamic data. Is accessed over the 32-bit bus and so not single-cycle.<br />
: One PRU may access the memory of another for passing information but it is recommend to use scratch pad or shared memory, see below.<br />
<br />
; [http://en.wikipedia.org/wiki/Open_Core_Protocol Open Core Protocol] (OCP) master port<br />
: Access to the data bus that interconnects all peripherals on the SoC, including the ARM Cortex-A8, used for data transfer directly to and from the PRU in Level 3 (L3) memory space.<br />
<br />
=== Shared Between PRUs ===<br />
; Scratch pad<br />
: 3 banks of 30 32-bit registers (total 90 32-bit registers).<br />
: Single-cycle access, can be accessed from either PRU for data sharing and signalling or for individual use.<br />
<br />
; 12KB data memory<br />
: Accessed over the 32-but bus, not single-cycle.<br />
<br />
=== Local Peripherals ===<br />
Local peripherals are those present within the PRUSS and not those belonging to the entire SoC. Peripherals are accessed from PRUs over the Switched Central Resource (SCR) 32-bit bus within the PRUSS.<br />
<br />
Attached to the SCR bus is also an OCP slave, enabling OCP masters from outside of the PRUSS to access these local peripherals in Level 4 (L4) memory space.<br />
<br />
; Enhanced Capture Model (eCAP)<br />
: <br />
<br />
; Industrial Ethernet Peripheral (IEP)<br />
<br />
; Universal Asynchronous Receiver/Transmitter (UART0)<br />
: Used to perform serial data transmission to the TL16C550 industry standard.<br />
: 16-bit FIFO receive and transmit buffers + per byte error status.<br />
: Can generate Interrupt requests for the PRUSS Interrupt Controller.<br />
: Can generate DMA requests for the EDMA SoC DMA controller.<br />
: Maximum transmission speed of 192MHz (192Mbps - 24MB/s).<br />
<br />
== Communication ==<br />
Communication between various elements of the PRUSS or the wider SoC may take place either directly, over a bus, via interrupts or via DMA.<br />
<br />
The following lists will expose all possible communication approaches for each likely scenario.<br />
<br />
For communication via interrupts, please first read the section on the [[PRUSSv2 Interrupt Controller]].<br />
<br />
[[PRUSSv2 Interrupts| Click here for a full list of PRUSS Interrupts.]]<br />
<br />
The current [https://github.com/beagleboard/am335x_pru_package/blob/master/pru_sw/app_loader/interface/prussdrv.c example PRU loader] uses [http://arago-project.org/git/projects/?p=linux-am33x.git;a=commit;h=f1a304e7941cc76353363a139cbb6a4b1ca7c737 UIO], but this ideally should be replaced with [http://omappedia.org/wiki/Category:RPMsg remoteproc] rather than poking at the registers from userspace. In the mean time, according to [https://groups.google.com/d/msg/beagleboard/gqCjxh4uZi0/_uIUD8ZF88QJ this discussion:] we can use the included script and load the uio_pruss userspace driver.<br />
<br />
=== PRU to Host (PRU to ARM Cortex-A8) ===<br />
Include the uio_pruss kernel driver by using '''modprobe uio_pruss''' or the steps outlined above, if that does not work.<br />
Then in a project include the header files for the am335x_pru_package.<br />
<br />
#define PRU_NUM0 0<br />
// Driver header file<br />
#include <prussdrv.h><br />
#include <pruss_intc_mapping.h> <br />
<br />
/* Then, initialize the interrupt controller data */<br />
tpruss_intc_initdata pruss_intc_initdata = PRUSS_INTC_INITDATA;<br />
/* Initialize the PRU */<br />
prussdrv_init ();<br />
/* Get the interrupt initialized */<br />
prussdrv_pruintc_init(&pruss_intc_initdata)<br />
<br />
/* Execute example on PRU0 where first argument is the PRU# and second is the assembly to execute*/<br />
prussdrv_exec_program (PRU_NUM0, "./example.bin");<br />
<br />
/* Wait until PRU0 sends the interrupt*/<br />
prussdrv_pru_wait_event (PRU_EVTOUT_0);<br />
/* Clear the interrupt*/<br />
prussdrv_pru_clear_event (PRU0_ARM_INTERRUPT);<br />
<br />
The PRU (in this case 0) will have the following in the example.bin file to trigger the interrupt:<br />
#define PRU0_ARM_INTERRUPT 19<br />
MOV r31.b0, PRU0_ARM_INTERRUPT+16<br />
<br />
Register 31 allows for control of the INTC for the PRU.<br />
<br />
=== Host to PRU (ARM Cortex-A8 to PRU) ===<br />
==== Interrupts ====<br />
Each PRU has access to host interrupt channels Host-0 and Host-1 through register R31 bit 30 and bit 31 respectively.<br />
By probing these registers, a PRU can determine if an interrupt is currently present on each host channel.<br />
<br />
To configure <br />
<br />
<br />
=== PRU to external peripherals ===<br />
=== External peripherals to PRU ===<br />
=== PRU to internal peripherals ===<br />
=== Internal peripherals to PRU ===<br />
<br />
== Loading a PRU Program ==<br />
<br />
==Beaglebone PRU connections and modes==<br />
<br />
{| border="1" class="wikitable"<br />
|-<br />
|'''PRU #'''<br />
|'''R30(output) bit'''<br />
|'''Pinmux Mode'''<br />
|'''R31(input) bit'''<br />
|'''Pinmux Mode'''<br />
|'''BB Header'''<br />
|'''BB Pin Name'''<br />
|'''ZCZ BallName'''<br />
|'''Offset Reg'''<br />
|'''DT Offset'''<br />
|'''Input Mode'''<br />
|'''Output Mode'''<br />
|-<br />
|0<br />
|0<br />
|Mode_5<br />
|0<br />
|Mode_6<br />
|P9_31<br />
|SPI1_SCLK<br />
|mcasp0_aclkx<br />
|990h<br />
|0x190<br />
|0x06<br />
|0x25<br />
|-<br />
|0<br />
|1<br />
|Mode_5<br />
|1<br />
|Mode_6<br />
|P9_29<br />
|SPI1_D0<br />
|mcasp0_fsx<br />
|994h<br />
|0x194<br />
|0x06<br />
|0x25<br />
|-<br />
|0<br />
|2<br />
|Mode_5<br />
|2<br />
|Mode_6<br />
|P9_30<br />
|SPI1_D1<br />
|mcasp0_axr0<br />
|998h<br />
|0x198<br />
|0x06<br />
|0x25<br />
|-<br />
|0<br />
|3<br />
|Mode_5<br />
|3<br />
|Mode_6<br />
|P9_28<br />
|SPI1_CS0<br />
|mcasp0_ahclkr<br />
|99Ch<br />
|0x19C<br />
|0x06<br />
|0x25<br />
|-<br />
|0<br />
|4<br />
|Mode_5<br />
|4<br />
|Mode_6<br />
|P9_42<br />
|<span style="color: red">(*note1)</span><br />
|mcasp0_aclkr<br />
|9A0h<br />
|0x1A0<br />
|0x06<br />
|0x25<br />
|-<br />
|0<br />
|5<br />
|Mode_5<br />
|5<br />
|Mode_6<br />
|P9_27<br />
|GPIO3_19<br />
|mcasp0_fsr<br />
|9A4h<br />
|0x1A4<br />
|0x06<br />
|0x25<br />
|-<br />
|0<br />
|6<br />
|Mode_5<br />
|6<br />
|Mode_6<br />
|P9_41<br />
|<span style="color: red">(*note2)</span><br />
|mcasp0_axr1<br />
|9A8h<br />
|0x1A8<br />
|0x06<br />
|0x25<br />
|-<br />
|0<br />
|7<br />
|Mode_5<br />
|7<br />
|Mode_6<br />
|P9_25<br />
|GPIO3_21<br />
|mcasp0_ahclkx<br />
|9ACh<br />
|0x1AC<br />
|0x06<br />
|0x25<br />
|-<br />
|0<br />
|14<br />
|Mode_6<br />
|N/A<br />
|<br />
|P8_12<br />
|GPIO1_12<br />
|gpmc_ad12<br />
|830h<br />
|0x030<br />
|N/A<br />
|0x25<br />
|-<br />
|0<br />
|15<br />
|Mode_6<br />
|N/A<br />
|<br />
|P8_11<br />
|GPIO1_13<br />
|gpmc_ad13<br />
|834h<br />
|0x034<br />
|N/A<br />
|0x25<br />
|-<br />
|0<br />
|N/A<br />
|<br />
|14<br />
|Mode_6<br />
|P8_16<br />
|GPIO1_14<br />
|gpmc_ad14<br />
|838h<br />
|0x038<br />
|0x06<br />
|N/A<br />
|-<br />
|0<br />
|N/A<br />
|<br />
|15<br />
|Mode_6<br />
|P8_15<br />
|GPIO1_15<br />
|gpmc_ad15<br />
|83Ch<br />
|0x03C<br />
|0x06<br />
|N/A<br />
|-<br />
|0<br />
|N/A<br />
|<br />
|16<br />
|Mode_6<br />
|P9_24<br />
|UART1_TXD<br />
|uart1_txd<br />
|984h<br />
|0x184<br />
|0x06<br />
|N/A<br />
|-<br />
|1<br />
|0<br />
|Mode_5<br />
|0<br />
|Mode_6<br />
|P8_45<br />
|GPIO2_6<br />
|lcd_data0<br />
|8A0h<br />
|0x0A0<br />
|0x06<br />
|0x25<br />
|-<br />
|1<br />
|1<br />
|Mode_5<br />
|1<br />
|Mode_6<br />
|P8_46<br />
|GPIO2_7<br />
|lcd_data1<br />
|8A4h<br />
|0x0A4<br />
|0x06<br />
|0x25<br />
|-<br />
|1<br />
|2<br />
|Mode_5<br />
|2<br />
|Mode_6<br />
|P8_43<br />
|GPIO2_8<br />
|lcd_data2<br />
|8A8h<br />
|0x0A8<br />
|0x06<br />
|0x25<br />
|-<br />
|1<br />
|3<br />
|Mode_5<br />
|3<br />
|Mode_6<br />
|P8_44<br />
|GPIO2_9<br />
|lcd_data3<br />
|8ACh<br />
|0x0AC<br />
|0x06<br />
|0x25<br />
|-<br />
|1<br />
|4<br />
|Mode_5<br />
|4<br />
|Mode_6<br />
|P8_41<br />
|GPIO2_10<br />
|lcd_data4<br />
|8B0h<br />
|0x0B0<br />
|0x06<br />
|0x25<br />
|-<br />
|1<br />
|5<br />
|Mode_5<br />
|5<br />
|Mode_6<br />
|P8_42<br />
|GPIO2_11<br />
|lcd_data5<br />
|8B4h<br />
|0x0B4<br />
|0x06<br />
|0x25<br />
|-<br />
|1<br />
|6<br />
|Mode_5<br />
|6<br />
|Mode_6<br />
|P8_39<br />
|GPIO2_12<br />
|lcd_data6<br />
|8B8h<br />
|0x0B8<br />
|0x06<br />
|0x25<br />
|-<br />
|1<br />
|7<br />
|Mode_5<br />
|7<br />
|Mode_6<br />
|P8_40<br />
|GPIO2_13<br />
|lcd_data7<br />
|8BCh<br />
|0x0BC<br />
|0x06<br />
|0x25<br />
|-<br />
|1<br />
|8<br />
|Mode_5<br />
|8<br />
|Mode_6<br />
|P8_27<br />
|GPIO2_22<br />
|lcd_vsync<br />
|8E0h<br />
|0x0EO<br />
|0x06<br />
|0x25<br />
|-<br />
|1<br />
|9<br />
|Mode_5<br />
|9<br />
|Mode_6<br />
|P8_29<br />
|GPIO2_23<br />
|lcd_hsync<br />
|8E4h<br />
|0x0E4<br />
|0x06<br />
|0x25<br />
|-<br />
|1<br />
|10<br />
|Mode_5<br />
|10<br />
|Mode_6<br />
|P8_28<br />
|GPIO2_24<br />
|lcd_pclk<br />
|8E8h<br />
|0x0E8<br />
|0x06<br />
|0x25<br />
|-<br />
|1<br />
|11<br />
|Mode_5<br />
|11<br />
|Mode_6<br />
|P8_30<br />
|GPIO2_25<br />
|lcd_ac_bias_en<br />
|8ECh<br />
|0x0EC<br />
|0x06<br />
|0x25<br />
|-<br />
|1<br />
|12<br />
|Mode_5<br />
|12<br />
|Mode_6<br />
|P8_21<br />
|GPIO1_30<br />
|gpmc_csn1<br />
|880h<br />
|0x080<br />
|0x06<br />
|0x25<br />
|-<br />
|1<br />
|13<br />
|Mode_5<br />
|13<br />
|Mode_6<br />
|P8_20<br />
|GPIO1_31<br />
|gpmc_csn2<br />
|884h<br />
|0x084<br />
|0x06<br />
|0x25<br />
|-<br />
|1<br />
|N/A<br />
|<br />
|16<br />
|Mode_6<br />
|P9_26<br />
|UART1_RXD<br />
|uart1_rxd<br />
|980h<br />
|0x180<br />
|0x06<br />
|NA<br />
|-<br />
|}<br />
<pre style="color: red"><br />
*Note1: The PRU0 Registers{30,31} Bit 4 (GPIO3_18) is routed to P9_42-GPIO0_7 pin. You MUST set GPIO0_7 to input mode in pinmuxing.<br />
<br />
*Note2: The PRU0 Registers{30,31} Bit 6 (GPIO3_20) is routed to P9_41-GPIO0_20(CLKOUT2). You must set GPIO0_20 to input mode in pinmuxing.<br />
</pre><br />
<br />
== Assembly ==<br />
The complete list of PRU assembly instructions can be found [http://processors.wiki.ti.com/index.php/PRU_Assembly_Instructions at TI]. <br />
=== Four instruction classes ===<br />
* Arithmetic<br />
* Logical<br />
* Flow Control<br />
* Register Load/Store<br />
<br />
=== Instruction Syntax ===<br />
* Mnemonic, followed by comma separated parameter list<br />
* Parameters can be a register, label, immediate value, or constant table entry<br />
* Example<br />
** SUB r3, r4, 10 <br />
** Subtracts immediate value 10 (decimal) from the value in r4 and then places the result in r3 (or r3 = r4 - 10)<br />
<br />
== C Compiler ==<br />
=== TI ===<br />
* [http://software-dl.ti.com/codegen/non-esd/downloads/download.htm#PRU TI C Compiler download]<br />
* [http://www.ti.com/tool/ccstudio-sitara TI Code Composer Studio]<br />
* [http://www.element14.com/community/community/knode/single-board_computers/next-gen_beaglebone/blog/2014/04/30/bbb--pru-c-compiler CCS PRU compiler release discussion on Element14 site]<br />
<br />
=== GCC ===<br />
* [https://github.com/dinuxbg/gnupru/wiki GCC C wiki]<br />
* [https://github.com/dinuxbg/gnupru GCC C compiler source]<br />
* [https://groups.google.com/forum/#!topic/beagleboard/hC5OwPXuSmQ GCC C compiler announcement]<br />
<br />
== Forth Compiler ==<br />
* [https://github.com/biocode3D/prufh Forth for PRU]<br />
<br />
== Resources ==<br />
* [https://groups.google.com/forum/?fromgroups#!topic/beagleboard/u28ytaoNenU PRU FAQ]<br />
* [https://github.com/beagleboard/am335x_pru_package AM335x PRU support package on Github]<br />
* [https://github.com/beagleboard/am335x_pru_package/blob/master/am335xPruReferenceGuide.pdf?raw=true AM335x PRU-ICSS Reference Guide]<br />
* The documentation on the subsystem is [[media:spruh73c.pdf|here]]. TI does not support this subsystem and all questions/inquires/problems should be directed to the community.<br />
* Example for the first PRU version (Ti AM18XX and other DSP) [http://www.ti.com/tool/sprc940 http://www.ti.com/tool/sprc940]<br />
* [http://www.element14.com/community/community/knode/single-board_computers/next-gen_beaglebone/blog/2013/05/22/bbb--working-with-the-pru-icssprussv2 Element14 write-up on using PRU]<br />
<br />
* [https://github.com/sagedevices/ti-pruv2-assembly-textmate-bundle PRU assembly syntax highlighting for TextMate, Sublime Text, etc.]<br />
<br />
* A userspace [https://docs.google.com/file/d/0B80aJokrBccAV1paMTU0bjM1OXc/edit?usp=sharing debugging utility] with credit to PRU_EVTOUT_2 from the #beagle IRC channel.<br />
* ncurses based debugger work has started at [https://github.com/wz2b/prude here].<br />
* A classic CLI debugger is available on SourceForge called [http://sourceforge.net/projects/prudebug prudebug].<br />
* For using the Open Core Protocol to [http://nomel.org/post/30006622413/beaglebone-tutorial-accessing-main-memory-from-the-pru access external memory] from the PRU.<br />
* Jason Kridner's presentation at Pumping Station: One - [http://videos.pumpingstationone.org/video/27/real-time-programming-with-beaglebone-prus video] [http://beagleboard.org/static/PumpingStationOne20140628_Real-timeProgrammingWithBeagleBonePRUs.pptx.pdf slides]<br />
<br />
== Examples ==<br />
<br />
* [[BeagleBone_6502_RemoteProc_cape]]<br />
* [https://github.com/mranostay/beagle-nixie BeagleBone Nixie Cape PRU App]<br />
* [http://processors.wiki.ti.com/index.php/Soft-UART_Implementation_on_AM335X_PRU_-_Software_Users_Guide PRU Soft UART Driver]<br />
* [http://processors.wiki.ti.com/index.php/PRU_Projects PRU Projects]</div>JetForMehttps://elinux.org/index.php?title=RPi_Low-level_peripherals&diff=271442RPi Low-level peripherals2013-07-15T22:49:06Z<p>JetForMe: Coalesced pins that are the same between rev 1 & rev 2 to make it easier to spot the differences.</p>
<hr />
<div>[[Category: RaspberryPi]]<br />
{{Template:RPi_Hardware}}<br />
<br />
<br />
==Introduction==<br />
In addition to the familiar USB, Ethernet and HDMI ports, the R-Pi offers lower-level interfaces intended to connect more directly with chips and subsystem modules. These GPIO (general purpose I/O) signals on the 2x13 header pins include SPI, I2C, serial UART, 3V3 and 5V power. These interfaces are not "plug and play" and require care to avoid miswiring. The pins use a 3V3 logic level and are not tolerant of 5V levels, such as you might find on a 5V powered Arduino. CSI (camera serial interface) can be used to connect the 5 MP camera available. Not yet software-enabled is the flex cable connectors with DSI (display serial interface) and a serial link inside the HDMI connector called CEC. (consumer electronics control)<br />
<br />
==General Purpose Input/Output (GPIO)==<br />
[[File:GPIOs.png|thumb|254px|right|The layout of the Raspberry Pi P1 pin-header seen from the top, containing pins useable for general purpose I/O. Colour coded to the table. Three pins changed between PCB Rev.1 and Rev.2 [https://sites.google.com/site/burngatehouse/home/drawings/GPIOs2.gif Source] ]]<br />
<br />
General Purpose Input/Output (a.k.a. GPIO) is a generic pin on a chip whose behavior (including whether it is an input or output pin) can be controlled (programmed) through software.<br />
<br />
The Raspberry Pi allows peripherals and expansion boards (such as the [[Rpi Gertboard]]) to access the CPU by exposing the inputs and outputs.<br />
<br />
For further general information about GPIOs, see: [http://en.wikipedia.org/wiki/GPIO the wikipedia article].<BR><br />
For further specific information about the Raspberry Pi's BCM2835 GPIOs, see: [[RPi_BCM2835_GPIOs|this wiki article]].<br />
<br />
The production Raspberry Pi board has a 26-pin 2.54&nbsp;mm (100&nbsp;mil)<ref>http://www.raspberrypi.org/forum/features-and-requests/easy-gpio-hardware-software/page-3/#p31907</ref> expansion header, marked as P1, arranged in a 2x13 strip. They provide 8 GPIO pins plus access to I²C, SPI, UART), as well as +3.3&nbsp;V, +5&nbsp;V and GND supply lines. Pin one is the pin in the first column and on the bottom row. <ref>http://www.raspberrypi.org/archives/384</ref><br />
<br />
[[File:RPi_P1_header.png]]<br />
<br />
'''GPIO voltage levels are 3.3&nbsp;V and are not 5&nbsp;V tolerant. There is no over-voltage protection on the board''' - the intention is that people interested in serious interfacing will use an external board with buffers, level conversion and analog I/O rather than soldering directly onto the main board.<br />
<br />
All the GPIO pins can be reconfigured to provide alternate functions, SPI, [http://en.wikipedia.org/wiki/Pulse-width_modulation PWM], I²C and so. At reset only pins GPIO 14 & 15 are assigned to the alternate function UART, these two can be switched back to GPIO to provide a total of 17 GPIO pins<ref>http://www.raspberrypi.org/archives/384</ref>. Each of their functions and full details of how to access are detailed in the chipset datasheet <ref>http://www.raspberrypi.org/wp-content/uploads/2012/02/BCM2835-ARM-Peripherals.pdf</ref>.<br />
<br />
Each GPIO can interrupt, high/low/rise/fall/change.<ref>http://www.raspberrypi.org/archives/384#comment-5217</ref><ref>http://www.raspberrypi.org/wp-content/uploads/2012/02/BCM2835-ARM-Peripherals.pdf</ref> There is currently no support for GPIO interrupts in the official kernel, howewer a patch exists, requiring compilation of modified source tree.<ref>http://www.raspberrypi.org/phpBB3/viewtopic.php?f=44&t=7509</ref> The 'Raspbian "wheezy"' <ref>http://www.raspberrypi.org/downloads</ref> version that is currently recommended for starters already includes GPIO interrupts.<br />
<br />
GPIO input hysteresis (Schmitt trigger) can be on or off, output slew rate can be fast or limited, and source and sink current is configurable from 2&nbsp;mA up to 16&nbsp;mA. Note that chipset GPIO pins 0-27 are in the same block and these properties are set per block, not per pin. See [http://www.scribd.com/doc/101830961/GPIO-Pads-Control2 GPIO Datasheet Addendum - GPIO Pads Control]. Particular attention should be applied to the note regarding SSO (Simultaneous Switching Outputs): to avoid interference, driving currents should be kept as low as possible.<br />
<br />
The available [[RPi_BCM2835_GPIOs|alternative functions]] and their corresponding pins are detailed below. These numbers are in reference to the chipset documentation and may not match the numbers exposed in Linux. Only fully usable functions are detailed, for some alternative functions not all the necessary pins are available for the funtionality to be actually used.<br />
<br />
There is also some information on the [[RPi Tutorial Easy GPIO Hardware & Software|Tutorial on Easy GPIO Hardware & Software]].<br />
<br />
Kernel boot messages go to the UART at 115200&nbsp;bit/s - there are more details on the [[RPi_Serial_Connection|serial port]] page.<br />
<br />
'''R-Pi PCB Revision 2 UPDATE:''' According to Eben at [http://www.raspberrypi.org/archives/1929#comment-31646] the R-Pi Rev.2 board being rolled out starting in September 2012 adds 4 more GPIO on a new connector called P5, and changes some of the existing P1 GPIO pinouts. On Rev2, GPIO_GEN2 [BCM2835/GPIO27] is routed to P1 pin 13, and changes what was SCL0/SDA0 to SCL1/SDA1: SCL1 [BCM2835/GPIO3] is routed to P1 pin 5, SDA1 [BCM2835/GPIO2] is routed to P1 pin 3. Also the power and ground connections previously marked "Do Not Connect" on P1 will remain as connected, specifically: P1-04:+5V0, P1-09:GND, P1-14:GND, P1-17:+3V3, P1-20:GND, P1-25:GND. According to this comment [http://www.raspberrypi.org/archives/2081#comment-33577] (and confirmed in this post [http://www.raspberrypi.org/archives/2233]) the P1 pinout is not expected to change in future beyond the current Rev.2 layout. <br />
<br />
'''P1 Header Pinout, top row:'''<br />
{| border="1" style="text-align:center;"<br />
| '''Pin Number''' || '''Pin Name Rev1''' || '''Pin Name Rev2''' || '''Hardware Notes''' || '''Alt 0 Function''' || '''Other Alternative Functions'''<br />
|-<br />
| P1-02 || bgcolor="red" colspan="2" | <span style="color:white">5V0</span> || Supply through input poly fuse<br />
|-<br />
| P1-04 || bgcolor="red" colspan="2" | <span style="color:white">5V0</span> || Supply through input poly fuse<br />
|-<br />
| P1-06 || bgcolor="black" colspan="2" | <span style="color:white">GND</span> <br />
|-<br />
|-<br />
| P1-08 || bgcolor="lime" colspan="2" | GPIO 14 || Boot to Alt 0 -> || bgcolor="yellow" | UART0_TXD || ALT5 = UART1_TXD<br />
|-<br />
| P1-10 || bgcolor="lime" colspan="2" | GPIO 15 || Boot to Alt 0 -> || bgcolor="yellow" | UART0_RXD || ALT5 = UART1_RXD<br />
|-<br />
| P1-12 || bgcolor="lime" colspan="2" | GPIO 18 || || PCM_CLK || ALT4 = SPI1_CE0_N ALT5 = PWM0<br />
|-<br />
| P1-14 || bgcolor="black" colspan="2" | <span style="color:white">GND</span> <br />
|-<br />
| P1-16 || bgcolor="lime" colspan="2" | GPIO23 || || || ALT3 = SD1_CMD ALT4 = ARM_RTCK<br />
|-<br />
| P1-18 || bgcolor="lime" colspan="2" | GPIO24 || || || ALT3 = SD1_DAT0 ALT4 = ARM_TDO<br />
|-<br />
| P1-20 || bgcolor="black" colspan="2" | <span style="color:white">GND</span> <br />
|-<br />
| P1-22 || bgcolor="lime" colspan="2" | GPIO25 || || || ALT3 = SD1_DAT1 ALT4 = ARM_TCK<br />
|-<br />
| P1-24 || bgcolor="lime" colspan="2" | GPIO08 || || bgcolor="purple" | <span style="color:white">SPI0_CE0_N</span> ||<br />
|-<br />
| P1-26 || bgcolor="lime" colspan="2" | GPIO07 || || bgcolor="purple" | <span style="color:white">SPI0_CE1_N</span> || <br />
|}<br />
<br />
<br />
'''P1 Header Pinout, bottom row:'''<br />
{| border="1" style="text-align:center;"<br />
| '''Pin Number''' || '''Pin Name Rev1''' || '''Pin Name Rev2''' || '''Hardware Notes''' || '''Alt 0 Function''' || '''Other Alternative Functions'''<br />
|-<br />
| P1-01 || bgcolor="orange" colspan="2" | 3.3&nbsp;V || 50&nbsp;mA max (01 & 17)<br />
|-<br />
| P1-03 || bgcolor="lime" | GPIO 0 || bgcolor="lime" | '''GPIO 2'''|| 1K8 pull up resistor || bgcolor="cyan" | I2C0_SDA / '''I2C1_SDA''' ||<br />
|-<br />
| P1-05 || bgcolor="lime" | GPIO 1 || bgcolor="lime" | '''GPIO 3'''|| 1K8 pull up resistor || bgcolor="cyan" | I2C0_SCL / '''I2C1_SCL''' ||<br />
|-<br />
| P1-07 || bgcolor="lime" colspan="2" | GPIO 4 || || GPCLK0 || ALT5 = ARM_TDI<br />
|-<br />
| P1-09 || bgcolor="black" colspan="2" | <span style="color:white">GND</span> <br />
|-<br />
| P1-11 || bgcolor="lime" colspan="2" | GPIO17 || || ||| ALT3 = UART0_RTS ALT4 = SPI1_CE1_N ALT5 = UART1_RTS<br />
|-<br />
| P1-13 || bgcolor="lime" | GPIO21 || bgcolor="lime" | '''GPIO27''' || || PCM_DOUT / '''reserved''' || ALT4 = SPI1_SCLK ALT5 = GPCLK1 / '''ALT3 = SD1_DAT3 ALT4 = ARM_TMS'''<br />
|-<br />
| P1-15 || bgcolor="lime" colspan="2" | GPIO22 || || || ALT3 = SD1_CLK ALT4 = ARM_TRST<br />
|-<br />
| P1-17 || bgcolor="orange" colspan="2" | 3.3&nbsp;V || 50&nbsp;mA max (01 & 17)<br />
|-<br />
| P1-19 || bgcolor="lime" colspan="2" | GPIO10 || || bgcolor="purple" | <span style="color:white">SPI0_MOSI</span> || <br />
|-<br />
| P1-21 || bgcolor="lime" colspan="2" | GPIO9 || || bgcolor="purple" | <span style="color:white">SPI0_MISO</span> ||<br />
|-<br />
| P1-23 || bgcolor="lime" colspan="2" | GPIO11 || || bgcolor="purple" | <span style="color:white">SPI0_SCLK</span> || <br />
|-<br />
| P1-25 || bgcolor="black" colspan="2" | <span style="color:white">GND</span> <br />
|}<br />
<br />
<br />
{| border="1"<br />
! Colour legend<br />
|-<br />
| bgcolor="red" | <span style="color:white">+5&nbsp;V</span><br />
|-<br />
| bgcolor="orange" | +3.3&nbsp;V<br />
|-<br />
| bgcolor="black" | <span style="color:white">Ground, 0V</span> <br />
|-<br />
| bgcolor="yellow" | UART<br />
|-<br />
| bgcolor="lime" | GPIO<br />
|-<br />
| bgcolor="purple" | <span style="color:white">SPI</span><br />
|-<br />
| bgcolor="cyan" | I²C<br />
|}<br />
<br />
KiCad symbol: [[File:Conn-raspberry.lib]]<br />
<br />
<ref>http://www.raspberrypi.org/forum/projects-and-collaboration-general/gpio-header-pinout-clarification/page-2</ref><br />
<br />
Pin 3 (SDA0) and Pin 5 (SCL0) are preset to be used as an I²C interface. So there are 1.8&nbsp;kilohm pulls up resistors on the board for these pins.<ref>http://www.raspberrypi.org/forum/features-and-requests/easy-gpio-hardware-software/page-6/#p56480</ref><br />
<br />
Pin 12 supports [http://en.wikipedia.org/wiki/Pulse-width_modulation PWM] .<br />
<br />
It is also possible to reconfigure GPIO connector pins P1-7, 15, 16, 18, 22 (chipset GPIOs 4 and 22 to 25) to provide an ARM JTAG interface.<ref>http://www.raspberrypi.org/forum?mingleforumaction=viewtopic&t=1288.1</ref> However ARM_TMS isn't available on the GPIO connector (chipset pin 12 or 27 is needed). Chipset pin 27 is available on S5, the CSI camera interface however.<br />
<br />
It is also possible to reconfigure GPIO connector pins P1-12 and 13 (chipset GPIO 18 and 21) to provide an I2S (a hardware modification may be required<ref name="I2S">[http://www.raspberrypi.org/forum/features-and-requests/sad-about-removal-of-i2s-why-was-this-change-made Forum:Sad about removal of I2S. Why was this change made?]</ref>) or PCM interface.<ref>http://www.raspberrypi.org/forum?mingleforumaction=viewtopic&t=1288.2</ref> However, PCM_FS and PCM_DIN (chipset pins 19 and 20) are needed for I2S or PCM.<br />
<br />
A second I²C interface (GPIO02_ALT0 is SDA1 and GPIO03_ALT0 is SCL1) and two further GPIOs (GPIO05_ALT0 is GPCLK1, and GPIO27) are available on S5, the CSI camera interface.<br />
<br />
===Referring to pins on the Expansion header===<br />
<br />
The header is referred to as "The GPIO Connector (P1)". To avoid nomenclature confusion between Broadcom signal names on the SoC and pin names on the expansion header, the following naming is highly recommended.<br />
<br />
* The expansion header is referred to as "Expansion Header" or "GPIO Connector (P1)"<br />
* Pins on the GPIO connector (P1) are referred to as P1-01, etc.<br />
* Names GPIO0, GPIO1, GPIOx-ALTy, etc. refer to the signal names on the SoC as enumerated in the Broadcom datasheet, where "x" matches BCM2835 number (without leading zero) and "y" is the alternate number column 0 to 5 on page 102-103 of the Broadcom document. For example, depending on what you are describing, use either "GPIO7" to refer to a row of the table, and "GPIO7-ALT0" would refer to a specific cell of the table.<br />
* When refering to signal names, you should modify the Broadcom name slightly to minimize confusion. The Broadcom SPI bus pin names are fine, such as "SPI0_*" and "SPI1_*", but they didn't do the same on the I²C and UART pins. Instead of using "SDA0" and "SCL0", you should use "I2C0_SDA" and "I2C0_SCL"; and instead of "TX" or "TXD" and "RX" or "RXD", you should use "UART0_TXD" and "UART0_RXD".<br />
<br />
===Power pins===<br />
The maximum permitted current draw from the 3.3&nbsp;V pins is 50&nbsp;mA.<br />
<br />
Maximum permitted current draw from the 5&nbsp;V pin is the USB input current (usually 1&nbsp;A) minus any current draw from the rest of the board.<ref>http://www.raspberrypi.org/forum?mingleforumaction=viewtopic&t=1536#postid-21841</ref><br />
*Model A: 1000&nbsp;mA - 500&nbsp;mA -> max current draw: 500&nbsp;mA<br />
*Model B: 1000&nbsp;mA - 700&nbsp;mA -> max current draw: 300&nbsp;mA<br />
Be very careful with the 5&nbsp;V pins P1-02 and P1-04, because if you short 5&nbsp;V to any other P1 pin you may permanently damage your RasPi. Before probing P1, it's a good idea to strip short pieces of insulation off a wire and push them over the 5&nbsp;V pins so you don't accidentally short them with a probe.<br />
<br />
=== GPIO hardware hacking ===<br />
<br />
The complete list of [[RPi_BCM2835_GPIOs|chipset GPIO pins]] which are available on the GPIO connector is: <blockquote>[[RPi_BCM2835_GPIOs#GPIO0|0]], [[RPi_BCM2835_GPIOs#GPIO1|1]], [[RPi_BCM2835_GPIOs#GPIO4|4]], [[RPi_BCM2835_GPIOs#GPIO7|7]], [[RPi_BCM2835_GPIOs#GPIO8|8]], [[RPi_BCM2835_GPIOs#GPIO9|9]], [[RPi_BCM2835_GPIOs#GPIO10|10]], [[RPi_BCM2835_GPIOs#GPIO11|11]], [[RPi_BCM2835_GPIOs#GPIO14|14]], [[RPi_BCM2835_GPIOs#GPIO15|15]], [[RPi_BCM2835_GPIOs#GPIO17|17]], [[RPi_BCM2835_GPIOs#GPIO18|18]], [[RPi_BCM2835_GPIOs#GPIO21|21]], [[RPi_BCM2835_GPIOs#GPIO22|22]], [[RPi_BCM2835_GPIOs#GPIO23|23]], [[RPi_BCM2835_GPIOs#GPIO24|24]], [[RPi_BCM2835_GPIOs#GPIO25|25]]</blockquote><br />
<br />
(on the Revision2.0 RaspberryPis, this list changes to: [[RPi_BCM2835_GPIOs#GPIO2|2]], [[RPi_BCM2835_GPIOs#GPIO3|3]], [[RPi_BCM2835_GPIOs#GPIO4|4]], [[RPi_BCM2835_GPIOs#GPIO7|7]], [[RPi_BCM2835_GPIOs#GPIO8|8]], [[RPi_BCM2835_GPIOs#GPIO9|9]], [[RPi_BCM2835_GPIOs#GPIO10|10]], [[RPi_BCM2835_GPIOs#GPIO11|11]], [[RPi_BCM2835_GPIOs#GPIO14|14]], [[RPi_BCM2835_GPIOs#GPIO15|15]], [[RPi_BCM2835_GPIOs#GPIO17|17]], [[RPi_BCM2835_GPIOs#GPIO18|18]], [[RPi_BCM2835_GPIOs#GPIO22|22]], [[RPi_BCM2835_GPIOs#GPIO23|23]], [[RPi_BCM2835_GPIOs#GPIO24|24]], [[RPi_BCM2835_GPIOs#GPIO25|25]], [[RPi_BCM2835_GPIOs#GPIO27|27]], with [[RPi_BCM2835_GPIOs#GPIO28|28]], [[RPi_BCM2835_GPIOs#GPIO29|29]], [[RPi_BCM2835_GPIOs#GPIO30|30]], [[RPi_BCM2835_GPIOs#GPIO31|31]] additionally available on the [[#P5_header|P5 header]])<br />
<br />
As noted above, P1-03 and P1-05 (SDA0 and SCL0 / SDA1 and SCL1) have 1.8&nbsp;kilohm pull-up resistors to 3.3&nbsp;V.<br />
<br />
If 17 GPIOs aren't sufficient for your project, there are a few other signals potentially available, with varying levels of software and hardware (soldering iron) hackery skills:<br />
<br />
GPIO02, 03, 05 and 27 are available on S5 (the CSI interface) when a camera peripheral is not connected to that socket, and are configured by default to provide the functions SDA1, SCL1, CAM_CLK and CAM_GPIO respectively. SDA1 and SCL1 have 1K6 pull-up resistors to 3.3&nbsp;V.<br />
<br />
GPIO06 is LAN_RUN and is available on pad 12 of the footprint for IC3 on the Model A. On Model B, it is in use for the Ethernet function.<br />
<br />
There are a few other chipset GPIO pins accessible on the PCB but are in use:<br />
<br />
* GPIO16 drives status LED D5 (usually SD card access indicator)<br />
* GPIO28-31 are used by the board ID and are connected to resistors R3 to R10 (only on Rev1.0 boards).<br />
* GPIO40 and 45 are used by analogue audio and support [http://en.wikipedia.org/wiki/Pulse-width_modulation PWM]. They connect to the analogue audio circuitry via R21 and R27 respectively.<br />
* GPIO46 is HDMI hotplug detect (goes to pin 6 of IC1).<br />
* GPIO47 to 53 are used by the SD card interface. In particular, GPIO47 is SD card detect (this would seem to be a good candidate for re-use). GPIO47 is connected to the SD card interface card detect switch; GPIO48 to 53 are connected to the SD card interface via resistors R45 to R50.<br />
<br />
=== P2 header ===<br />
<br />
The P2 header is the VideoCore JTAG and used only during the production of the board. It cannot be used as the ARM JTAG <ref>http://www.raspberrypi.org/phpBB3/viewtopic.php?f=24&t=5894</ref>. This connector is unpopulated in Rev 2.0 boards. <br />
<br />
[[File:RPi_P2_header.png]]<br />
<br />
Useful P2 pins:<br />
<br />
* Pin 1 - 3.3V (same as P1-01, 50 mA max current draw across both of them)<br />
* Pin 7 - GND<br />
* Pin 8 - GND<br />
<br />
=== P3 header ===<br />
<br />
The P3 header, unpopulated, is the LAN9512 JTAG <ref>http://www.raspberrypi.org/phpBB3/viewtopic.php?f=24&t=5894</ref>.<br />
<br />
[[File:RPi_P3_header.png]]<br />
<br />
Useful P3 pins:<br />
<br />
* Pin 7 - GND<br />
<br />
=== P5 header ===<br />
<br />
The P5 header was added with the release of the Revision 2.0 PCB design.<br />
<br />
[[File:RPi_P5_header.png]]<br />
<br />
'''P5 Header Pinout (seen from the back of the board), top row:'''<br />
{| border="1" style="text-align:center;"<br />
| '''Pin Number''' || '''Pin Name Rev2''' || '''Hardware Notes''' || '''Alt 0 Function''' || '''Other Alternative Functions'''<br />
|-<br />
| P5-01 || bgcolor="red" | <span style="color:white">5V0</span> || Supply through input poly fuse<br />
|-<br />
| P5-03 || bgcolor="lime" | GPIO28 || || bgcolor="cyan" | I2C0_SDA || ALT2 = PCM_CLK<br />
|-<br />
| P5-05 || bgcolor="lime" | GPIO30 || || || ALT2 = PCM_DIN ALT3 = UART0_CTS ALT5 = UART1_CTS<br />
|-<br />
| P5-07 || bgcolor="black" | <span style="color:white">GND</span><br />
|}<br />
<br />
'''P5 Header Pinout (seen from the back of the board), bottom row:'''<br />
{| border="1" style="text-align:center;"<br />
| '''Pin Number''' || '''Pin Name Rev2''' || '''Hardware Notes''' || '''Alt 0 Function''' || '''Other Alternative Functions'''<br />
|-<br />
| P5-02 || bgcolor="orange" | 3.3&nbsp;V || 50&nbsp;mA max (combined with P1)<br />
|-<br />
| P5-04 || bgcolor="lime" | GPIO29 || || bgcolor="cyan" | I2C0_SCL || ALT2 = PCM_FS<br />
|-<br />
| P5-06 || bgcolor="lime" | GPIO31 || || || ALT2 = PCM_DOUT ALT3 = UART0_RTS ALT5 = UART1_RTS<br />
|-<br />
| P5-08 || bgcolor="black" | <span style="color:white">GND</span><br />
|}<br />
<br />
[[File:Male-slanted2small.jpg|150px|thumb|left|Slanted P5 header]]<br />
<br />
Note that the connector is intended to be mounted on the '''bottom''' of the PCB, so that for those who put the connector on the top side, the pin numbers are swapped. Pin 1 and pin 2 are swapped, pin 3 and 4, etc. <br />
<br />
Some people have come to the conclusion that the best way (for them) to attach this header is on top, [http://raspi.tv/2013/the-leaning-header-of-pi5a-how-best-to-solder-a-header-on-p5 at a slant away from the P1 header.]<br />
<br />
The new header can provide a second I2C channel (SDA + SCL) and handshake lines for the existing UART (TxD and RxD), or it can be used for an I2S (audio codec chip) interface using the PCM signals CLK, FS (Frame Sync), Din and Dout.<br />
<br />
Note that the connector is placed JUST off-grid with respect to the P1 connector.<br />
<br />
=== P6 header ===<br />
<br />
The P6 header was added with the release of the Revision 2.0 PCB design.<br />
<br />
[[File:RPi_P6_header.png]]<br />
<br />
'''P6 Pinout:'''<br />
{| border="1" style="text-align:center;"<br />
| '''Pin Number''' || '''Pin Name Rev2''' || '''Hardware Notes'''<br />
|-<br />
| P6-01 || RUN || Short to ground to reset the BCM2835<br />
|-<br />
| P6-02 || bgcolor="black" | <span style="color:white">GND</span><br />
|}<br />
<br />
[http://raspi.tv/2012/making-a-reset-switch-for-your-rev-2-raspberry-pi A reset button can be attached to the P6 header], with which the Pi can be reset.<br />
Momentarily shorting the two pins of P6 together will cause a soft reset of the CPU (which can also 'wake' the Pi from halt/shutdown state).<br />
<br />
===Driver support===<br />
<br />
The Foundation will not include a GPIO driver in the initial release, standard Linux GPIO drivers should work with minimal modification.<ref>http://www.raspberrypi.org/forum?mingleforumaction=viewtopic&t=1278.0</ref><br />
<br />
The community implemented SPI and I²C drivers <ref>http://www.bootc.net/projects/raspberry-pi-kernel/</ref>, which will be integrated with the new Linux pinctrl concept in a later version of the kernel. (On Oct. 14 2012, it was already included in the latest raspbian image.) A first compiled version as Linux modules is available to install on the 19/04/2012 Debian image, including 1-wire support<ref>http://www.raspberrypi.org/phpBB3/viewtopic.php?p=86172#p86172</ref>. The I²C and SPI driver uses the hardware modules of the microcontroller and interrupts for low CPU usage, the 1-wire support uses bitbanging on the GPIO ports, which results in higher CPU usage.<br />
<br />
GordonH<ref>http://www.raspberrypi.org/forum/general-discussion/wiring-for-the-raspberry-pis-gpio</ref> wrote a (mostly) Arduino compatible/style [https://projects.drogon.net/raspberry-pi/wiringpi/ WiringPi library] in C for controlling the GPIO pins.<br />
<br />
A useful tutorial on setting up I²C driver support can be found at [http://www.robot-electronics.co.uk/htm/raspberry_pi_examples.htm Robot Electronics] - look for the downloadable document rpi_i2c_setup.doc<br />
<br />
===Graphical User Interfaces===<br />
====WebIOPi====<br />
[http://code.google.com/p/webiopi/ WebIOPi] allows you to control each GPIO with a simple web interface that you can use with any browser. Available in PHP and Python, they both require root access, but Python version serves HTTP itself. You can setup each GPIO as input or output and change their states (LOW/HIGH). WebIOPi is fully customizable, so you can use it for home remote control. It also work over Internet. UART/SPI/I2C support will be added later. If you need some computing for your GPIO go to code examples below.<br />
<br />
==GPIO Code examples==<br />
=== C ===<br />
Examples in different C-Languages.<br />
==== C ====<br />
[http://www.raspberrypi.org/forum/educational-applications/gertboard/page-4/#p31555 Gert van Loo & Dom, has provided] some tested code which accesses the GPIO pins through direct GPIO register manipulation in C-code.<br />
(Thanks to Dom for doing the difficult work of finding and testing the mapping.)<br />
Example GPIO code:<br />
<br />
<pre><br />
//<br />
// How to access GPIO registers from C-code on the Raspberry-Pi<br />
// Example program<br />
// 15-January-2012<br />
// Dom and Gert<br />
// Revised: 15-Feb-2013<br />
<br />
<br />
// Access from ARM Running Linux<br />
<br />
#define BCM2708_PERI_BASE 0x20000000<br />
#define GPIO_BASE (BCM2708_PERI_BASE + 0x200000) /* GPIO controller */<br />
<br />
<br />
#include <stdio.h><br />
#include <stdlib.h><br />
#include <fcntl.h><br />
#include <sys/mman.h><br />
#include <unistd.h><br />
<br />
#define PAGE_SIZE (4*1024)<br />
#define BLOCK_SIZE (4*1024)<br />
<br />
int mem_fd;<br />
void *gpio_map;<br />
<br />
// I/O access<br />
volatile unsigned *gpio;<br />
<br />
<br />
// GPIO setup macros. Always use INP_GPIO(x) before using OUT_GPIO(x) or SET_GPIO_ALT(x,y)<br />
#define INP_GPIO(g) *(gpio+((g)/10)) &= ~(7<<(((g)%10)*3))<br />
#define OUT_GPIO(g) *(gpio+((g)/10)) |= (1<<(((g)%10)*3))<br />
#define SET_GPIO_ALT(g,a) *(gpio+(((g)/10))) |= (((a)<=3?(a)+4:(a)==4?3:2)<<(((g)%10)*3))<br />
<br />
#define GPIO_SET *(gpio+7) // sets bits which are 1 ignores bits which are 0<br />
#define GPIO_CLR *(gpio+10) // clears bits which are 1 ignores bits which are 0<br />
<br />
void setup_io();<br />
<br />
int main(int argc, char **argv)<br />
{<br />
int g,rep;<br />
<br />
// Set up gpi pointer for direct register access<br />
setup_io();<br />
<br />
// Switch GPIO 7..11 to output mode<br />
<br />
/************************************************************************\<br />
* You are about to change the GPIO settings of your computer. *<br />
* Mess this up and it will stop working! *<br />
* It might be a good idea to 'sync' before running this program *<br />
* so at least you still have your code changes written to the SD-card! *<br />
\************************************************************************/<br />
<br />
// Set GPIO pins 7-11 to output<br />
for (g=7; g<=11; g++)<br />
{<br />
INP_GPIO(g); // must use INP_GPIO before we can use OUT_GPIO<br />
OUT_GPIO(g);<br />
}<br />
<br />
for (rep=0; rep<10; rep++)<br />
{<br />
for (g=7; g<=11; g++)<br />
{<br />
GPIO_SET = 1<<g;<br />
sleep(1);<br />
}<br />
for (g=7; g<=11; g++)<br />
{<br />
GPIO_CLR = 1<<g;<br />
sleep(1);<br />
}<br />
}<br />
<br />
return 0;<br />
<br />
} // main<br />
<br />
<br />
//<br />
// Set up a memory regions to access GPIO<br />
//<br />
void setup_io()<br />
{<br />
/* open /dev/mem */<br />
if ((mem_fd = open("/dev/mem", O_RDWR|O_SYNC) ) < 0) {<br />
printf("can't open /dev/mem \n");<br />
exit(-1);<br />
}<br />
<br />
/* mmap GPIO */<br />
gpio_map = mmap(<br />
NULL, //Any adddress in our space will do<br />
BLOCK_SIZE, //Map length<br />
PROT_READ|PROT_WRITE,// Enable reading & writting to mapped memory<br />
MAP_SHARED, //Shared with other processes<br />
mem_fd, //File to map<br />
GPIO_BASE //Offset to GPIO peripheral<br />
);<br />
<br />
close(mem_fd); //No need to keep mem_fd open after mmap<br />
<br />
if (gpio_map == MAP_FAILED) {<br />
printf("mmap error %d\n", (int)gpio_map);//errno also set!<br />
exit(-1);<br />
}<br />
<br />
// Always use volatile pointer!<br />
gpio = (volatile unsigned *)gpio_map;<br />
<br />
<br />
} // setup_io<br />
<br />
</pre><br />
<br />
===== GPIO Pull Up/Pull Down Register Example =====<br />
<pre><br />
// enable pull-up on GPIO24&25<br />
GPIO_PULL = 2;<br />
short_wait();<br />
// clock on GPIO 24 & 25 (bit 24 & 25 set)<br />
GPIO_PULLCLK0 = 0x03000000;<br />
short_wait();<br />
GPIO_PULL = 0;<br />
GPIO_PULLCLK0 = 0;<br />
</pre><br />
<br />
==== C + wiringPi ====<br />
Get and install wiringPi: https://projects.drogon.net/raspberry-pi/wiringpi/download-and-install/<br />
<br />
Save this, and compile with:<br />
<pre><br />
gcc -o blink blink.c -lwiringPi<br />
</pre><br />
and run with:<br />
<pre><br />
sudo ./blink<br />
</pre><br />
<br />
<pre><br />
/*<br />
* blink.c:<br />
* blinks the first LED<br />
* Gordon Henderson, projects@drogon.net<br />
*/<br />
<br />
#include <stdio.h><br />
#include <wiringPi.h><br />
<br />
int main (void)<br />
{<br />
printf ("Raspberry Pi blink\n") ;<br />
<br />
if (wiringPiSetup () == -1)<br />
return 1 ;<br />
<br />
pinMode (0, OUTPUT) ; // aka BCM_GPIO pin 17<br />
<br />
for (;;)<br />
{<br />
digitalWrite (0, 1) ; // On<br />
delay (500) ; // mS<br />
digitalWrite (0, 0) ; // Off<br />
delay (500) ;<br />
}<br />
return 0 ;<br />
}<br />
</pre><br />
<br />
==== C ====<br />
This must be done as root. To change to the root user:<br />
<pre>sudo -i</pre><br />
You must also get and install the bcm2835 library, which supports<br />
GPIO and SPI interfaces. Details and downloads <br />
from http://www.open.com.au/mikem/bcm2835<br />
<br />
<pre><br />
<br />
// blink.c<br />
//<br />
// Example program for bcm2835 library<br />
// Blinks a pin on an off every 0.5 secs<br />
//<br />
// After installing bcm2835, you can build this <br />
// with something like:<br />
// gcc -o blink -l rt blink.c -l bcm2835<br />
// sudo ./blink<br />
//<br />
// Or you can test it before installing with:<br />
// gcc -o blink -l rt -I ../../src ../../src/bcm2835.c blink.c<br />
// sudo ./blink<br />
//<br />
// Author: Mike McCauley (mikem@open.com.au)<br />
// Copyright (C) 2011 Mike McCauley<br />
// $Id: RF22.h,v 1.21 2012/05/30 01:51:25 mikem Exp $<br />
<br />
#include <bcm2835.h><br />
<br />
// Blinks on RPi pin GPIO 11<br />
#define PIN RPI_GPIO_P1_11<br />
<br />
int main(int argc, char **argv)<br />
{<br />
// If you call this, it will not actually access the GPIO<br />
// Use for testing<br />
// bcm2835_set_debug(1);<br />
<br />
if (!bcm2835_init())<br />
return 1;<br />
<br />
// Set the pin to be an output<br />
bcm2835_gpio_fsel(PIN, BCM2835_GPIO_FSEL_OUTP);<br />
<br />
// Blink<br />
while (1)<br />
{<br />
// Turn it on<br />
bcm2835_gpio_write(PIN, HIGH);<br />
<br />
// wait a bit<br />
delay(500);<br />
<br />
// turn it off<br />
bcm2835_gpio_write(PIN, LOW);<br />
<br />
// wait a bit<br />
delay(500);<br />
}<br />
<br />
return 0;<br />
}<br />
</pre><br />
<br />
==== C# ====<br />
RaspberryPiDotNet library is available at https://github.com/cypherkey/RaspberryPi.Net/.<br />
The library includes a GPIOFile and GPIOMem class. The GPIOMem requires compiling Mike McCauley's bcm2835 library above in to a shared object.<br />
<br />
<pre><br />
using System;<br />
using System.Collections.Generic;<br />
using System.Linq;<br />
using System.Text;<br />
using RaspberryPiDotNet;<br />
using System.Threading;<br />
<br />
namespace RaspPi<br />
{<br />
class Program<br />
{<br />
static void Main(string[] args)<br />
{<br />
// Access the GPIO pin using a static method<br />
GPIOFile.Write(GPIO.GPIOPins.GPIO00, true);<br />
<br />
// Create a new GPIO object<br />
GPIOMem gpio = new GPIOMem(GPIO.GPIOPins.GPIO01);<br />
gpio.Write(false);<br />
}<br />
}<br />
}<br />
</pre><br />
<br />
<br />
=== Ruby ===<br />
<br />
This example uses the WiringPi Ruby Gem: http://pi.gadgetoid.co.uk/post/015-wiringpi-now-with-serial which you can install on your Pi with "gem install wiringpi"<br />
<br />
<pre><br />
MY_PIN = 1<br />
<br />
require 'wiringpi'<br />
io = WiringPi::GPIO.new<br />
io.mode(MY_PIN,OUTPUT)<br />
io.write(MY_PIN,HIGH)<br />
io.read(MY_PIN)<br />
</pre><br />
<br />
Alternatively the Pi Piper Gem (https://github.com/jwhitehorn/pi_piper) allows for event driven programming:<br />
<br />
<pre><br />
require 'pi_piper'<br />
include PiPiper<br />
<br />
watch :pin => 23 do<br />
puts "Pin changed from #{last_value} to #{value}"<br />
end<br />
<br />
PiPiper.wait<br />
</pre><br />
<br />
<br />
=== Perl ===<br />
This must be done as root. To change to the root user:<br />
<pre>sudo su -</pre><br />
Supports GPIO and SPI interfaces.<br />
You must also get and install the bcm2835 library. Details and downloads <br />
from http://www.open.com.au/mikem/bcm2835<br />
You must then get and install the Device::BCM2835 perl library from CPAN <br />
http://search.cpan.org/~mikem/Device-BCM2835-1.0/lib/Device/BCM2835.pm<br />
<pre><br />
use Device::BCM2835;<br />
use strict;<br />
<br />
# call set_debug(1) to do a non-destructive test on non-RPi hardware<br />
#Device::BCM2835::set_debug(1);<br />
Device::BCM2835::init() <br />
|| die "Could not init library";<br />
<br />
# Blink pin 11:<br />
# Set RPi pin 11 to be an output<br />
Device::BCM2835::gpio_fsel(&Device::BCM2835::RPI_GPIO_P1_11, <br />
&Device::BCM2835::BCM2835_GPIO_FSEL_OUTP);<br />
<br />
while (1)<br />
{<br />
# Turn it on<br />
Device::BCM2835::gpio_write(&Device::BCM2835::RPI_GPIO_P1_11, 1);<br />
Device::BCM2835::delay(500); # Milliseconds<br />
# Turn it off<br />
Device::BCM2835::gpio_write(&Device::BCM2835::RPI_GPIO_P1_11, 0);<br />
Device::BCM2835::delay(500); # Milliseconds<br />
}<br />
<br />
<br />
</pre><br />
<br />
=== Python ===<br />
The RPi.GPIO module is installed by default in Raspbian. <br />
Any Python script that controls GPIO must be run as root.<br />
<pre>import RPi.GPIO as GPIO<br />
<br />
# use P1 header pin numbering convention<br />
GPIO.setmode(GPIO.BOARD)<br />
<br />
# Set up the GPIO channels - one input and one output<br />
GPIO.setup(11, GPIO.IN)<br />
GPIO.setup(12, GPIO.OUT)<br />
<br />
# Input from pin 11<br />
input_value = GPIO.input(11)<br />
<br />
# Output to pin 12<br />
GPIO.output(12, GPIO.HIGH)<br />
<br />
# The same script as above but using BCM GPIO 00..nn numbers<br />
GPIO.setmode(GPIO.BCM)<br />
GPIO.setup(17, GPIO.IN)<br />
GPIO.setup(18, GPIO.OUT)<br />
input_value = GPIO.input(17)<br />
GPIO.output(18, GPIO.HIGH)</pre><br />
<br />
More documentation is available at http://code.google.com/p/raspberry-gpio-python/wiki/Main<br />
<br />
Also available is RPIO at https://pypi.python.org/pypi/RPIO<br />
RPIO extends RPi.GPIO with TCP socket interrupts, command line tools and more.<br />
<br />
=== Java ===<br />
==== Java using the Pi4J Library ====<br />
This uses the Java library available at http://www.pi4j.com/. <br />
(Any Java application that controls GPIO must be run as root.)<br />
<br />
Please note that the Pi4J library uses the WiringPi GPIO pin numbering scheme <ref>http://pi4j.com/usage.html#Pin_Numbering</ref> <ref>https://projects.drogon.net/raspberry-pi/wiringpi/pins/</ref>. Please see the usage documentation for more details: http://pi4j.com/usage.html <br />
<br />
<pre><br />
<br />
public static void main(String[] args) {<br />
<br />
// create gpio controller<br />
GpioController gpio = GpioFactory.getInstance();<br />
<br />
// provision gpio pin #01 as an output pin and turn off<br />
GpioPinDigitalOutput outputPin = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_01, "MyLED", PinState.LOW);<br />
<br />
// turn output to LOW/OFF state<br />
outputPin.low();<br />
<br />
// turn output to HIGH/ON state<br />
outputPin.high();<br />
<br />
<br />
// provision gpio pin #02 as an input pin with its internal pull down resistor enabled<br />
GpioPinDigitalInput inputPin = gpio.provisionDigitalInputPin(RaspiPin.GPIO_02, "MyButton", PinPullResistance.PULL_DOWN);<br />
<br />
// get input state from pin 2<br />
boolean input_value = inputPin.isHigh();<br />
}<br />
</pre><br />
<br />
More complete and detailed examples are included on the Pi4J website at http://www.pi4j.com/. <br />
<br />
The Pi4J library includes support for:<br />
* GPIO Control<br />
* GPIO Listeners<br />
* Serial Communication<br />
* I2C Communication<br />
* SPI Communication<br />
<br />
==== Java ====<br />
This uses the Java library available at https://github.com/jkransen/framboos. It does not depend on (or use) the wiringPi driver, but uses the same numbering scheme. Instead it uses the default driver under /sys/class/gpio that ships with the distro, so it works out of the box. Any Java application that controls GPIO must be run as root.<br />
<pre><br />
public static void main(String[] args) {<br />
// reading from an in pin<br />
InPin button = new InPin(8);<br />
boolean isButtonPressed = button.getValue();<br />
button.close();<br />
<br />
// writing to an out pin<br />
OutPin led = new Outpin(0);<br />
led.setValue(true);<br />
led.setValue(false);<br />
led.close();<br />
}<br />
</pre><br />
<br />
==== Java Webapp GPIO web control via http ====<br />
This uses the Java Webapp available at https://bitbucket.org/sbub/raspberry-pi-gpio-web-control/overview. You can control your GPIO over the internet. Any Java application that controls GPIO must be run as root.<br />
<pre><br />
<br />
host:~ sb$ curl 'http://raspberrypi:8080/handle?g0=1&g1=0'<br />
{"g1":0,"g0":1}<br />
<br />
</pre><br />
<br />
=== Bash shell script, using sysfs, part of the raspbian operating system ===<br />
The export and unexport of pins must be done as root. <br />
To change to the root user see below: To change back, the word exit must be entered.<br />
<pre>sudo -i</pre><br />
Export creates a new folder for the exported pin, and creates files for each of its control functions (i.e. active_low, direction, edge, power, subsystem, uevent, and value). Upon creation, the control files can be read by all users (not just root), but can only be written to by user root, the file's owner. Nevertheless, once created, it is possible to allow users other than root, to also write inputs to the control files, by changing the ownership or permissions of these files. Changes to the file's ownership or permissions must initially be done as root, as their owner and group is set to root upon creation. Typically you might change the owner to be the (non root) user controlling the GPIO, or you might add write permission, and change the group ownership to one of which the user controlling the GPIO is a member. By such means, using only packages provided in the recommended rasbian distribution, it is possible for Python CGI scripts, which are typically run as user nobody, to be used for control of the GPIO over the internet from a browser at a remote location.<br />
<pre><br />
#!/bin/sh<br />
<br />
# GPIO numbers should be from this list<br />
# 0, 1, 4, 7, 8, 9, 10, 11, 14, 15, 17, 18, 21, 22, 23, 24, 25<br />
<br />
# Note that the GPIO numbers that you program here refer to the pins<br />
# of the BCM2835 and *not* the numbers on the pin header. <br />
# So, if you want to activate GPIO7 on the header you should be <br />
# using GPIO4 in this script. Likewise if you want to activate GPIO0<br />
# on the header you should be using GPIO17 here.<br />
<br />
# Set up GPIO 4 and set to output<br />
echo "4" > /sys/class/gpio/export<br />
echo "out" > /sys/class/gpio/gpio4/direction<br />
<br />
# Set up GPIO 7 and set to input<br />
echo "7" > /sys/class/gpio/export<br />
echo "in" > /sys/class/gpio/gpio7/direction<br />
<br />
# Write output<br />
echo "1" > /sys/class/gpio/gpio4/value<br />
<br />
# Read from input<br />
cat /sys/class/gpio/gpio7/value <br />
<br />
# Clean up<br />
echo "4" > /sys/class/gpio/unexport<br />
echo "7" > /sys/class/gpio/unexport<br />
</pre><br />
<br />
=== Shell script - take 2 ===<br />
You need the wiringPi library from<br />
https://projects.drogon.net/raspberry-pi/wiringpi/download-and-install/. Once installed, there is a new command '''gpio''' which can be used<br />
as a '''non-root''' user to control the GPIO pins.<br />
<br />
The man page <pre>man gpio</pre> has full details, but briefly:<br />
<br />
<pre><br />
gpio -g mode 17 out<br />
gpio -g mode 18 pwm<br />
<br />
gpio -g write 17 1<br />
gpio -g pwm 18 512<br />
</pre><br />
<br />
The '''-g''' flag tells the '''gpio''' program to use the BCM GPIO pin numbering<br />
scheme (otherwise it will use the wiringPi numbering scheme by default).<br />
<br />
The gpio command can also control the internal pull-up and pull-down<br />
resistors:<br />
<br />
<pre><br />
gpio -g mode 17 up<br />
</pre><br />
<br />
This sets the pull-up resistor - however any change of mode, even<br />
setting a pin that's already set as an input to an input will remove<br />
the pull-up/pull-down resistors, so they may need to be reset.<br />
<br />
Additionally, it can export/un-export the GPIO devices for use by<br />
other non-root programms - e.g. Python scripts. (Although you<br />
may need to drop the calls to GPIO.Setup() in the Python scripts, and<br />
do the setup separately in a little shell script, or call the '''gpio''' program<br />
from inside Python).<br />
<br />
<pre><br />
gpio export 17 out<br />
gpio export 18 in<br />
</pre><br />
<br />
These exports GPIO-17 and sets it to output, and exports GPIO-18<br />
and sets it to input. <br />
<br />
And when done:<br />
<br />
<pre><br />
gpio unexport 17<br />
</pre><br />
<br />
The export/unexport commands always use the BCM GPIO pin numbers regardless of the<br />
presence of the '''-g''' flag or not.<br />
<br />
If you want to use the internal pull-up/down's with the /sys/class/gpio mechanisms,<br />
then you can set them after exporting them. So:<br />
<br />
<pre><br />
gpio -g export 4 in<br />
gpio -g mode 4 up<br />
</pre><br />
<br />
You can then use GPIO-4 as an input in your Python, Shell, Java, etc. programs without the use<br />
of an external resistor to pull the pin high. (If that's what you were after - for example, a simple push<br />
button switch taking the pin to ground.)<br />
<br />
A fully working example of a shell script using the GPIO pins<br />
can be found at http://project-downloads.drogon.net/files/gpioExamples/tuxx.sh.<br />
<br />
<br />
=== Lazarus / Free Pascal ===<br />
[[File:RPI GPIO testprogram with lazarus.png|thumb|254px|right|A simple app for controlling GPIO pin 17 with Lazarus]]<br />
<br />
The GPIO pins are accessible from [[Lazarus on RPi|Lazarus]] without any third-party software. This is performed by means of the [http://www.freepascal.org/docs-html/rtl/baseunix/index.html BaseUnix] unit that is part of every distribution of Lazarus and Free Pascal or by invoking Unix shell commands with '''fpsystem'''. The following example uses GPIO pin 17 as output port. It is assumed that you created a form with a TToggleBox named GPIO17ToggleBox and for logging purposes a TMemo with name LogMemo (optional). The program has to be executed with root privileges.<br />
<br />
''Unit for controlling the GPIO port:''<br />
<pre><br />
unit Unit1;<br />
<br />
{Demo application for GPIO on Raspberry Pi}<br />
{Inspired by the Python input/output demo application by Gareth Halfacree}<br />
{written for the Raspberry Pi User Guide, ISBN 978-1-118-46446-5}<br />
<br />
{$mode objfpc}{$H+}<br />
<br />
interface<br />
<br />
uses<br />
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,<br />
Unix, BaseUnix;<br />
<br />
type<br />
<br />
{ TForm1 }<br />
<br />
TForm1 = class(TForm)<br />
LogMemo: TMemo;<br />
GPIO17ToggleBox: TToggleBox;<br />
procedure FormActivate(Sender: TObject);<br />
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);<br />
procedure GPIO17ToggleBoxChange(Sender: TObject);<br />
private<br />
{ private declarations }<br />
public<br />
{ public declarations }<br />
end;<br />
<br />
const<br />
PIN_17: PChar = '17';<br />
PIN_ON: PChar = '1';<br />
PIN_OFF: PChar = '0';<br />
OUT_DIRECTION: PChar = 'out';<br />
<br />
var<br />
Form1: TForm1;<br />
gReturnCode: longint; {stores the result of the IO operation}<br />
<br />
implementation<br />
<br />
{$R *.lfm}<br />
<br />
{ TForm1 }<br />
<br />
procedure TForm1.FormActivate(Sender: TObject);<br />
var<br />
fileDesc: integer;<br />
begin<br />
{ Prepare SoC pin 17 (pin 11 on GPIO port) for access: }<br />
try<br />
fileDesc := fpopen('/sys/class/gpio/export', O_WrOnly);<br />
gReturnCode := fpwrite(fileDesc, PIN_17[0], 2);<br />
LogMemo.Lines.Add(IntToStr(gReturnCode));<br />
finally<br />
gReturnCode := fpclose(fileDesc);<br />
LogMemo.Lines.Add(IntToStr(gReturnCode));<br />
end;<br />
{ Set SoC pin 17 as output: }<br />
try<br />
fileDesc := fpopen('/sys/class/gpio/gpio17/direction', O_WrOnly);<br />
gReturnCode := fpwrite(fileDesc, OUT_DIRECTION[0], 3);<br />
LogMemo.Lines.Add(IntToStr(gReturnCode));<br />
finally<br />
gReturnCode := fpclose(fileDesc);<br />
LogMemo.Lines.Add(IntToStr(gReturnCode));<br />
end;<br />
end;<br />
<br />
procedure TForm1.FormClose(Sender: TObject; var CloseAction: TCloseAction);<br />
var<br />
fileDesc: integer;<br />
begin<br />
{ Free SoC pin 17: }<br />
try<br />
fileDesc := fpopen('/sys/class/gpio/unexport', O_WrOnly);<br />
gReturnCode := fpwrite(fileDesc, PIN_17[0], 2);<br />
LogMemo.Lines.Add(IntToStr(gReturnCode));<br />
finally<br />
gReturnCode := fpclose(fileDesc);<br />
LogMemo.Lines.Add(IntToStr(gReturnCode));<br />
end;<br />
end;<br />
<br />
procedure TForm1.GPIO17ToggleBoxChange(Sender: TObject);<br />
var<br />
fileDesc: integer;<br />
begin<br />
if GPIO17ToggleBox.Checked then<br />
begin<br />
{ Swith SoC pin 17 on: }<br />
try<br />
fileDesc := fpopen('/sys/class/gpio/gpio17/value', O_WrOnly);<br />
gReturnCode := fpwrite(fileDesc, PIN_ON[0], 1);<br />
LogMemo.Lines.Add(IntToStr(gReturnCode));<br />
finally<br />
gReturnCode := fpclose(fileDesc);<br />
LogMemo.Lines.Add(IntToStr(gReturnCode));<br />
end;<br />
end<br />
else<br />
begin<br />
{ Switch SoC pin 17 off: }<br />
try<br />
fileDesc := fpopen('/sys/class/gpio/gpio17/value', O_WrOnly);<br />
gReturnCode := fpwrite(fileDesc, PIN_OFF[0], 1);<br />
LogMemo.Lines.Add(IntToStr(gReturnCode));<br />
finally<br />
gReturnCode := fpclose(fileDesc);<br />
LogMemo.Lines.Add(IntToStr(gReturnCode));<br />
end;<br />
end;<br />
end;<br />
<br />
end.<br />
</pre><br />
<br />
''Main program:''<br />
<pre><br />
program io_test;<br />
<br />
{$mode objfpc}{$H+}<br />
<br />
uses<br />
{$IFDEF UNIX}{$IFDEF UseCThreads}<br />
cthreads,<br />
{$ENDIF}{$ENDIF}<br />
Interfaces, // this includes the LCL widgetset<br />
Forms, Unit1<br />
{ you can add units after this };<br />
<br />
{$R *.res}<br />
<br />
begin<br />
Application.Initialize;<br />
Application.CreateForm(TForm1, Form1);<br />
Application.Run;<br />
end.<br />
</pre><br />
<br />
Alternative ways to access the GPIO port with Lazarus / Free Pascal is by using [http://www.lazarus.freepascal.org/index.php/topic,17404.0.html Lazarus wrapper unit for Gordon Henderson's wiringPi C library] or [http://wiki.lazarus.freepascal.org/Lazarus_on_Raspberry_Pi#2._Hardware_access_via_encapsulated_shell_calls encapsulated shell calls].<br />
<br />
The [http://wiki.freepascal.org/Lazarus_on_Raspberry_Pi Lazarus wiki] describes a [http://wiki.freepascal.org/Lazarus_on_Raspberry_Pi#Reading_the_status_of_a_port demo program] that can read the status of a GPIO pin.<br />
<br />
=== BASIC ===<br />
==== BASIC - Return to BASIC ====<br />
<br />
'''RTB''' or Return to Basic can be found here: https://projects.drogon.net/return-to-basic/<br />
<br />
It's a new BASIC featuring modern looping constructs, switch statements, named procedures and functions as well as graphics (caresian and turtle), file handling and more. It also supports the Pi's on-board GPIO without needing to be run as root. (You don't need any special setup routines either)<br />
<br />
Sample blink program:<br />
<br />
<pre><br />
// blink.rtb:<br />
// Blink program in Return to Basic<br />
// Gordon Henderson, projects@drogon.net<br />
//<br />
PinMode (0, 1) // Output<br />
CYCLE <br />
DigitalWrite (0, 1) // Pin 0 ON<br />
WAIT (0.5) // 0.5 seconds<br />
DigitalWrite (0, 0)<br />
WAIT (0.5)<br />
REPEAT <br />
END <br />
</pre><br />
<br />
==== BASIC ====<br />
<br />
'''Bywater BASIC Interpreter'''<br />
<br />
The Bywater BASIC Interpreter (bwBASIC) implements a large superset of the ANSI Standard for Minimal BASIC (X3.60-1978) and a significant subset of the ANSI Standard for Full BASIC (X3.113-1987) in C. It also offers shell programming facilities as an extension of BASIC. bwBASIC seeks to be as portable as possible. <br />
You can download it at.<br />
http://packages.debian.org/stable/interpreters/bwbasic<br />
<br />
'''BASIC programming of the I/O'''<br />
<br />
'''Setting up a GPIO pin to be used for inputs or for outputs.'''<br />
<br />
We cannot load the control words directly into the 32 bit ARM registers with 32 bit addresses, as bwBASIC has no POKE and PEEK commands and other versions of BASIC (as far as I know) only handle 8 bit registers with 16 bit addresses with these commands. So we need to export the GPIO pins, so that they exist in a file structure which we can access from basic with the OPEN command.(ref 2)<br />
<br />
We need to do this in Linux root.<br />
We need to run BASIC in the root too. First we go to the root, then we load bwbasic into root.<br />
<pre><br />
sudo -1<br />
sudo bwbasic<br />
</pre><br />
<br />
REM Now to export the no4 GPIO pin for example, using a Shell command.<br />
<br />
<pre>echo “4” > /sys/class/gpio/export</pre><br />
<br />
Whilst bwbasic can accommodate shell commands, and we can store a set of these commands (eg. to export a number of GPIO pins at the outset) as numbered statements in a file that can be loaded with the basic command LOAD “filename” and RUN (ref 2), the shell commands have to run as a separate file, as they cannot be run from within, as part of a basic programme.<br />
<br />
'''Now we can access the file containing the pin direction setting from BASIC'''<br />
<br />
We can set GPIO pin 4 to input or to output by OPENing its pin direction file for output and writing “in” or “out” with a PRINT# command. (ref 2 )<br />
<syntaxhighlight lang="basic4gl"><br />
10 OPEN ”O”,#1, “/sys/devices/virtual/gpio/gpio4/direction”,2<br />
20 PRINT #1,”out”<br />
30 CLOSE #1<br />
</syntaxhighlight><br />
<br />
REM closes the open direction file, whereupon the system performs the action of setting the direction to “out”. NB the system only carries out the action as the file is closed.(ref 3)<br />
<br />
'''We are now able to control the output of the gpio 4 pin from BASIC'''<br />
<br />
We can set the GPIO 4 pin to 1 or to 0 by OPENing its pin value file for output and writing “1” or “0” with a PRINT# command.<br />
<syntaxhighlight lang="basic4gl"><br />
40 OPEN ”O”,#4, “/sys/devices/virtual/gpio/gpio4/value”,1<br />
50 PRINT #4,”1”<br />
60 CLOSE #4 <br />
</syntaxhighlight><br />
<br />
REM turns on the output of GPIO pin 4.<br />
<br />
REM similarly we can turn off the output of GPIO pin 4.<br />
OPEN ”O”,#4, “/sys/devices/virtual/gpio/gpio4/value”,1<br />
PRINT #4,”0”<br />
CLOSE #4.<br />
<br />
'''Example of an (unstructured) BASIC programme''' <br />
<br />
To read the state of a switch and control the power to two LEDs connected to GPIO pins 8,7 and 4 respectively.<br />
<br />
Programme to set 2 pins as outputs and 1 pin as input and to read the input turning on two different combinations of the two outputs (ie output 0,1 or 1,0) depending on the state of the input (1 or 0).<br />
<syntaxhighlight lang="basic4gl"><br />
sudo –i<br />
sudo bwbasic<br />
LOAD “export.bas”<br />
LIST<br />
REM a set of Shell statements to export the three GPIO pins.<br />
10 echo “4” > /sys/class/gpio/export<br />
20 echo “7” > /sys/class/gpio/export<br />
30 echo “8” > /sys/class/gpio/export<br />
RUN<br />
</syntaxhighlight><br />
<br />
NEW REM clears the export.bas programme from memory<br />
<syntaxhighlight lang="basic4gl"><br />
.<br />
LOAD “demo1.bas”<br />
LIST<br />
10 OPEN ”O”,#1, “/sys/devices/virtual/gpio/gpio4/direction”,2 <br />
20 OPEN ”O”,#2, “/sys/devices/virtual/gpio/gpio7/direction”,2 <br />
30 OPEN ”O”,#3, “/sys/devices/virtual/gpio/gpio8/direction”,2<br />
REM opens the three pin direction files<br />
40 PRINT #1, “out”<br />
50 PRINT #2, “out”<br />
60 PRINT #3, “in”<br />
REM sets GPIO pins 4 and 7 as outputs and GPIO pin 8 as input.<br />
70 CLOSE #1<br />
80 CLOSE #2<br />
90 CLOSE #3<br />
REM closes all open files, allowing the system to perform the direction settings.<br />
100 OPEN ”I”,#8, “/sys/devices/virtual/gpio/gpio8/value”,1<br />
REM opens the GPIO pin 8 value file<br />
110 INPUT #8,x<br />
REM reads the value of the input pin and stores the value in numerical variable x<br />
120 CLOSE #8<br />
REM closes the open file, allowing the system to read the value of the input pin and store the value in numerical variable x.<br />
130 OPEN “O”,#1, “/sys/devices/virtual/gpio/gpio4/value”,1<br />
140 OPEN “O”,#2, “/sys/devices/virtual/gpio/gpio7/value”,1<br />
REM opens the GPIO pins 4 and value files ready for outputting 1s and 0s.<br />
150 IF x<1 THEN GOTO 160 ELSE GOTO 190<br />
REM tests the state of the switch (1 or0) and directs the program to generate the appropriate outputs<br />
160 PRINT #1,”1”<br />
170 PRINT #2,”0”<br />
180 GOTO 210<br />
190 PRINT#1,"0"<br />
200 PRINT #2,"1"<br />
210 CLOSE #1<br />
220 CLOSE #2<br />
REM Closes the files and allows the outputs to light the LED<br />
230 END.<br />
</syntaxhighlight><br />
<br />
When all is done, we should unexport the GPIO pins, to leave the R-Pi as we found it.(Ref 1.)<br />
<syntaxhighlight lang="basic4gl"><br />
NEW<br />
LOAD “unexport.bas”<br />
LIST<br />
REM a set of Shell statements to unexport the three GPIO pins.<br />
10 echo “4” > /sys/class/gpio/unexport<br />
20 echo “7” > /sys/class/gpio/unexport<br />
30 echo “8” > /sys/class/gpio/unexport<br />
RUN<br />
</syntaxhighlight><br />
A simple circuit to provide the switched input and the two LED outputs.<br />
<br />
Ancient Mariner. Dec. 2012<br />
<br />
References.<br />
<br />
1. This paper RPi Low-level peripherals.<br />
<br />
2. Ed Beynon. [http://www.ybw.com/forums/showthread.php?t=331320&page=5 http://www.ybw.com/forums/showthread.php?t=331320&page=5]<br />
<br />
3. Arthur Kaletzky. Private communication. 25/10/2012<br />
<br />
4. bwbasic manual.<br/><br />
<br />
For the two original documents this example has been copied from see:<br/><br />
[[Media:GPIO_Driving_Example_(BASIC)_.doc | GPIO_Driving_Example_(BASIC)_.doc]]<br />
<br />
[[Media:Raspberry_Pi_I-O_viii.doc | Raspberry_Pi_I-O_viii.doc]]<br />
<br />
==SPI==<br />
<br />
There is one SPI bus brought out to the header: [[RPi_SPI]]<br />
<br />
==MIPI CSI-2==<br />
<br />
On the production board<ref>http://www.raspberrypi.org/wp-content/uploads/2012/04/Raspberry-Pi-Schematics-R1.0.pdf</ref>, the Raspberry Pi Foundation design brings out the MIPI CSI-2 (Camera Serial Interface<ref>http://www.mipi.org/specifications/camera-interface</ref>) to a 15-way flat flex connector S5, between the Ethernet and HDMI connectors. A compatible camera<ref>http://elinux.org/Rpi_Camera_Module</ref> with 5 Megapixels and 1080p video resolution was released in May 2013.<br />
<br />
==DSI==<br />
<br />
On the production board, the Raspberry Pi Foundation design brings out the DSI (Display Serial Interface<ref>http://www.mipi.org/specifications/display-interface</ref>) to a 15-way flat flex connector labelled S2, next to Raspberry Pi logo. It has two data lanes and a clock lane, to drive a possible future LCD screen device. Some smart phone screens use DSI<ref>http://en.wikipedia.org/wiki/Display_Serial_Interface</ref>.<br />
<br />
==CEC==<br />
<br />
[[CEC (Consumer Electronics Control) over HDMI|HDMI-CEC (Consumer Electronics Control for HDMI)]] is supported by hardware but some driver work will be needed and currently isn't exposed into Linux userland.<br />
Eben notes that he has seen CEC demos on the Broadcom SoC they are using. <br />
<br />
libCEC with Raspberry Pi support has been included in OpenELEC and will be included in Raspbmc RC4.<ref>http://blog.pulse-eight.com/2012/08/01/libcec-1-8-0-a-firmware-upgrade-and-raspberry-pi-support/</ref><br />
<br />
For more information about HDMI-CEC and what you could do with it on the Raspberry Pi please see the [[CEC (Consumer Electronics Control) over HDMI]] article.<br />
<br />
== References ==<br />
<references/><br />
<br />
<br />
{{Template:Raspberry Pi}}</div>JetForMe