Debian:PocketBeagle 2 入门指南
这是关于 BeagleBoard 的 PocketBeagle 2 的页面;PocketBeagle 2 - BeagleBoard
购买渠道:
- 开发板:DigiKey 购买 PocketBeagle 2
- 串口线:DigiKey 购买树莓派串口探针
- 套件:DigiKey 购买 TechLab
基本要求:
-
在基于 x86 64 位的 PC 上运行最新支持版本的 Debian、Fedora 或 Ubuntu 系统,且不使用操作系统虚拟化软件。
-
列出的许多命令假定默认 shell 为 /bin/bash。
-
引导加载程序
-
Das U-Boot(通用引导加载程序)
-
Linux 内核
- Linus 的主线代码树:Making sure you're not a bot!
-
基于 arm64 的根文件系统(rootfs)
- Debian : https://www.debian.org
交叉编译器:32 位 arm-linux-gnueabi-gcc
这是一个预构建的(64 位)GCC 版本,可在通用 Linux 系统上运行。抱歉,32 位 x86 用户需要升级系统了……
下载 / 解压
#user@localhost:~$
wget -c https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/11.5.0/x86_64-gcc-11.5.0-nolibc-arm-linux-gnueabi.tar.xz
tar -xf x86_64-gcc-11.5.0-nolibc-arm-linux-gnueabi.tar.xz
export CC32=`pwd`/gcc-11.5.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-
测试交叉编译器
#user@localhost:~$
${CC32}gcc --version
#Test Output:
arm-linux-gnueabi-gcc (GCC) 11.5.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
交叉编译器:64 位 aarch64-linux-gcc 交叉编译器
- 这是一个预构建的(64 位)GCC 版本,可在通用 Linux 系统上运行。抱歉,32 位 x86 用户需要升级系统了……
下载 / 解压
#user@localhost:~$
wget -c https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/11.5.0/x86_64-gcc-11.5.0-nolibc-aarch64-linux.tar.xz
tar -xf x86_64-gcc-11.5.0-nolibc-aarch64-linux.tar.xz
export CC64=`pwd`/gcc-11.5.0-nolibc/aarch64-linux/bin/aarch64-linux-
测试交叉编译器
#user@localhost:~$
${CC64}gcc --version
#Test Output:
aarch64-linux-gcc (GCC) 11.5.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
交叉编译器
- 预先安装一些带有 build-essential 和 git 的主机软件包,这些软件包将用于构建其他所有内容。
预安装主机软件包
#user@localhost:~$
sudo apt update ; \
sudo apt-get install -y build-essential git
引导加载程序:TI Linux 固件
下载
#user@localhost:~$
git clone -b 11.00.13 https://github.com/beagleboard/ti-linux-firmware.git --depth=1
引导加载程序:Trusted Firmware A
- 适用于 A 架构 Arm CPU 的可信固件:TF-A/trusted-firmware-a.git - TrustedFirmware Git Browser
下载
#user@localhost:~$
git clone -b lts-v2.12.3 https://github.com/TrustedFirmware-A/trusted-firmware-a.git --depth=1
构建
#user@localhost:~$
make -C ./trusted-firmware-a/ -j4 CROSS_COMPILE=${CC64} PLAT=k3 ARCH=aarch64 SPD=opteed TARGET_BOARD=lite K3_USART=0x6 all
引导加载程序:OP-TEE
- 开放便携式可信执行环境(OP-TEE):GitHub - OP-TEE/optee_os: Trusted side of the TEE
主机软件包要求
#user@localhost:~$
sudo apt update ; \
sudo apt-get install -y python3-cryptography python3-minimal ; \
sudo apt-get install -y python3-pyelftools
下载
#user@localhost:~$
git clone -b 4.6.0 https://github.com/OP-TEE/optee_os.git --depth=1
构建
#user@localhost:~$
make -C ./optee_os/ -j4 CROSS_COMPILE=${CC32} CROSS_COMPILE64=${CC64} CFG_ARM64_core=y PLATFORM=k3-am62x CFG_WITH_SOFTWARE_PRNG=y CFG_CONSOLE_UART=0x6 all
引导加载程序:U-Boot
- Das U-Boot – 通用引导加载程序: The U-Boot Documentation — Das U-Boot unknown version documentation
主机软件包要求
#user@localhost:~$
sudo apt update ; \
sudo apt-get install -y bc bison flex libgnutls28-dev libssl-dev; \
sudo apt-get install -y python3-dev python3-jsonschema ; \
sudo apt-get install -y python3-setuptools python3-yaml ; \
sudo apt-get install -y swig uuid-dev yamllint
下载
#user@localhost:~$
git clone -b v2025.04-pocketbeagle2 https://github.com/beagleboard/u-boot.git --depth=1
配置与构建:Cortex-R4
#user@localhost:~$
make -C ./u-boot/ O=../CORTEXR CROSS_COMPILE=${CC32} am6232_pocketbeagle2_r5_defconfig ; \
make -C ./u-boot/ -j4 O=../CORTEXR CROSS_COMPILE=${CC32} BINMAN_INDIRS=../ti-linux-firmware/
复制构建产物:Cortex-R4
#user@localhost:~$
mkdir -p ./input/ ; \
cp -v ./CORTEXR/tiboot3-am62x-hs-fs-evm.bin ./input/
配置与构建:Cortex-A53
#user@localhost:~$
make -C ./u-boot/ O=../CORTEXA CROSS_COMPILE=${CC64} am6232_pocketbeagle2_a53_defconfig ; \
make -C ./u-boot/ -j4 O=../CORTEXA CROSS_COMPILE=${CC64} BL31=../trusted-firmware-a/build/k3/lite/release/bl31.bin TEE=../optee_os/out/arm-plat-k3/core/tee-pager_v2.bin BINMAN_INDIRS=../ti-linux-firmware/
复制构建产物:Cortex-A53
#user@localhost:~$
cp -v ./CORTEXA/tispl.bin ./input/ ; \
cp -v ./CORTEXA/u-boot.img ./input/
更多内容: