This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PRU Labb 4 - won't boot off SD card

I'm going through the PRU "Hands-on Labs", and have a problem in Lab 4.

I've successfully done all the stages up to and including "Boot the new Kernel and FS on the Target".

I can see the boot sequence:

U-Boot SPL 2014.07-g7e537bf (Apr 10 2015 - 15:00:57)
reading args
spl_load_image_fat_os: error reading image args, err - -1
reading u-boot.img
reading u-boot.img


U-Boot 2014.07-g7e537bf (Apr 10 2015 - 15:00:57)

I2C:   ready
DRAM:  512 MiB
NAND:  0 MiB
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
reading uboot.env

** Unable to read "uboot.env" from mmc0:1 **
Using default environment

Net:   <ethaddr> not set. Validating first E-fuse MAC
cpsw, usb_ether
Hit any key to stop autoboot:  0
switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
reading uEnv.txt
** Unable to read file uEnv.txt **
** File not found /boot/zImage **
switch to partitions #0, OK
mmc1(part 0) is current device
SD/MMC found on device 1
reading uEnv.txt
** Unable to read file uEnv.txt **
** File not found /boot/zImage **
Booting from nand ...

no devices available

no devices available
Bad Linux ARM zImage magic!
U-Boot#

It appears my BeagleBone Balck won't load the OS built by the SDK .

