Archlinux on pocketbeagle 2

I gave up on getting Slackware to work on the Pocketbeagle2 for now. It could be a network issue as I had with ArchLinux, I will get back to it at some time after I finish my work on ArchLinux

I am using the TechLab board for testing.

At first I was getting some ridiculous login errors and it would take a minute or so to login with the correct login and password. It was also stuck in 2023.

It worked fine after I connected an ethernet cable. I use a USB StarTech to ethernet adapter, a co-worker before I retired gave it to me, he said that it was no longer supported on windows. It works fine. I have a few other ones, not sure where I put them.

I have designed my own interface board for the first Pocketbeagle. There are a few pins different so I will need to double check to make sure there is no issue before I try it out.
Once I am convinced that it works fine I will publish the info.

My board has two CAN drivers and has several connectors. I plan to use a small LCD.
I am looking at making an adapter to use one of my Arduino LCD displays.

I did have a few issues, my own kernel doesn’t work. Neither did the u-boot.
I used the script for u-boot and copied the files as suggested, not sure what the problem is.
Is there details on how to create both and getting them to work?
I had to use the official debian SD card and replaced the rootfs.

Do you have a work in place writeup i can review?

The partition can be a simple dos/mbr… I use sfdisk with these settings:

sfdisk: [sfdisk from util-linux 2.40.4]
sfdisk: [--force --wipe-partitions always ]
sfdisk: [1M,256M,0xC,*]
sfdisk: [257M,2048M,0x82,-]
sfdisk: [2305M,,,-]

Fat partition: [mkfs.vfat -F 32 -n BOOT]
Rootfs partition: [mkfs.ext4 -O ^orphan_file -L rootfs]

in the past ordered mattered… so:

'./pocketbeagle2/tiboot3.bin' -> '/disk/tiboot3.bin'
'./pocketbeagle2/tispl.bin' -> '/disk/tispl.bin'
'./pocketbeagle2/u-boot.img' -> '/disk/u-boot.img'

Regards,

That is the way I usually do

looking for next available loop device

loop_device=$(losetup -f)
echo "using $loop_device"

If the files directory does not exist, it will be created

mkdir -p $board_files_dir
mkdir -p $board_files_dir/boot
mkdir -p $board_files_dir/rootfs

cd $board_files_dir

If the directories were already created and mounted unmount then

[[ $(findmnt -M boot) ]] && umount boot
[[ $(findmnt -M rootfs) ]] && umount rootfs

dd if=/dev/zero of=$boot_image iflag=fullblock bs=4M count=$COUNT
sync

losetup $loop_device $boot_image

Create the partitions for the image

parted -s $loop_device mklabel msdos
parted -s $loop_device mkpart primary fat32 1MiB 256MiB
parted -s $loop_device set 1 boot on
parted -s $loop_device mkpart primary linux-swap 256MiB 2256MiB
parted -s $loop_device mkpart primary ext4 2256MiB 100%

Rescan so the partitions will be visible

/sbin/partprobe $loop_device

Partition1="p1"
Partition2="p2"
Partition3="p3"
boot_part="$loop_device$Partition1"
swap_part="$loop_device$Partition2"
rootfs_part="$loop_device$Partition3"

Format the partitions

mkfs.vfat -F 32 -n "boot" -s 2 $boot_part
mkswap $swap_part
mkfs.ext4 -L rootfs -O ^metadata_csum,^64bit $rootfs_part

Here’s the important bits on a write up i’m working on:

Grab the Dockerfile.bootloader from: digikey-linux-sbc/BeagleBoard/PocketBeagle2 at main · eewiki/digikey-linux-sbc · GitHub

Then run:

docker build --output=input -f Dockerfile.bootloader .

This will give you:

input/tiboot3-am62x-hs-fs-evm.bin
input/tispl.bin
input/u-boot.img
#extlinux.conf
label Linux
    kernel /Image.gz
    fdtdir /
    append console=ttyS2,115200n8 earlycon=ns16550a,mmio32,0x02860000 root=/dev/mmcblk1p2 ro rootfstype=ext4 rootwait net.ifnames=0

