beagleboneblack
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
beagleboneblack [2014/06/12 00:50] – cedric.eloy | beagleboneblack [2018/05/22 10:33] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Getting started with BeagleBoneBlack ====== | ||
+ | |||
+ | Interesting links: | ||
+ | |||
+ | * http:// | ||
+ | * http:// | ||
+ | * http:// | ||
+ | |||
+ | Toolchain from Linaro: arm-linux-gnueabihf-gcc (GCC 4.8.3) | ||
+ | |||
+ | ===== U-Boot ===== | ||
+ | |||
+ | |||
+ | The BeagleBoneBlack is fully supported in mainline U-Boot (currently tested with U-Boot 2014.04) | ||
+ | |||
+ | < | ||
+ | make O=bbb CROSS_COMPILE=arm-linux-gnueabihf am335x_boneblack_config | ||
+ | make O=bbb CROSS_COMPILE=arm-linux-gnueabihf | ||
+ | </ | ||
+ | |||
+ | * '' | ||
+ | * This will generate MLO and u-boot.img under '' | ||
+ | |||
+ | ===== Bootable microSD ===== | ||
+ | |||
+ | Make two partitions: | ||
+ | |||
+ | * boot partition: FAT16, starting at offset 1MB, for MLO, u-boot.img and kernel zImage | ||
+ | * linux partion: ext3 for rootfs | ||
+ | |||
+ | > :!: Before running below commands be sure of which device is your to-be-formatted microSD card. In this example we take ''/ | ||
+ | |||
+ | < | ||
+ | sudo sfdisk --in-order --Linux --unit M /dev/sdd << EOF | ||
+ | 1,48,0xE,* | ||
+ | ,,,- | ||
+ | EOF | ||
+ | </ | ||
+ | |||
+ | Format the first partition in FAT16 for boot | ||
+ | < | ||
+ | sudo mkfs.vfat -F 16 /dev/sdd1 -n boot | ||
+ | </ | ||
+ | |||
+ | Format the second in EXT3 for the root filesystem | ||
+ | < | ||
+ | sudo mkfs.ext3 /dev/sdd2 -L rootfs | ||
+ | </ | ||
+ | and untar the generated filesystem: | ||
+ | < | ||
+ | sudo tar -xvzf rootfs.tar.gz /mnt/rootfs | ||
+ | </ | ||
+ | |||
+ | or | ||
+ | |||
+ | write the complete second partition with the rootfs image produced by buildroot (no formatting is necessary in this case, but only a part of the remaining SD space will be available). | ||
+ | < | ||
+ | sudo dd -if=rootfs.ext2 -of=/ | ||
+ | </ | ||
+ | |||
+ | ===== Write to on-board eMMC ==== | ||
+ | |||
+ | eMMC is already partitionned in / | ||
+ | |||
+ | You need a running system to reprogram the on-board eMMC. | ||
+ | |||
+ | Create three partitions as follows (note the first bootable DOS partition) with fdisk | ||
+ | < | ||
+ | Device Boot Start | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | # fdisk / | ||
+ | |||
+ | The number of cylinders for this disk is set to 118016. | ||
+ | There is nothing wrong with that, but this is larger than 1024, | ||
+ | and could in certain setups cause problems with: | ||
+ | 1) software that runs at boot time (e.g., old versions of LILO) | ||
+ | 2) booting and partitioning software from other OSs | ||
+ | | ||
+ | |||
+ | Command (m for help): p | ||
+ | |||
+ | Disk / | ||
+ | 4 heads, 16 sectors/ | ||
+ | Units = cylinders of 64 * 512 = 32768 bytes | ||
+ | |||
+ | Device Boot Start | ||
+ | / | ||
+ | / | ||
+ | |||
+ | Command (m for help): d | ||
+ | Partition number (1-4): 1 | ||
+ | |||
+ | Command (m for help): d | ||
+ | Selected partition 2 | ||
+ | |||
+ | Command (m for help): n | ||
+ | Command action | ||
+ | | ||
+ | | ||
+ | p | ||
+ | Partition number (1-4): 1 | ||
+ | First cylinder (1-118016, default 1): 33 | ||
+ | Last cylinder or +size or +sizeM or +sizeK (33-118016, default 118016): 3104 | ||
+ | |||
+ | Command (m for help): a | ||
+ | Partition number (1-4): 1 | ||
+ | |||
+ | Command (m for help): t | ||
+ | Selected partition 1 | ||
+ | Hex code (type L to list codes): e | ||
+ | Changed system type of partition 1 to e (Win95 FAT16 (LBA)) | ||
+ | |||
+ | Command (m for help): p | ||
+ | |||
+ | Disk / | ||
+ | 4 heads, 16 sectors/ | ||
+ | Units = cylinders of 64 * 512 = 32768 bytes | ||
+ | |||
+ | Device Boot Start | ||
+ | / | ||
+ | |||
+ | Command (m for help): n | ||
+ | Command action | ||
+ | | ||
+ | | ||
+ | p | ||
+ | Partition number (1-4): 2 | ||
+ | First cylinder (1-118016, default 1): 3105 | ||
+ | Last cylinder or +size or +sizeM or +sizeK (3105-118016, | ||
+ | |||
+ | Command (m for help): p | ||
+ | |||
+ | Disk / | ||
+ | 4 heads, 16 sectors/ | ||
+ | Units = cylinders of 64 * 512 = 32768 bytes | ||
+ | |||
+ | Device Boot Start | ||
+ | / | ||
+ | / | ||
+ | |||
+ | Command (m for help): n | ||
+ | Command action | ||
+ | | ||
+ | | ||
+ | p | ||
+ | Partition number (1-4): 3 | ||
+ | First cylinder (1-118016, default 1): 18731 | ||
+ | Last cylinder or +size or +sizeM or +sizeK (18731-118016, | ||
+ | |||
+ | Command (m for help): p | ||
+ | |||
+ | Disk / | ||
+ | 4 heads, 16 sectors/ | ||
+ | Units = cylinders of 64 * 512 = 32768 bytes | ||
+ | |||
+ | Device Boot Start | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | |||
+ | Command (m for help): w | ||
+ | The partition table has been altered. | ||
+ | Calling ioctl() to re-read partition table | ||
+ | # | ||
+ | |||
+ | </ | ||
+ | |||
+ | Mount the partitions so that you can copy content to it: | ||
+ | |||
+ | < | ||
+ | mkdir -p / | ||
+ | mkdir -p / | ||
+ | mount -t vfat / | ||
+ | umount / | ||
+ | mkfs.vfat / | ||
+ | mkfs.ext2 / | ||
+ | mount -t vfat / | ||
+ | mount -t ext2 / | ||
+ | </ | ||
+ | |||
+ | Copy MLO, u-boot.img and uEnv.txt (in this order) to the partition. This can be done directly from your host via scp: | ||
+ | < | ||
+ | scp MLO root@192.168.1.4:/ | ||
+ | scp u-boot.img uEnv.txt | ||
+ | </ | ||
+ | |||
+ | Extract the rootfs image to the target and write it to the second partition | ||
+ | < | ||
+ | scp rootfs.tar | ||
+ | rm -rf / | ||
+ | tar xvf / | ||
+ | sync | ||
+ | </ | ||
+ | |||
+ | ===== Enable UARTs ==== | ||
+ | |||
+ | Be sure BB-BONELT-HDMI is not autoloaded. In uEnv.txt add: | ||
+ | < | ||
+ | optargs=quiet capemgr.disable_partno=BB-BONELT-HDMI, | ||
+ | </ | ||
+ | |||
+ | Load Device Tree overlays for UARTs | ||
+ | < | ||
+ | echo BB-UART1 > / | ||
+ | echo BB-UART4 > / | ||
+ | echo BB-UART5 > / | ||
+ | </ | ||
+ | |||
+ | Set the baudrate on the command line: | ||
+ | < | ||
+ | stty -F /dev/ttyO1 115200 | ||
+ | </ | ||
+ | |||
+ | ===== Remote debugging ===== | ||
+ | |||
+ | Run gdbserver on target: | ||
+ | < | ||
+ | # gdbserver :1234 helloworld | ||
+ | </ | ||
+ | |||
+ | Start the cross-gdb on host (with ddd as frontend): | ||
+ | < | ||
+ | ddd --debugger arm-linux-gnueabihf-gdb --eval-command=" | ||
+ | </ | ||
+ | |||
+ | ===== 3G modem ===== | ||
+ | |||
+ | Enable USB support in kernel: | ||
+ | < | ||
+ | Device Drivers --> USB Support --> < | ||
+ | Device Drivers --> USB Support --> < | ||
+ | Device Drivers --> USB Support --> < | ||
+ | </ | ||
+ | |||
+ | Enable PPP interface with usb_modeswitch (for Huawei E303) : | ||
+ | < | ||
+ | usb_modeswitch -v 0x12d1 -p 0x1f01 -V 0x12d1 -P 0x14dc -M " | ||
+ | </ | ||
+ | |||
beagleboneblack.txt · Last modified: 2018/05/22 10:33 by 127.0.0.1