Difference between revisions of "Beaglebone"
| (26 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
| − | <small>The beaglebone is similar to the RPI, but more powerful for microcontroller applications. There are more accessible GPIO | + | [[File:Beaglebone2.jpg|300px|thumb|right|]] |
| − | + | <small>The beaglebone is similar to the RPI, but more powerful for microcontroller applications. There are more accessible GPIO, peripherals, a PRU, and it has a bit more soul. | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
==Beaglebone Black== | ==Beaglebone Black== | ||
| Line 133: | Line 9: | ||
https://forum.beagleboard.org/t/how-to-force-boot-from-sd-card-other-than-by-holding-the-button-down/35633/6 | https://forum.beagleboard.org/t/how-to-force-boot-from-sd-card-other-than-by-holding-the-button-down/35633/6 | ||
| − | This is easier than moving a resistor. on the | + | This is easier than moving a resistor. on the BBB, it is pin P8_43 to ground. See the schematic. |
====Moving Resistor==== | ====Moving Resistor==== | ||
"...move R68 to R93 if you want to make the board boot from SD by default." | "...move R68 to R93 if you want to make the board boot from SD by default." | ||
| − | <small>ref: https://stackoverflow.com/questions/33030802/fix-the-boot-order-emmc-on-a-beagle-bone-black</small> | + | <small>ref: https://stackoverflow.com/questions/33030802/fix-the-boot-order-emmc-on-a-beagle-bone-black</small> This was the original advice I found, and it was incorrect as grounding a pin is easier. |
| − | |||
| − | |||
=====Instructions===== | =====Instructions===== | ||
| Line 163: | Line 37: | ||
And when it boots, it is the minimal alpine image, so you must install from there. | And when it boots, it is the minimal alpine image, so you must install from there. | ||
| − | I | + | I zeroed out the old possibly conflicting regions where the u-boot from the beagleboard debian images may have been left over (sgdisk --zap-all). Make sure the partition is bootable. NOTE: the alpine image listed above does not work with ethernet out of the box. May need to re-compile or use a usb hub and a different wifi or usb adapter (the config lists support for a lot of network cards). I found a usb ethernet adapter worked. |
For reference, here's what the README says in the alpine u-boot images. | For reference, here's what the README says in the alpine u-boot images. | ||
| Line 176: | Line 50: | ||
cp am335x_boneblack/{MLO,u-boot.img} /media/mmcblk0p1/ | cp am335x_boneblack/{MLO,u-boot.img} /media/mmcblk0p1/ | ||
</pre> | </pre> | ||
| − | Based on this, and on the stackexchange post above, you can see that every SBC will have different behavior when it loads the uboot files. And the reference manual, should give information on how it works. | + | Based on this, and on the stackexchange post above, you can see that every SBC will have different behavior when it loads the uboot files. And the reference manual, should give information on how it works. |
| + | |||
| + | ====u-boot Boot Log:==== | ||
| + | <pre> | ||
| + | -Boot SPL 2026.04 (Apr 21 2026 - 09:17:42 +0000) | ||
| + | Trying to boot from MMC1 | ||
| + | |||
| + | |||
| + | U-Boot 2026.04 (Apr 21 2026 - 09:17:42 +0000) | ||
| + | |||
| + | CPU : AM335X-GP rev 2.1 | ||
| + | Model: TI AM335x BeagleBone Green | ||
| + | DRAM: 512 MiB | ||
| + | Core: 162 devices, 19 uclasses, devicetree: separate | ||
| + | WDT: Started wdt@44e35000 with servicing every 1000ms (60s timeout) | ||
| + | NAND: 0 MiB | ||
| + | MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1 | ||
| + | Loading Environment from FAT... Unable to read "uboot.env" from mmc0:1... | ||
| + | <ethaddr> not set. Validating first E-fuse MAC | ||
| + | Net: eth2: ethernet@4a100000using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in | ||
| + | MAC de:ad:be:ef:00:01 | ||
| + | HOST MAC de:ad:be:ef:00:00 | ||
| + | RNDIS ready | ||
| + | , eth3: usb_ether | ||
| + | Hit any key to stop autoboot: 0 | ||
| + | switch to partitions #0, OK | ||
| + | mmc0 is current device | ||
| + | Scanning mmc 0:1... | ||
| + | Found /extlinux/extlinux.conf | ||
| + | Retrieving file: /extlinux/extlinux.conf | ||
| + | 1: Linux lts | ||
| + | Enter choice: 1: Linux lts | ||
| + | Retrieving file: /boot/vmlinuz-lts | ||
| + | Retrieving file: /boot/initramfs-lts | ||
| + | append: modules=loop,squashfs,sd-mod,usb-storage quiet | ||
| + | Retrieving file: /boot/dtbs-lts/am335x-bonegreen.dtb | ||
| + | Kernel image @ 0x82000000 [ 0x000000 - 0x81c200 ] | ||
| + | ## Flattened Device Tree blob at 88000000 | ||
| + | Booting using the fdt blob at 0x88000000 | ||
| + | Working FDT set to 88000000 | ||
| + | Loading Ramdisk to 8f529000, end 8ffff4ec ... OK | ||
| + | Loading Device Tree to 8f515000, end 8f528659 ... OK | ||
| + | Working FDT set to 8f515000 | ||
| + | |||
| + | Starting kernel ... | ||
| + | |||
| + | </pre> | ||
| + | Note that alpine 3.24 serial port stops here as the OMAP_8250 driver (# CONFIG_SERIAL_8250_OMAP is not set) is not installed in the kernel. Don't try to use a BBG. Use a BBB and install via HDMI, then migrate the working install to other machines (which is what I'm trying now). You can enable earlycon in extlinux.conf kernel parameters (earlycon=uart8250,mmio32,0x44e09000) to get some more output, but that too will stop (once the console starts). | ||
===No Video Display on Devuan/Debian 10 after Update=== | ===No Video Display on Devuan/Debian 10 after Update=== | ||
| Line 274: | Line 195: | ||
They should be in /lib/firmware/ (This page also has instructions to compile them). | They should be in /lib/firmware/ (This page also has instructions to compile them). | ||
| + | |||
| + | === DTB files can be Reverse Engineered === | ||
| + | I just learned this today. Ask a search engine. I'm not sure if they lose any comments or details, but it's better than nothing. There is a one line command to convert dtb to dts. | ||
==Beagleboard== | ==Beagleboard== | ||
[[File:Beagleboard_w-RS232_connected.jpg|300px|thumb|right|RS232 connected to docking station Serial In. Beagleboard works best with a dedicated 5V supply. When connecting via RS232, keep the grounds close.]] | [[File:Beagleboard_w-RS232_connected.jpg|300px|thumb|right|RS232 connected to docking station Serial In. Beagleboard works best with a dedicated 5V supply. When connecting via RS232, keep the grounds close.]] | ||
| − | The beagleboard is the original. It has more connectors | + | The beagleboard is the original. It has more connectors, however lacks ethernet. It has a good audio chip. |
Resources for beagleboard: | Resources for beagleboard: | ||
| Line 295: | Line 219: | ||
Angstrom loads on the old uboot without problem. Debian Buster Console (link: https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#Debian_Buster_Console_Snapshot_for_BeagleBoard-xM tested: bbxm-debian-10.4-console-xm-armhf-2020-05-18-1gb.img.xz) also loads, though requires holding user button upon boot (forces boot from mmc) due to uboot being ancient on the nand. See also: | Angstrom loads on the old uboot without problem. Debian Buster Console (link: https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#Debian_Buster_Console_Snapshot_for_BeagleBoard-xM tested: bbxm-debian-10.4-console-xm-armhf-2020-05-18-1gb.img.xz) also loads, though requires holding user button upon boot (forces boot from mmc) due to uboot being ancient on the nand. See also: | ||
https://elinux.org/BeagleBoardDebian | https://elinux.org/BeagleBoardDebian | ||
| − | |||
| − | |||
====Angstrom: Tweaks to make==== | ====Angstrom: Tweaks to make==== | ||
| Line 351: | Line 273: | ||
ref: | ref: | ||
https://www.raspberrypi.org/forums/viewtopic.php?t=168927 | https://www.raspberrypi.org/forums/viewtopic.php?t=168927 | ||
| + | |||
| + | ==PocketBeagle== | ||
| + | Connected via usb. Opens up cloud9 IDE, and gives you a web server connected arduino like interface to program the AM355x CPU. | ||
| + | |||
| + | ===Connecting to Beagle from host via usb=== | ||
| + | ip link | ||
| + | ip link set en2923492024 up (whatever the interface was renamed to - see dmesg) | ||
| + | dhclient en2923492024 OR ifconfig en2923492024 192.168.6.1 netmask 255.255.255.0 | ||
| + | ssh debian@192.168.6.2 (or 7.2) | ||
| + | |||
| + | See troubleshooting note about ipv4 not working below. | ||
| + | |||
| + | Here's a script I use on my beaglebone to connect to a beagleboard (similar when connected via usb)(this contains some of the steps mentioned below regarding internet sharing) | ||
| + | {{cat|/root/usb19216871.sh|#!/bin/bash | ||
| + | ip link set usb0 up | ||
| + | ifconfig usb0 192.168.7.1 netmask 255.255.255.0 | ||
| + | # less /opt/scripts/networking/doc-debian-setup.md | ||
| + | iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE | ||
| + | iptables --append FORWARD --in-interface usb0 -j ACCEPT | ||
| + | sysctl net.ipv4.ip_forward=1}} | ||
| + | |||
| + | ===GNU\Linux Sharing internet with Pocketbeagle over USB=== | ||
| + | Had some trouble with this today. This guide: https://elementztechblog.wordpress.com/2014/12/22/sharing-internet-using-network-over-usb-in-beaglebone-black/ does NOT work. These guides are also no good: https://unix.stackexchange.com/questions/520528/sharing-internet-using-network-over-usb-in-raspberry-zero-based-on-beaglebone | ||
| + | These steps are partially covered in the official beagle directory here: /opt/scripts/network/doc-debian-setup.md | ||
| + | |||
| + | |||
| + | You don't need to setup a bridge. It might work that way, but its not required. What works is the following: | ||
| + | * (pocketbeagle) Add route w/host ip | ||
| + | * (host) enable packet forwarding | ||
| + | * (host) NAT forwarding | ||
| + | * (pocketbeagle) DNS - resolv.conf | ||
| + | |||
| + | ====On beagle==== | ||
| + | '''Have Pocketbeagle Route to Host''' | ||
| + | # route add default gw 192.168.6.1 | ||
| + | Or 192.168.7.1, see # route | ||
| + | |||
| + | ====On Host==== | ||
| + | '''Enable packet forwarding on Host''' | ||
| + | |||
| + | Check the current packet forwarding settings: | ||
| + | |||
| + | # sysctl -a | grep forward | ||
| + | |||
| + | You will note that options exist for controlling forwarding per default, per interface, as well as separate options for IPv4/IPv6 per interface. | ||
| + | |||
| + | Enter this command to temporarily enable packet forwarding at runtime: | ||
| + | |||
| + | # sysctl net.ipv4.ip_forward=1 | ||
| + | |||
| + | Edit /etc/sysctl.d/30-ipforward.conf to make the previous change persistent after a reboot for all interfaces: | ||
| + | |||
| + | /etc/sysctl.d/30-ipforward.conf | ||
| + | |||
| + | net.ipv4.ip_forward=1 | ||
| + | |||
| + | Afterwards it is advisable to double-check forwarding is enabled as required after a reboot. | ||
| + | '''Enable NAT on Host''' | ||
| + | With iptables | ||
| + | |||
| + | # iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE | ||
| + | # iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT | ||
| + | # iptables -A FORWARD -i usb0 -o eth0 -j ACCEPT | ||
| + | |||
| + | <small> | ||
| + | Iface names can vary depending on distro. What's important is that you are trying to with iptables -A FORWARD -i usb0 -o eth0 -j ACCEPT, is forward input from the pocketbeagle NIC (in this case usb0, but it can be eth1 or en289929442 or something), to the main iface on the host. Here eth0. To recap: | ||
| + | |||
| + | eth0: whatever host main iface | ||
| + | |||
| + | usb0: whatever beagle usb gadget iface | ||
| + | |||
| + | </small> | ||
| + | |||
| + | ref: https://wiki.archlinux.org/index.php/Internet_Sharing | ||
| + | |||
| + | '''route on host:''' | ||
| + | usually not required, but in case it is: | ||
| + | ip route add 192.168.7.0/24 dev eth0 | ||
| + | <small>todo: example with normal route cmd</small> | ||
| + | |||
| + | ====Fix DNS on beagle==== | ||
| + | At this point, you will have ip routing (i.e. ping to lan from beagle by ip will work), but DNS isn't setup yet. To get DNS working put your preferred name server in /etc/resolv.conf | ||
| + | nameserver 192.168.1.1 | ||
| + | |||
| + | Note: If you are testing an existing ping, when you change the iptables settings, you must stop / start a new ping to see the changes take effect. | ||
| + | Note: It's nameserver ###.###.###.###, not just the #. | ||
| + | |||
| + | Question: Why isn't /etc/resolv.conf called /etc/nameserver ? How about a symbolic link? Is that too obvious? | ||
| + | |||
| + | ===IPv4 usb Interface Not Working=== | ||
| + | Had ipv4 not working for pocketbeagle today. Same image, same computer... Throw it out the window. | ||
| + | |||
| + | dhclient of usb interface on host gave only ipv6 address. ssh was able to connect via beagle's ipv6 address (ipv6%interface, e.g. ssh debian@fe80%usb1) | ||
| + | |||
| + | the two virtual usb ethernet interfaces that show up in host are always 192.168.7 or 192.168.6 range. Try one, if you can't ping the beagle at 192.168.6.2 (it's always 2) then try the 7 range. | ||
| + | (on host) | ||
| + | ifconfig en238240224 192.168.6.1 | ||
| + | ping 192.168.6.2 | ||
| + | |||
| + | ===Sysvinit on pocketbeagle=== | ||
| + | (Via Devuan): Breaks ssh usb access. Only use if you have a wifi/ethernet adapter connected and ip info set in /etc/network/interfaces, or UART connected. | ||
| + | |||
| + | May have to edit inittab to add (correct) serial. See beagleboard section. | ||
| + | |||
| + | ===Alpine on pocketbeagle=== | ||
| + | This script doesn't compile on Debian (Devuan) Stretch (kernel phase. uboot compiles). GCC appears to be the wrong version. GCC 5 has been removed from Debian stretch repos. | ||
| + | https://github.com/BrianSidebotham/alpine-on-bbb | ||
| + | |||
| + | See notes about alpine on beaglebone. | ||
| + | |||
| + | ===Change Partition Size on SD=== | ||
| + | https://elinux.org/Beagleboard:Expanding_File_System_Partition_On_A_microSD | ||
| + | |||
| + | ===Gamepup=== | ||
| + | First, see the official cape instructions (they are short): | ||
| + | https://github.com/beagleboard/pocketbeagle/wiki/GamePup-cape | ||
| + | ====TTY | login screen on LCD==== | ||
| + | I migrated to devuan and added a tty to the inittab. The console can be rotated. | ||
| + | |||
| + | /sys/class/graphics/fbcon# echo 1 > rotate | ||
| + | |||
| + | See also: [[How_to_do_things_with_the_beaglebone]] | ||
| + | ====Buttons==== | ||
| + | Work out of the box by default. | ||
| + | |||
==Tips\Techniques== | ==Tips\Techniques== | ||
| Line 360: | Line 407: | ||
===Power Consumption of Newer Beagles and RPIs=== | ===Power Consumption of Newer Beagles and RPIs=== | ||
One benefit of the Beaglebone (and the older RPI3 as opposed to 4 and 5) is that they use less power than the newer devices. Some sources online are saying the BBB can run off of 5V 1A. I'm not sure about that (might be possible if there are no peripherals), but if there is some truth to that, then it somewhat evens the playing field for the newer devices. Sure, you can get a more powerful device, but it will require more power. | One benefit of the Beaglebone (and the older RPI3 as opposed to 4 and 5) is that they use less power than the newer devices. Some sources online are saying the BBB can run off of 5V 1A. I'm not sure about that (might be possible if there are no peripherals), but if there is some truth to that, then it somewhat evens the playing field for the newer devices. Sure, you can get a more powerful device, but it will require more power. | ||
| + | |||
| + | ===List of Applications for SBCs=== | ||
| + | Here are some things that I have considered or are working on with the beagleboards / beaglebones and ones that don't work. | ||
| + | ====Applications==== | ||
| + | * General data logging with sensors (easy with the OS. I.e. you can monitor temperature, or an accelerometer and then store in text files or a db, later displaying the data with graphs). | ||
| + | * Alarm system (This is a classic project for electronics, but it is good for something like an rpi or beagle as you can setup automated email alerts since you have ethernet). You can use one beagle and connect a number of alarms to the 0.1" headers. You could also use RF alarms potentially, with the SBC as a gateway. | ||
| + | * Radio monitoring (By connecting up one of the tv tuner usb adapters, you could interface to something like GNU Radio. I'm not sure what you might be looking for, but if you have access to different locations, you would get different results depending on where you are.). | ||
| + | * Software that any x86 computer can do, but with less power consumption. (I will omit any more software specific details, and try to focus on hardware applications of the SBCs. Most anything that runs on Linux will likely work here.). | ||
| + | |||
| + | ====What Doesn't Work As Well==== | ||
| + | * Any CPU intensive process that would be better off on an x86 server. | ||
| + | * Some x86 specific programs don't run on ARM (such as anything with code in x86 asm). | ||
| + | * X/Wayland dependent software or desktop environments that might be too slow for the limited resources of an SBC. (i.e. you are better off using these as headless or for console purposes. Though custom GUIs are not a bad idea, from what I've seen.). | ||
==See also== | ==See also== | ||
Latest revision as of 07:09, 23 September 2026
The beaglebone is similar to the RPI, but more powerful for microcontroller applications. There are more accessible GPIO, peripherals, a PRU, and it has a bit more soul.
Beaglebone Black
Always Boot from SD Card
Ground A Pin
This is easier than moving a resistor. on the BBB, it is pin P8_43 to ground. See the schematic.
Moving Resistor
"...move R68 to R93 if you want to make the board boot from SD by default."
ref: https://stackoverflow.com/questions/33030802/fix-the-boot-order-emmc-on-a-beagle-bone-black This was the original advice I found, and it was incorrect as grounding a pin is easier.
Instructions
Put some leaded solder on both sides of R68 (bottom of board, the silkscreen is misplaced, but just count down the line). Use hot air to remove R68, being careful not to use too much air flow which will knock the resistor off your bench, onto the floor. The resistor is a 100K, in case you lose it.
After removing the resistor, use an iron to put small dobs of leaded solder on pad R93 (top side of board). Use hot air to heat the board until the solder is fluid, then place the 100K R onto R93, heating as necessary while being careful not to blow the resistor away.
Where are the registers for the BBB?
AM335x_TechnicalReferenceManual.pdf
e.g. https://www.ti.com/lit/ug/spruh73q/spruh73q.pdf
To read/write a value, see the note about devmem2 below.
Booting Alpine on the Beaglebone
About 2-3 hours of work. https://wiki.alpinelinux.org/wiki/Alpine_on_ARM is the basic guide to follow. There is a lot of instructions online that are not necessarily helpful. https://www.beagleboard.org/blog/2022-06-06-using-the-u-boot-extension-board-manager-beaglebone-boards-example Is not necessary. These guides https://elinux.org/Category:ECE497 Are incomplete, though they are somewhat useful. (for example: https://elinux.org/EBC_Exercise_22_Recovering Doesn't have enough detail to start from scratch (how do you format the partitions), and https://elinux.org/EBC_Exercise_03_Installing_a_Beagle_OS uses one of those programs (balenaetcher) that are unnecessary on Linux when you have dd and fdisk. This https://elinux.org/EBC_Exercise_21a_Boot_Sequence only covers using u-boot, not the installation / partitioning of u-boot. Not helpful. This gives some hand-wavey instructions but is not thorough enough: https://elinux.org/Beagleboard:U-boot_partitioning_layout_2.0 However, this stackexchange article is well documented https://stackoverflow.com/questions/60873038/how-to-write-new-mlo-and-u-boot-img-to-an-sd-card-without-erasing-the-os Though it shows how difficult it is to find the info. It points to the am355x reference manual. It also indicates that old pre-existing MLO and uboot images may need to be zeroed on the sd card.
Anyways, with all those links being reviewed, you can look back at the alpine_on_arm page. Also download the generic u-boot alpine image (not the standard one) https://dl-cdn.alpinelinux.org/alpine/v3.21/releases/armv7/alpine-uboot-3.21.3-armv7.tar.gz which has a README, in the u-boot folder (easy to miss, and obscure) that indicates, that for the beaglebone, you need the MLO and u-boot.img (that they provide) copied to the beginning of the first FAT partition of the disk. This is similar but reversed from the alpine_on_arm page's instructions. Anyways, doing this, then you simply (tar -xf alpine-uboot img --directory=sdcard) to the rest of the partition. Make sure the partition is big enough. 100M won't be enough, so I used 1G. Then finally, load the sd card in the bbb and it should just boot.
Note that the generic uboot folder in the alpine image contains a number of uboot images for a variety of arm boards, such as the Cubieboard, RPI, and Bananapi. I would recommend you look at these entries to see how the uboot loading differs. Those boards will be likely to work, given someone went to the trouble of including them in the image.
And when it boots, it is the minimal alpine image, so you must install from there.
I zeroed out the old possibly conflicting regions where the u-boot from the beagleboard debian images may have been left over (sgdisk --zap-all). Make sure the partition is bootable. NOTE: the alpine image listed above does not work with ethernet out of the box. May need to re-compile or use a usb hub and a different wifi or usb adapter (the config lists support for a lot of network cards). I found a usb ethernet adapter worked.
For reference, here's what the README says in the alpine u-boot images.
BeagleBoard
-----------
- ROM looks for 1st partition with FAT, and loads MLO from it
- NOTE: MLO needs to be the first file created on this partition
- Install u-boot with:
cp am335x_boneblack/{MLO,u-boot.img} /media/mmcblk0p1/
Based on this, and on the stackexchange post above, you can see that every SBC will have different behavior when it loads the uboot files. And the reference manual, should give information on how it works.
u-boot Boot Log:
-Boot SPL 2026.04 (Apr 21 2026 - 09:17:42 +0000) Trying to boot from MMC1 U-Boot 2026.04 (Apr 21 2026 - 09:17:42 +0000) CPU : AM335X-GP rev 2.1 Model: TI AM335x BeagleBone Green DRAM: 512 MiB Core: 162 devices, 19 uclasses, devicetree: separate WDT: Started wdt@44e35000 with servicing every 1000ms (60s timeout) NAND: 0 MiB MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1 Loading Environment from FAT... Unable to read "uboot.env" from mmc0:1... <ethaddr> not set. Validating first E-fuse MAC Net: eth2: ethernet@4a100000using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in MAC de:ad:be:ef:00:01 HOST MAC de:ad:be:ef:00:00 RNDIS ready , eth3: usb_ether Hit any key to stop autoboot: 0 switch to partitions #0, OK mmc0 is current device Scanning mmc 0:1... Found /extlinux/extlinux.conf Retrieving file: /extlinux/extlinux.conf 1: Linux lts Enter choice: 1: Linux lts Retrieving file: /boot/vmlinuz-lts Retrieving file: /boot/initramfs-lts append: modules=loop,squashfs,sd-mod,usb-storage quiet Retrieving file: /boot/dtbs-lts/am335x-bonegreen.dtb Kernel image @ 0x82000000 [ 0x000000 - 0x81c200 ] ## Flattened Device Tree blob at 88000000 Booting using the fdt blob at 0x88000000 Working FDT set to 88000000 Loading Ramdisk to 8f529000, end 8ffff4ec ... OK Loading Device Tree to 8f515000, end 8f528659 ... OK Working FDT set to 8f515000 Starting kernel ...
Note that alpine 3.24 serial port stops here as the OMAP_8250 driver (# CONFIG_SERIAL_8250_OMAP is not set) is not installed in the kernel. Don't try to use a BBG. Use a BBB and install via HDMI, then migrate the working install to other machines (which is what I'm trying now). You can enable earlycon in extlinux.conf kernel parameters (earlycon=uart8250,mmio32,0x44e09000) to get some more output, but that too will stop (once the console starts).
No Video Display on Devuan/Debian 10 after Update
I ran into this. As soon as you update via apt in Debian, or migrate to Devuan, the text console fails (from the Debian 10 text console images on beagleboard.org) You have to use the TI kernels from the official BBB repo included with the Debian images. I tried one of the default arm kernels (debian repos), but this did not boot. Note that this is only if you are using a console only image. I think with X/xfce4, the display should work. See: https://forum.beagleboard.org/t/bb-black-not-displaying-on-reboot/30823
The tools to use are the official beaglebone tools, found in /opt/scripts/tools update_kernel.sh You might also have to run update-initramfs. Note that it's possible to manually edit the /boot/uEnv.text file to have multiple kernels, or to comment out the new one (if that fails to boot), so i have read.
I ran into this again, with a different Beaglebone Black (element 14 industrial version). See https://forum.digikey.com/t/no-signal-on-lcd-screen-using-beagle-bone-black-and-hdmi/1578 The /opt/scripts/tools/version.sh tool is helpful.
See also: https://forum.beagleboard.org/t/no-hdmi-output-on-beaglebone-black/22391 Which has the sys fs entry for the HDMI (useful).
e.g. apt install read-edid root@beaglebone:/sys/class/drm/card0/card0-HDMI-A-1# parse-edid < edid
Note that the Beagle will indicate the HDMI is enabled and connected, if you only connect a cable. You don't have to actually have a screen connected. At least in my setup.
Check that the cable hasn't failed. I had a cable fail on me inbetween beaglebones. That is near unbelievable. It worked one day, and then the next the cable was dead. So you technically, should have an ebay HDMI cable tester (I can't ever remember a time a VGA cable failed on me...).
Sadly, there isn't a step by step discussion of troubleshooting video output problems on the beaglebone anywhere. Just forum posts. That is a systematic failure of documentation. Maybe if I get time, I can make one on the elinux wiki. Ideally, there should be a single mediawiki page with all possible video output troubleshooting scenarios (instead of scattered forum posts).
Update && Change Kernel
There is the /opt/scripts/tools/update_kernel.sh tool. If you run this, it will only update the current kernel release to the latest release of the same #.## version. If you want to change to a new number that is not helpful. However, it will list other available kernels. This is good because an apt search linux-image comes up with too many results to dig through. So the update_kernel.sh will tell you what TI kernels are available. From there you just add linux-image to the beginning of whatever numbers they list there, and install one of those.
The trap is that if you try to apt install a debian arm kernel, the beagle may not even boot.
EDIT: See the ECE497 docs for instructions on updating.
Login to Console (HDMI LCD) without User Interaction
This always confuses me. I've done it before. It's handled with inittab.
Edit /etc/inittab (comment out existing, and add this below. Replace username with your new user): 1:2345:respawn:/bin/login -f USERNAME tty1 </dev/tty1 >/dev/tty1 2>&1
per https://wiki.zoneminder.com/Dedicated_SBC_Camera_Monitor#Auto_Start_Computer If you search this online, for some reason you don't get this answer.
Devmem2 Install
Sometimes you just want to change a memory address.
git clone https://github.com/VCTLabs/devmem2 cd devmem2 make make install
e.g. usage:
Append a memory adjustment to rc.local
nano /etc/rc.local devmem2 0x4c000054 w 0x00FFFFF10 (note: if you want to only read the address, simply omit the data to be written)
Watch syslog and FIFO errors should immediately stop upon entering write command on memory.
Install steps source: Scivision: Devmem2 on the beaglebone black The author of devmem2 (Jan-Derk Bakker, website and code found at lartmaker.nl), his website is down at the moment. You can view the root domain at internet archive, but the page for devmem2 is not available. Others like VCTLabs above have copied his code to various spots. See also the Notes section below. (NOTE: The above was taken from: https://wiki.zoneminder.com/index.php?title=Dedicated_SBC_Camera_Monitor&oldid=16692)
Looking at the devmem2 operation above, we can see the following:
$ sudo ./devmem2 0x4c000054 w /dev/mem opened. Memory mapped at address 0xb6f8e000. Read at address 0x4C000054 (0xb6f8e054): 0x00141414
Based on the memory map of the AM335xx reference manual, the address 0x4c000054 is the EMIF OCP_CONFIG register. Section 7 which is the memory. EMIF is for RAM configuration (DDR2/DDR3). The EM standing for External Memory. Section 7.3. So the fix above, was to adjust a type of class of service, priority, or niceness for the CPU and the RAM FIFO (to my limited understanding). The register change was to increase the priority of the RAM access to the CPU, I think.
Config-Pin
I found this tool helpful for configuring the pins. You will want to enable the cape-universal overlay in /boot/uEnv.txt (by uncommenting it, and you may need to comment out other overlays such as the PRU) then
git clone https://github.com/cdsteinkuehler/beaglebone-universal-io
The cape-universal overlay exports all pins except for HDMI and EMMC.
You don't have to make anything in that github. You only need the script.
See also: https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_Overlays https://forum.digikey.com/t/bbb-about-config-pin/31959 - This doesn't seem to work.
A lot of dead ends showing up on beaglebone black documentation, unfortunately. This seems like the most valuable link: https://forum.beagleboard.org/t/config-pin-tool-doesnt-work/2476/36 Which mentions that official beagleboard images won't work with config-pin. And to use: https://rcn-ee.net/rootfs/bb.org/testing/. You can verify what beagle image you have with beagle-version.
Actually, I found that if you enable the overlays (other than the cape-universal), it breaks config pin. So start out with no overlays, verify that config-pin works with the universal cape. Then you can enable a different cape (e.g. UART2) but you will find that config pin now fails on the UART2 pins. This is alluded to in the forums but they don't come to a solution. Here is a reference for this: https://forum.beagleboard.org/t/uart-from-c-on-beagle-bone-black/36675
Note that there are two versions of config-pin. The older bash script (which still works) and a newer limited c compiled script (that is reportedly easier to maintain).
beagle-version
version.sh → beagle-version
debian@BeagleBone:~$ sudo beagle-version eeprom:[A335BNLT00C02516BBBK2626] model:[TI_AM335x_BeagleBone_Black] dogtag:[BeagleBoard.org Debian Bullseye IoT Image 2021-12-29] <lots of debugging info>
Reference: https://forum.beagleboard.org/t/debian-11-x-bullseye-monthly-snapshots/31280#update-u-boot-6
This is useful to find out what overlays are loaded.
Verifying dtbo files are available
In order to edit uEnv.txt and add an overlay (to the 4th entry, not 1st I guess) you have to verify they exist.
https://elinux.org/EBC_Exercise_12a_2.4_TFT_LCD_display_via_SPI
They should be in /lib/firmware/ (This page also has instructions to compile them).
DTB files can be Reverse Engineered
I just learned this today. Ask a search engine. I'm not sure if they lose any comments or details, but it's better than nothing. There is a one line command to convert dtb to dts.
Beagleboard
The beagleboard is the original. It has more connectors, however lacks ethernet. It has a good audio chip.
Resources for beagleboard:
- https://elinux.org/BeagleBoard_Community#Board_recovery
- https://elinux.org/BeagleBoardRecovery
- https://elinux.org/BeagleBoardFAQ
- https://elinux.org/2010_ICASSP_Lab_2_The_Boot_Sequence
RS232 Serial is garbled and unreadable
Yes, I said RS232. This is not TTL levels. You need -12 and +12V, so use a RS232 port.
I resolved an issue of garbled serial by using an external 5V 3A PSU, and also by locating the laptop PSU adjacent to the BB PSU on mains via a power strip. Laptop USB did not work, nor did a 1A 0-12V adjustable PSU, as they were not close enough on the mains (different outlets)
I also had a poorly made thinkpad dock that required a 'hard' shutdown in order for rs232 to restart, after gnu screen was closed/reopened.
OS for original Beagleboard
Angstrom loads on the old uboot without problem. Debian Buster Console (link: https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#Debian_Buster_Console_Snapshot_for_BeagleBoard-xM tested: bbxm-debian-10.4-console-xm-armhf-2020-05-18-1gb.img.xz) also loads, though requires holding user button upon boot (forces boot from mmc) due to uboot being ancient on the nand. See also: https://elinux.org/BeagleBoardDebian
Angstrom: Tweaks to make
It boots up in systemd X11 session, which is using 60MB of RAM. First thing to do is disable X11. This uses an older systemd syntax, so it is something like
systemctl -h systemctl list-unit-files systemctl disable graphical.target systemctl enable multi-user.target
This will lower it to 30MB of RAM.
Debian Buster Console
Don't mess with Angstrom, use this instead. Link is buried and hard to find, but see: https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#Debian_Buster_Console_Snapshot_for_BeagleBoard-xM
Upgrading old UBoot for new Debian Images
WIP
Migrate to Devuan / Sysvinit
Requires modprobe g_ether (usb gagdet for ethernet) to /etc/modules Requires adding serial to /etc/inittab Make it easier by using usb to ethernet adapter (or wifi). e.g. Beagleboard_inittab_and_modules See Beaglebone#Note_on_connman
always boot usb0
When migrating to devuan you need modprobe g_ether in /etc/modules or modprobe.conf (forget which).
in /etc/rc.local add
ip link set usb0 up
in /etc/network/interfaces add
auto usb0
iface usb0 inet static
address 192.168.7.2
netmask 255.255.255.0
gateway 192.168.7.1
note that the official bbb images have a netmask of 255.255.255.252 for these usb interfaces, but I will ignore that. They also use scripts e.g. /opt/scripts/boot/autoconfigure_usb0.sh which are messier than above.
S-video output
The SVideo output is Luminance/Sync (Y) and Chroma(C). You can turn this into composite, and then output to a CRT.
Adjust the font size of the local svideo tty with dpkg-reconfigure console-font. Review the different fonts as they have different max sizes. Some are easier to read than others.
Note on connman
During a sysvinit/devuan install, I uninstalled connman on my pocketbeagle in an effort to diagnose routing issues (because I had an usb to ethernet adapter, my routes were not working for usb rndis gadget to host). I thought I was locked out and would have to install from .deb but in fact connman is not required for the interfaces to be brought up. I disconnected the usb-ethernet adapter, added a route on the host to the usb subnet, and was able to login via the usb gadget.
Can't Install Xorg on Beagleboard
apt-get install xorg
fails due to dependencies solution:
apt-get install xserver-xorg-legacy
ref: https://www.raspberrypi.org/forums/viewtopic.php?t=168927
PocketBeagle
Connected via usb. Opens up cloud9 IDE, and gives you a web server connected arduino like interface to program the AM355x CPU.
Connecting to Beagle from host via usb
ip link ip link set en2923492024 up (whatever the interface was renamed to - see dmesg) dhclient en2923492024 OR ifconfig en2923492024 192.168.6.1 netmask 255.255.255.0 ssh debian@192.168.6.2 (or 7.2)
See troubleshooting note about ipv4 not working below.
Here's a script I use on my beaglebone to connect to a beagleboard (similar when connected via usb)(this contains some of the steps mentioned below regarding internet sharing)
Contents of /root/usb19216871.sh
GNU\Linux Sharing internet with Pocketbeagle over USB
Had some trouble with this today. This guide: https://elementztechblog.wordpress.com/2014/12/22/sharing-internet-using-network-over-usb-in-beaglebone-black/ does NOT work. These guides are also no good: https://unix.stackexchange.com/questions/520528/sharing-internet-using-network-over-usb-in-raspberry-zero-based-on-beaglebone These steps are partially covered in the official beagle directory here: /opt/scripts/network/doc-debian-setup.md
You don't need to setup a bridge. It might work that way, but its not required. What works is the following:
- (pocketbeagle) Add route w/host ip
- (host) enable packet forwarding
- (host) NAT forwarding
- (pocketbeagle) DNS - resolv.conf
On beagle
Have Pocketbeagle Route to Host
# route add default gw 192.168.6.1
Or 192.168.7.1, see # route
On Host
Enable packet forwarding on Host
Check the current packet forwarding settings:
# sysctl -a | grep forward
You will note that options exist for controlling forwarding per default, per interface, as well as separate options for IPv4/IPv6 per interface.
Enter this command to temporarily enable packet forwarding at runtime:
# sysctl net.ipv4.ip_forward=1
Edit /etc/sysctl.d/30-ipforward.conf to make the previous change persistent after a reboot for all interfaces:
/etc/sysctl.d/30-ipforward.conf
net.ipv4.ip_forward=1
Afterwards it is advisable to double-check forwarding is enabled as required after a reboot. Enable NAT on Host With iptables
# iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE # iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT # iptables -A FORWARD -i usb0 -o eth0 -j ACCEPT
Iface names can vary depending on distro. What's important is that you are trying to with iptables -A FORWARD -i usb0 -o eth0 -j ACCEPT, is forward input from the pocketbeagle NIC (in this case usb0, but it can be eth1 or en289929442 or something), to the main iface on the host. Here eth0. To recap:
eth0: whatever host main iface
usb0: whatever beagle usb gadget iface
ref: https://wiki.archlinux.org/index.php/Internet_Sharing
route on host: usually not required, but in case it is:
ip route add 192.168.7.0/24 dev eth0
todo: example with normal route cmd
Fix DNS on beagle
At this point, you will have ip routing (i.e. ping to lan from beagle by ip will work), but DNS isn't setup yet. To get DNS working put your preferred name server in /etc/resolv.conf
nameserver 192.168.1.1
Note: If you are testing an existing ping, when you change the iptables settings, you must stop / start a new ping to see the changes take effect. Note: It's nameserver ###.###.###.###, not just the #.
Question: Why isn't /etc/resolv.conf called /etc/nameserver ? How about a symbolic link? Is that too obvious?
IPv4 usb Interface Not Working
Had ipv4 not working for pocketbeagle today. Same image, same computer... Throw it out the window.
dhclient of usb interface on host gave only ipv6 address. ssh was able to connect via beagle's ipv6 address (ipv6%interface, e.g. ssh debian@fe80%usb1)
the two virtual usb ethernet interfaces that show up in host are always 192.168.7 or 192.168.6 range. Try one, if you can't ping the beagle at 192.168.6.2 (it's always 2) then try the 7 range. (on host)
ifconfig en238240224 192.168.6.1 ping 192.168.6.2
Sysvinit on pocketbeagle
(Via Devuan): Breaks ssh usb access. Only use if you have a wifi/ethernet adapter connected and ip info set in /etc/network/interfaces, or UART connected.
May have to edit inittab to add (correct) serial. See beagleboard section.
Alpine on pocketbeagle
This script doesn't compile on Debian (Devuan) Stretch (kernel phase. uboot compiles). GCC appears to be the wrong version. GCC 5 has been removed from Debian stretch repos. https://github.com/BrianSidebotham/alpine-on-bbb
See notes about alpine on beaglebone.
Change Partition Size on SD
https://elinux.org/Beagleboard:Expanding_File_System_Partition_On_A_microSD
Gamepup
First, see the official cape instructions (they are short): https://github.com/beagleboard/pocketbeagle/wiki/GamePup-cape
TTY | login screen on LCD
I migrated to devuan and added a tty to the inittab. The console can be rotated.
/sys/class/graphics/fbcon# echo 1 > rotate
See also: How_to_do_things_with_the_beaglebone
Buttons
Work out of the box by default.
Tips\Techniques
The Dual Identical (Twin) Pin Headers Will Trip You Up
I would argue this is bad design. Connectors should be keyed. You should not be able to mistake one for another. I've been bitten at least twice by thinking I was on P9 but was on P8. Anyways, just double check you have the right pins. As an occassional user, it's easy to mess this up.
At least the connector identifiers are written on the silk screen.
Power Consumption of Newer Beagles and RPIs
One benefit of the Beaglebone (and the older RPI3 as opposed to 4 and 5) is that they use less power than the newer devices. Some sources online are saying the BBB can run off of 5V 1A. I'm not sure about that (might be possible if there are no peripherals), but if there is some truth to that, then it somewhat evens the playing field for the newer devices. Sure, you can get a more powerful device, but it will require more power.
List of Applications for SBCs
Here are some things that I have considered or are working on with the beagleboards / beaglebones and ones that don't work.
Applications
- General data logging with sensors (easy with the OS. I.e. you can monitor temperature, or an accelerometer and then store in text files or a db, later displaying the data with graphs).
- Alarm system (This is a classic project for electronics, but it is good for something like an rpi or beagle as you can setup automated email alerts since you have ethernet). You can use one beagle and connect a number of alarms to the 0.1" headers. You could also use RF alarms potentially, with the SBC as a gateway.
- Radio monitoring (By connecting up one of the tv tuner usb adapters, you could interface to something like GNU Radio. I'm not sure what you might be looking for, but if you have access to different locations, you would get different results depending on where you are.).
- Software that any x86 computer can do, but with less power consumption. (I will omit any more software specific details, and try to focus on hardware applications of the SBCs. Most anything that runs on Linux will likely work here.).
What Doesn't Work As Well
- Any CPU intensive process that would be better off on an x86 server.
- Some x86 specific programs don't run on ARM (such as anything with code in x86 asm).
- X/Wayland dependent software or desktop environments that might be too slow for the limited resources of an SBC. (i.e. you are better off using these as headless or for console purposes. Though custom GUIs are not a bad idea, from what I've seen.).
See also
- MCP3021 - I2C example w/beaglebone.
- How_to_do_things_with_the_beaglebone - scratchpad
External Links
- https://github.com/mvduin/bbb-pin-utils/#show-pins Easily Display Information about pins.
- https://elinux.org/ - General Information
- https://elinux.org/Category:ECE497 - Various Tutorials on BBB
- https://github.com/MarkAYoder/BeagleBoard-exercises/tree/master - Code for the ECE497 tutorials.
- https://elinux.org/EBC_Exercise_10a_Analog_In
- https://elinux.org/EBC_Exercise_12a_2.4_TFT_LCD_display_via_SPI - Display Video. LCDs can be $20 on auction sites.
- http://blog.machinekit.io/p/hardware-capes.html - BBB and CNC
- https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#Flashing_eMMC - Convert any non flashing ISO to a flashing one.
- https://forum.beagleboard.org/t/debian-11-x-bullseye-monthly-snapshots/31280#update-u-boot-6 - Some changes from the early BBB images to the later are covered here.
- https://forum.beagleboard.org/t/replacing-cloud9-ide-with-vs-code-server-bb-code-server/32061 - Getting VSCode server to start (this has replaced the cloud9 bonescript server). However it seems to be missing the startup scripts for systemd.
- https://forum.beagleboard.org/t/bbb-using-vscode-server-with-debian-13-image/44016/2 - Further info on VSCode. Seems the beaglebone is not powerful enough for it.
- https://forum.beagleboard.org/t/bonescript-module-not-found-in-js/41115 - Installing bonescript on recent images (old images already have it). Note that the flash is 4GB and this install will require possibly more than that. Which means to install this, you may want to use an sd card (Technically you can get away with it, but you will be very close to 4GB on the debian 13 image from 7/23/26 and may need to uninstall other items).
- https://www.righto.com/2017/12/hands-on-with-pocketbeagle-tiny-25.html - Writeup on the PocketBeagle.
| ||||||||||||||||||
