Outils pour utilisateurs

Outils du site


francois:beaglebone_black

Ceci est une ancienne révision du document !


Développer avec la carte Beaglebone black

Le cross-compiler

wget -c https://releases.linaro.org/components/toolchain/binaries/6.3-2017.05/arm-linux-gnueabihf/gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf.tar.xz
tar xf gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf.tar.xz
export CC=`pwd`/gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-

Compiler U-Boot

git clone https://github.com/u-boot/u-boot
cd u-boot/
git checkout v2017.09 -b tmp

wget -c https://rcn-ee.com/repos/git/u-boot-patches/v2017.09/0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch
wget -c https://rcn-ee.com/repos/git/u-boot-patches/v2017.09/0002-U-Boot-BeagleBone-Cape-Manager.patch
  
patch -p1 < 0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch
patch -p1 < 0002-U-Boot-BeagleBone-Cape-Manager.patch

make ARCH=arm CROSS_COMPILE=${CC} distclean
make ARCH=arm CROSS_COMPILE=${CC} am335x_evm_defconfig
make ARCH=arm CROSS_COMPILE=${CC}

Flasher U-Boot sur une carte SD

export DISK=/dev/mmcblk0
sudo dd if=/dev/zero of=${DISK} bs=1M count=10

sudo dd if=./u-boot/MLO of=${DISK} count=1 seek=1 bs=128k
sudo dd if=./u-boot/u-boot.img of=${DISK} count=2 seek=1 bs=384k

Creation of the partition next to U-Boot

sudo sfdisk ${DISK} <<-__EOF__
4M,,L,*
__EOF__

For mkfs.ext4 >= 1.43

sudo mkfs.ext4 -L rootfs -O ^metadata_csum,^64bit ${DISK}p1

Compiler le noyau

git clone https://github.com/RobertCNelson/bb-kernel
cd bb-kernel/

git checkout origin/am33x-v4.9 -b tmp

./build_kernel.sh

export kernel_version=4.9.50-bone7

Replace the kernel version by the one returned by the build_kernel.sh script

Ecrire le rootfs

mkdir rootfs
sudo mount /dev/mmcblk0p1 rootfs

wget -c https://rcn-ee.com/rootfs/eewiki/minfs/debian-9.1-minimal-armhf-2017-08-08.tar.xz
tar xfvp debian-9.1-minimal-armhf-2017-08-08.tar.xz
sudo tar xfvp ./*-*-*-armhf-*/armhf-rootfs-*.tar -C rootfs/

sudo chown root.root rootfs
sudo chmod 755 rootfs/

sudo sh -c "echo 'uname_r=${kernel_version}' >> rootfs/boot/uEnv.txt"
sudo cp -v ./bb-kernel/deploy/${kernel_version}.zImage rootfs/boot/vmlinuz-${kernel_version}
sudo mkdir -p rootfs/boot/dtbs/${kernel_version}/
sudo tar xfv ./bb-kernel/deploy/${kernel_version}-dtbs.tar.gz -C rootfs/boot/dtbs/${kernel_version}/
sudo tar xfv ./bb-kernel/deploy/${kernel_version}-modules.tar.gz -C rootfs/

sudo sh -c "echo '/dev/mmcblk0p1  /  auto  errors=remount-ro  0  1' >> rootfs/etc/fstab"

Liens utiles

francois/beaglebone_black.1505656737.txt.gz · Dernière modification : (modification externe)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki