Beaglebone
The beaglebone is similar to the RPI, but more powerful for microcontroller applications. There are more accessible GPIO and peripherals.
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.
Beaglebone Black
Always Boot from SD Card
"...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
A latching switch would be nice. Onboard flash is built in obsolescence.
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
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 the alpine-uboot img 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 think I started making the partition in fdisk at an offset of 32768, as the alpine guide recommended it. I also zeroed out the old possibly conflicting regions where the u-boot from the beagleboard debian images may have been left over. 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).
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.
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.
Login to Console 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.
Beagleboard
The beagleboard is the original. It has more connectors / peripherals, 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
- Other OS: openwrt
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
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://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
| ||||||||||||||||||