sysconf.txt is our first user setup: src/sysconf.txt · main · BeagleBoard.org / bbbio-set-sysconf · GitLab

Which you can test with genimage

#genimage.cfg
image boot.vfat {
        vfat {
            files = {
                    "tispl.bin",
                    "u-boot.img",
                    "Image.gz",
                    "sysconf.txt",
            }

            file tiboot3.bin {
                    image = "tiboot3-am62x-hs-fs-evm.bin"
            }

            file ti/k3-am6232-pocketbeagle2.dtb {
                    image = "k3-am6232-pocketbeagle2.dtb"
            }

            file extlinux/extlinux.conf {
                    image = "extlinux.conf"
            }
        }

        size = 256M
}

image sdcard.img {
        hdimage {
        }

        partition u-boot {
                partition-type = 0xC
                bootable = "true"
                image = "boot.vfat"
        }

        partition rootfs {
                partition-type = 0x83
                image = "rootfs.ext4"
        }
}
genimage --rootpath `mktemp` --config genimage.cfg

Output:

NOTICE:  BL31: Built : 19:57:04, Apr  4 2025
I/TC: 
I/TC: OP-TEE version: 4.5.0 (gcc version 10.2.1 20210110 (Debian 10.2.1-6)) #1 Fri Apr  4 19:57:18 UTC 2025 aarch64
I/TC: WARNING: This OP-TEE configuration might be insecure!
I/TC: WARNING: Please check https://optee.readthedocs.io/en/latest/architecture/porting_guidelines.html
I/TC: Primary CPU initializing
I/TC: GIC redistributor base address not provided
I/TC: Assuming default GIC group status and modifier
I/TC: SYSFW ABI: 4.0 (firmware rev 0x000b '11.0.7--v11.00.07 (Fancy Rat)')
I/TC: HUK Initialized
I/TC: Primary CPU switching to normal world boot

U-Boot SPL 2025.04-rc5-g2a32e2bb55ba (Apr 04 2025 - 20:06:53 +0000)
SYSFW ABI: 4.0 (firmware rev 0x000b '11.0.7--v11.00.07 (Fancy Rat)')
SPL initial stack usage: 1968 bytes
Trying to boot from MMC2
Authentication passed
Authentication passed


U-Boot 2025.04-rc5-g2a32e2bb55ba (Apr 04 2025 - 20:06:53 +0000)

SoC:   AM62X SR1.0 HS-FS
Model: BeagleBoard.org PocketBeagle2
DRAM:  448 MiB (effective 512 MiB)
Core:  89 devices, 29 uclasses, devicetree: separate
MMC:   mmc@fa10000: 0, mmc@fa00000: 1
Loading Environment from nowhere... OK
In:    serial@2860000
Out:   serial@2860000
Err:   serial@2860000
Net:   No ethernet found.
Press SPACE to abort autoboot in 0 seconds
switch to partitions #0, OK
mmc1 is current device
SD/MMC found on device 1
Failed to load 'uEnv.txt'
Scanning for bootflows in all bootdevs
Seq  Method       State   Uclass    Part  Name                      Filename
---  -----------  ------  --------  ----  ------------------------  ----------------
Scanning bootdev 'mmc@fa00000.bootdev':
  0  extlinux     ready   mmc          1  mmc@fa00000.bootdev.part_ /extlinux/extlinux.conf
** Booting bootflow 'mmc@fa00000.bootdev.part_1' with extlinux
1:	Linux ${kernel_version}
Retrieving file: /Image.gz
append: console=ttyS2,115200n8 earlycon=ns16550a,mmio32,0x02860000 root=/dev/mmcblk1p2 ro rootfstype=ext4 rootwait net.ifnames=0
Retrieving file: /ti/k3-am6232-pocketbeagle2.dtb
## Flattened Device Tree blob at 88000000
   Booting using the fdt blob at 0x88000000
Working FDT set to 88000000
   Loading Device Tree to 000000008ffed000, end 000000008ffffea8 ... OK