Any suggestions?

  • Hi,

    Can you share the contents of your rootfs in the /rootfs/boot directory on the sd card?

    Can you share the printenv output in u-boot stage?

    Best Regards,
    Yordan
  • The /rootfs/boot directory on the SD card contains
    total 110956
    lrwxrwxrwx 1 root root 53 Oct 13 11:07 am335x-boneblack.dtb -> /media/damon/rootfs/boot/am335x-boneblack-prucape.dtb
    -rw-rw-r-- 1 root root 32622 Oct 13 10:21 am335x-boneblack-prucape.dtb
    lrwxrwxrwx 1 root root 33 Jul 7 07:00 am335x-bone.dtb -> devicetree-zImage-am335x-bone.dtb
    lrwxrwxrwx 1 root root 32 Jul 7 07:00 am335x-evm.dtb -> devicetree-zImage-am335x-evm.dtb
    lrwxrwxrwx 1 root root 34 Jul 7 07:00 am335x-evmsk.dtb -> devicetree-zImage-am335x-evmsk.dtb
    -rw-r--r-- 1 root root 32622 Oct 13 11:02 devicetree-zImage-am335x-boneblack.dtb
    -rw-r--r-- 1 root root 30625 Jul 7 06:04 devicetree-zImage-am335x-bone.dtb
    -rw-r--r-- 1 root root 39295 Jul 7 06:04 devicetree-zImage-am335x-evm.dtb
    -rw-r--r-- 1 root root 36445 Jul 7 06:04 devicetree-zImage-am335x-evmsk.dtb
    -rw-r--r-- 1 root root 104699941 Jul 7 06:03 vmlinux-3.14.43-g875c69b
    lrwxrwxrwx 1 root root 35 Oct 13 11:05 zImage -> /media/damon/rootfs/boot/zImage.pru
    -rw-r--r-- 1 root root 4304040 Oct 13 11:01 zImage-3.14.43-g875c69b
    -rwxrwxr-x 1 damon damon 4304040 Oct 13 10:10 zImage.pru

    printenv produces:
    arch=arm
    baudrate=115200
    board=am335x
    board_name=A335BNLT
    board_rev=00C0
    boot_fdt=try
    bootargs=console=ttyO0,115200n8 root=ubi0:rootfs rw ubi.mtd=NAND.file-system,201
    bootcmd=run findfdt; run mmcboot;setenv mmcdev 1; setenv bootpart 1:2; run mmcb;
    bootcount=2
    bootdelay=1
    bootdir=/boot
    bootenv=uEnv.txt
    bootfile=zImage
    bootm_size=0x10000000
    bootpart=1:2
    console=ttyO0,115200n8
    cpu=armv7
    dfu_alt_info_emmc=rawemmc raw 0 3751936;boot part 1 1;rootfs part 1 2;MLO fat 11
    dfu_alt_info_mmc=boot part 0 1;rootfs part 0 2;MLO fat 0 1;MLO.raw raw 0x100 0x1
    dfu_alt_info_nand=SPL part 0 1;SPL.backup1 part 0 2;SPL.backup2 part 0 3;SPL.ba9
    dfu_alt_info_ram=kernel ram 0x80200000 0xD80000;fdt ram 0x80F80000 0x80000;ramd0
    eth1addr=78:a5:04:f0:75:c6
    ethact=cpsw
    ethaddr=78:a5:04:f0:75:c4
    fdt_addr_r=0x88000000
    fdtaddr=0x88000000
    fdtfile=am335x-boneblack.dtb
    findfdt=if test $board_name = A335BONE; then setenv fdtfile am335x-bone.dtb; fi
    importbootenv=echo Importing environment from mmc ...; env import -t -r $loadade
    kernel_addr_r=0x82000000
    loadaddr=0x82000000
    loadbootenv=load mmc ${mmcdev} ${loadaddr} ${bootenv}
    loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}
    loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}
    loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz
    mmcargs=setenv bootargs console=${console} ${optargs} root=${mmcroot} rootfstyp}
    mmcboot=mmc dev ${mmcdev}; if mmc rescan; then echo SD/MMC found on device ${mm;
    mmcdev=1
    mmcloados=run mmcargs; if test ${boot_fdt} = yes || test ${boot_fdt} = try; the;
    mmcroot=/dev/mmcblk0p2 ro
    mmcrootfstype=ext4 rootwait
    mtdids=nand0=nand.0
    mtdparts=mtdparts=nand.0:128k(NAND.SPL),128k(NAND.SPL.backup1),128k(NAND.SPL.ba)
    nandargs=setenv bootargs console=${console} ${optargs} root=${nandroot} rootfst}
    nandboot=echo Booting from nand ...; run nandargs; nand read ${fdtaddr} NAND.u-}
    nandroot=ubi0:rootfs rw ubi.mtd=NAND.file-system,2048
    nandrootfstype=ubifs rootwait=1
    netargs=setenv bootargs console=${console} ${optargs} root=/dev/nfs nfsroot=${sp
    netboot=echo Booting from network ...; setenv autoload no; dhcp; tftp ${loadadd}
    nfsopts=nolock
    partitions=uuid_disk=${uuid_gpt_disk};name=rootfs,start=2MiB,size=-,uuid=${uuid}
    ramargs=setenv bootargs console=${console} ${optargs} root=${ramroot} rootfstyp}
    ramboot=echo Booting from ramdisk ...; run ramargs; bootz ${loadaddr} ${rdaddr}}
    ramdisk_addr_r=0x88080000
    ramroot=/dev/ram0 rw
    ramrootfstype=ext2
    rdaddr=0x88080000
    rootpath=/export/rootfs
    soc=am33xx
    spiargs=setenv bootargs console=${console} ${optargs} root=${spiroot} rootfstyp}
    spiboot=echo Booting from spi ...; run spiargs; sf probe ${spibusno}:0; sf read}
    spibusno=0
    spiimgsize=0x362000
    spiroot=/dev/mtdblock4 rw
    spirootfstype=jffs2
    spisrcaddr=0xe0000
    static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off
    stderr=serial
    stdin=serial
    stdout=serial
    usbnet_devaddr=78:a5:04:f0:75:c6
    vendor=ti
    ver=U-Boot 2014.07-gfb6ab76 (Jul 06 2015 - 16:00:22)

    Any suggestions gratefully accepted!

    Damon Kelly
  • Hi,

    I suspect that the zImage.pru image you're trying to boot is somehow damaged, or the .pru extension cannot be recognized.
    The first thing I recommend is change the ownership of the zImage.pru file:
    -rwxrwxr-x 1 damon damon 4304040 Oct 13 10:10 zImage.pru
    You can see that all images are owned by root:root & your custom image is damon:damon, change it to root:root & try again.

    Best Regards,
    Yordan
  • Hi Yordan,


    I tried a few things:

    • renamed zImage.pru to zImage-pru
    • changed its ownership to root:root

    lrwxrwxrwx 1 root root        53 Oct 14 15:28 am335x-boneblack.dtb -> /media/damon/rootfs/boot/am335x-boneblack-prucape.dtb

    -rw-rw-r-- 1 root root     32622 Oct 14 14:57 am335x-boneblack-prucape.dtb
    lrwxrwxrwx 1 root root        33 Jul  7 07:00 am335x-bone.dtb -> devicetree-zImage-am335x-bone.dtb
    lrwxrwxrwx 1 root root        32 Jul  7 07:00 am335x-evm.dtb -> devicetree-zImage-am335x-evm.dtb
    lrwxrwxrwx 1 root root        34 Jul  7 07:00 am335x-evmsk.dtb -> devicetree-zImage-am335x-evmsk.dtb
    -rw-r--r-- 1 root root     32286 Jul  7 06:04 devicetree-zImage-am335x-boneblack.dtb
    -rw-r--r-- 1 root root     30625 Jul  7 06:04 devicetree-zImage-am335x-bone.dtb
    -rw-r--r-- 1 root root     39295 Jul  7 06:04 devicetree-zImage-am335x-evm.dtb
    -rw-r--r-- 1 root root     36445 Jul  7 06:04 devicetree-zImage-am335x-evmsk.dtb
    -rw-rw-r-- 1 root root       762 Oct 14 15:43 uEnv.txt
    -rw-r--r-- 1 root root 104699941 Jul  7 06:03 vmlinux-3.14.43-g875c69b
    lrwxrwxrwx 1 root root        35 Oct 14 16:31 zImage -> /media/damon/rootfs/boot/zImage-pru
    -rw-r--r-- 1 root root   4337552 Jul  7 06:03 zImage-3.14.43-g875c69b
    -rw-r--r-- 1 root root   4304040 Oct 14 15:26 zImage-pru

    Didn't make any difference.

    Something I have noticed is that my re-flashing card, and the BBB itself only have a "rootfs" partition (plus a BEAGLEBONE partition with the web site).

    The TI SDK produces a "rootfs" and a "boot" partition.

    Damon Kelly

  • Hi,

    Damon Kelly10 said:
    Something I have noticed is that my re-flashing card, and the BBB itself only have a "rootfs" partition

    This is not right. The create-sdcard.sh script that comes with TI SDK should format your sd card, create two partitions (boot & rootfs) and copy the prebuilt images on them.  Try using that script & then just replace the kernel image in rootfs/boot/ directory with your custom zImage.pru binary.

    Best Regards, 

    Yordan

  • Hi,

    I wasn't clear.

    I downloaded the current image for the BeagleBone Black (Debian 7.8 2015-03-01) and created a bootable SD card. On examination, the SD card has 2 partitions:

    • BEAGLEBONE, which has the web site etc...
    • rootfs, which has the Debian images, boot folder etc...

    There is no "boot" partition.

    The BBB boots from this SD successfully.

    When I created a bootable SD using the SDK, there were 2 partitions:

    • "rootfs" containing the Linux image etc...
    • "boot" with MLO (?) and another u-boot file (sorry, I can't get to it right now)

    But the BBB doesn't boot successfully.

    Damon

  • OK, I've solved this:

    1. to make sure all the new files were owned by root, I used sudo nautilus to copy them.
    2. I used nautilus to create the links. If you look at the links, they point to /media/damon/rootfs/boot/..., which is incorrect.
    3. Instead, I used the command line to create the links from inside /media/damon/rootfs/boot/..., and they now are correct.
    4. I needed to hold down the Boot Switch button for longer, until the "Hit any key to stop autoboot"

    Everything works now!

    The /boot directory looks like:

    lrwxrwxrwx 1 root root        28 Oct 15 13:26 am335x-boneblack.dtb -> am335x-boneblack-prucape.dtb
    -rw-r--r-- 1 root root     32622 Oct 15 13:05 am335x-boneblack-prucape.dtb
    lrwxrwxrwx 1 root root        33 Jul  7 07:00 am335x-bone.dtb -> devicetree-zImage-am335x-bone.dtb
    lrwxrwxrwx 1 root root        32 Jul  7 07:00 am335x-evm.dtb -> devicetree-zImage-am335x-evm.dtb
    lrwxrwxrwx 1 root root        34 Jul  7 07:00 am335x-evmsk.dtb -> devicetree-zImage-am335x-evmsk.dtb
    -rw-r--r-- 1 root root     32286 Jul  7 06:04 devicetree-zImage-am335x-boneblack.dtb
    -rw-r--r-- 1 root root     30625 Jul  7 06:04 devicetree-zImage-am335x-bone.dtb
    -rw-r--r-- 1 root root     39295 Jul  7 06:04 devicetree-zImage-am335x-evm.dtb
    -rw-r--r-- 1 root root     36445 Jul  7 06:04 devicetree-zImage-am335x-evmsk.dtb
    -rw-r--r-- 1 root root 104699941 Jul  7 06:03 vmlinux-3.14.43-g875c69b
    lrwxrwxrwx 1 root root        10 Oct 15 13:24 zImage -> zImage.pru
    -rw-r--r-- 1 root root   4337552 Jul  7 06:03 zImage-3.14.43-g875c69b
    -rw-r--r-- 1 root root   4304040 Oct 15 12:26 zImage.pru

     

    Damon

     

  • Thanks for updating the thread.

    Best Regards,
    Yordan