RCN eewiki BBB page

From Crashcourse Wiki

Jump to: navigation, search

Contents

[edit] Overview

My take on this, in a slightly different order, and on a Fedora rawhide system, which is important to know as it breaks sfdisk in all sorts of annoying ways from what's described here. Stupid, stupid sfdisk.

[edit] Toolchain

Pretty much this, nothing to change. Environment variables:

  • CROSS_COMPILE=arm-linux-gnueabihf-
  • ARCH=arm

[edit] U-Boot

Based on this section, so:

  • Download source
  • Patch
  • Configure
  • Compile

Resulting useful output artifacts (at least on my system):

$ ls -l MLO u-boot.img
-rw-rw-r--. 1 rpjday rpjday  73556 Jan 25 03:28 MLO
-rw-rw-r--. 1 rpjday rpjday 393652 Jan 25 03:28 u-boot.img
$

so jump ahead to the eewiki page's SD card setup section, zero at least the first part of the SD card and copy those files to the raw SD card (assume /dev/sdc, adjust to taste):

$ sudo dd if=/dev/zero of=/dev/sdc bs=1M count=16
$ sudo dd if=MLO of=/dev/sdc count=1 seek=1 bs=128k
$ sudo dd if=u-boot.img of=/dev/sdc seek=1 bs=384k

Exercise for the student: Use hexdump to verify that the files have been copied to the right places before going any further. Seriously, verify things first.

[edit] Booting

You should now be able to boot to U-Boot from the SD card, and certainly not beyond that. Here's some sample output that proves it's your build that's booting:

U-Boot# 
U-Boot SPL 2015.01-dirty (Jan 25 2015 - 03:27:38)


U-Boot 2015.01-dirty (Jan 25 2015 - 03:27:38)

       Watchdog enabled
I2C:   ready
DRAM:  512 MiB
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
Using default environment

Net:   <ethaddr> not set. Validating first E-fuse MAC
cpsw
Hit any key to stop autoboot:  0 
gpio: pin 53 (gpio 53) value is 1
switch to partitions #0, OK
mmc0 is current device
gpio: pin 54 (gpio 54) value is 1
** No partition table - mmc 0 **
Checking for: /uEnv.txt ...
** No partition table - mmc 0 **
Checking for: /boot.scr ...
** No partition table - mmc 0 **
Checking for: /boot/boot.scr ...
** No partition table - mmc 0 **
Checking for: /boot/uEnv.txt ...
** No partition table - mmc 0 **
** No partition table - mmc 0 **
** No partition table - mmc 0 **
** No partition table - mmc 0 **
** No partition table - mmc 0 **
** No partition table - mmc 0 **
** No partition table - mmc 0 **
gpio: pin 56 (gpio 56) value is 0
gpio: pin 55 (gpio 55) value is 0
gpio: pin 54 (gpio 54) value is 0
switch to partitions #0, OK
mmc1(part 0) is current device
gpio: pin 54 (gpio 54) value is 1
Checking for: /uEnv.txt ...
reading uEnv.txt
26 bytes read in 4 ms (5.9 KiB/s)
gpio: pin 55 (gpio 55) value is 1
Loaded environment from uEnv.txt
Importing environment from mmc ...
Checking if uenvcmd is set ...
Checking if client_ip is set ...
Checking for: /boot.scr ...
Checking for: /boot/boot.scr ...
Checking for: /boot/uEnv.txt ...
gpio: pin 55 (gpio 55) value is 1
33 bytes read in 41 ms (0 Bytes/s)
Loaded environment from /boot/uEnv.txt
Checking if uname_r is set in /boot/uEnv.txt...
** Invalid partition 3 **
** Invalid partition 4 **
** Invalid partition 5 **
** Invalid partition 6 **
** Invalid partition 7 **
## Error: "nandboot" not defined
U-Boot# 

Exercise for the student: Compare the order in which U-Boot searches for startup files with what is listed here. Maybe U-Boot can be made a bit smarter and stop looking when it sees there is no partition.

[edit] Formatting the rest of the SD card

Using fdisk, format the SD card from 1M onward with an ext4 filesystem. Prove you did it properly by mounting it on your dev host. Maybe prove you can still boot the SD card, and that you didn't mess it up.

[edit] The kernel

Based on this, let's go with the following:

$ git clone https://github.com/RobertCNelson/bb-kernel.git
$ cd bb-kernel/
$ git checkout origin/am33x-v3.18 -b tmp

and build:

$ ./build_kernel.sh

More coming ...

Personal tools