Working FDT set to 8ffed000

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[    0.000000] Linux version 6.14.0-arm64-k3-r10.3 (voodoo@hestia) (aarch64-linux-gcc (GCC) 14.2.0, GNU ld (GNU Binutils) 2.42) #1 SMP PREEMPT_RT Fri Apr  4 15:29:41 CDT 2025
[    0.000000] KASLR disabled due to lack of seed
[    0.000000] Machine model: BeagleBoard.org PocketBeagle2

I modified your script so it will work on my mac. I don’t need to use docker or arm64 crosscompiler

Here part of my script. I tested it on Debian 12 which I installed using vmware fusion.
I assigned 6 cores for the VM, this would need to be ajusted to 2 or 4 if a mac isn’t used.

I will publish my script. It should work on any ARM64 boards that has debian 12 installed.

LC_ALL=C

set -x # echo on

work_directory=$(pwd)

echo “Clone: TI Linux Firmware”
git clone -b 11.00.08 GitHub - beagleboard/ti-linux-firmware --depth=1

echo “Clone: Trusted Firmware A”
git clone -b lts-v2.12 GitHub - TrustedFirmware-A/trusted-firmware-a: Read-only mirror for Trusted Firmware A --depth=1

echo “Clone: OP-TEE”
git clone -b 4.5.0 GitHub - OP-TEE/optee_os: Trusted side of the TEE --depth=1

echo “Clone: U-Boot”
git clone -b v2025.04-rc5-pocketbeagle2 GitHub - beagleboard/u-boot: mirror of https://git.beagleboard.org/beagleboard/u-boot --depth=1

echo “Build: Trusted Firmware A”
make -C ./trusted-firmware-a/ -j4 PLAT=k3 SPD=opteed TARGET_BOARD=lite K3_USART=0x6 all

echo “Build: OP-TEE”
make -C ./optee_os/ -j6 CROSS_COMPILE=arm-linux-gnueabihf- CROSS_COMPILE64=aarch64-linux-gnu- CFG_ARM64_core=y PLATFORM=k3-am62x CFG_WITH_SOFTWARE_PRNG=y CFG_CONSOLE_UART=0x6 all

echo “Build: U-Boot CORTEXR”
make -C ./u-boot/ O=…/CORTEXR CROSS_COMPILE=arm-linux-gnueabihf- am6232_pocketbeagle2_r5_defconfig
make -C ./u-boot/ -j6 O=…/CORTEXR CROSS_COMPILE=arm-linux-gnueabihf- BINMAN_INDIRS=$work_directory/ti-linux-firmware/

echo “Build: U-Boot CORTEXA”
make -C ./u-boot/ O=…/CORTEXA am6232_pocketbeagle2_a53_defconfig
make -C ./u-boot/ -j6 O=…/CORTEXA BL31=$work_directory/trusted-firmware-a/build/k3/lite/release/bl31.bin TEE=$work_directory/optee_os/out/arm-plat-k3/core/tee-pager_v2.bin BINMAN_INDIRS=$work_directory/ti-linux-firmware/

mkdir files
cp $work_directory/trusted-firmware-a/build/k3/lite/release/bl31.bin $work_directory/files
cp $work_directory/optee_os/out/arm-plat-k3/core/tee-pager_v2.bin $work_directory/files
cp $work_directory/CORTEXR/tiboot3-am62x-hs-fs-evm.bin $work_directory/files
cp $work_directory/CORTEXA/tispl.bin $work_directory/files
cp $work_directory/CORTEXA/u-boot.img $work_directory/files

I just used docker to give you a quick matching host/build script so you could check your work and see if it boots. :wink:

Regards

I got my kernel to work using my script to generate u-boot

I then used genimage to create the image.
Strangely enough I had to install mtools and dosfstools to get it to work.

Next task will be to get my CAN adapter working, adding device tree support and software support for one of my 1.8 inch LCD display.
I created the board years ago for the first pocketbeagle.

I have a new board in the works that supports a bigger LCD, one of my arduino LCD.

Here is a few pieces from boot to login

What am I supposed to put in uEnv.txt to make it happy?

Core: 89 devices, 29 uclasses, devicetree: separate
MMC: mmc@fa10000: 0, mmc@fa00000: 1
Loading Environment from nowhere… OK
In: serial@2860000
Out: serial@2860000
Err: serial@2860000
Net: No ethernet found.
Press SPACE to abort autoboot in 0 seconds
switch to partitions #0, OK
mmc1 is current device
SD/MMC found on device 1
Failed to load ‘uEnv.txt’
Scanning for bootflows in all bootdevs
Seq Method State Uclass Part Name Filename


Scanning bootdev ‘mmc@fa00000.bootdev’:
0 extlinux ready mmc 1 mmc@fa00000.bootdev.part_ /extlinux/extlinux.conf
** Booting bootflow ‘mmc@fa00000.bootdev.part_1’ with extlinux
1: Linux
Retrieving file: /Image.gz
append: console=ttyS2,115200n8 earlycon=ns16550a,mmio32,0x02860000 root=/dev/mmcblk1p2 ro rootfstype=ext4 rootwait net.ifnames=0
Retrieving file: /ti/k3-am6232-pocketbeagle2.dtb
Uncompressing Kernel Image to 0

Flattened Device Tree blob at 88000000

Booting using the fdt blob at 0x88000000
Working FDT set to 88000000
Loading Device Tree to 000000008ffec000, end 000000008ffff666 … OK
Working FDT set to 8ffec000

Starting kernel …

[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[ 0.000000] Linux version 6.12.13-catu (root@debian) (gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #3 SMP PREEMPT_RT Sat Apr 5 15:54:03 EDT 2025
[ 0.000000] KASLR disabled due to lack of seed
[ 0.000000] Machine model: BeagleBoard.org PocketBeagle2
[ 0.000000] earlycon: ns16550a0 at MMIO32 0x0000000002860000 (options ‘’)
[ 0.000000] printk: legacy bootconsole [ns16550a0] enabled
[ 0.000000] efi: UEFI not found.
[ 0.000000] OF: reserved mem: 0x000000009e800000…0x000000009fffffff (24576 KiB) nomap non-reusable optee@9e800000
[ 0.000000] OF: reserved mem: 0x0000000080000000…0x000000008007ffff (512 KiB) nomap non-reusable tfa@80000000
[ 0.000000] Reserved memory: created DMA memory pool at 0x000000009db00000, size 12 MiB
[ 0.000000] OF: reserved mem: initialized node r5f-dma-memory@9db00000, compatible id shared-dma-pool
[ 0.000000] OF: reserved mem: 0x000000009db00000…0x000000009e6fffff (12288 KiB) nomap non-reusable r5f-dma-memory@9db00000

[root@suzie ~]# dmesg
[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[ 0.000000] Linux version 6.12.13-catu (root@debian) (gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #3 SMP PREEMPT_RT Sat Apr 5 15:54:03 EDT 2025
[ 0.000000] KASLR disabled due to lack of seed
[ 0.000000] Machine model: BeagleBoard.org PocketBeagle2
[ 0.000000] earlycon: ns16550a0 at MMIO32 0x0000000002860000 (options ‘’)
[ 0.000000] printk: legacy bootconsole [ns16550a0] enabled
[ 0.000000] efi: UEFI not found.
[ 0.000000] OF: reserved mem: 0x000000009e800000…0x000000009fffffff (24576 KiB) nomap non-reusable optee@9e800000
[ 0.000000] OF: reserved mem: 0x0000000080000000…0x000000008007ffff (512 KiB) nomap non-reusable tfa@80000000
[ 0.000000] Reserved memory: created DMA memory pool at 0x000000009db00000, size 12 MiB
[ 0.000000] OF: reserved mem: initialized node r5f-dma-memory@9db00000, compatible id shared-dma-pool
[ 0.000000] OF: reserved mem: 0x000000009db00000…0x000000009e6fffff (12288 KiB) nomap non-reusable r5f-dma-memory@9d

[ 10.669142] remoteproc remoteproc0: 30074000.pru is available
[ 10.676329] remoteproc remoteproc1: 30078000.pru is available
[root@suzie ~]# date
Fri Apr 4 00:23:22 EDT 2025
[root@suzie ~]# uname -r
6.12.13-catu
[root@suzie ~]#

All work was done on my mac using vmware fusion which is free for the mac as long as it is for personal use.