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.

Making a bootable SD card on the AM1808EVM

Other Parts Discussed in Thread: AM1808, OMAP-L138, OMAPL138

I am trying to make a bootable Linux SD for the AM1808EVM. I have the "How to Make 3 Partition SD Card" document and am following the instructions for a 2 partition card. The script to create a 2 partition card with "boot" and "rootfs" works fine. The script to untar the rootfs image  (sudo tar -xzvf ~/ti-sdk-am180x-evm-05.02.00.00/filesystem/tisdk-rootfs-am180x-evm.tar.gz) also appears to work.

I then copy the uImage-am180x-evm.bin from the psp/prebuilt-images directory to the boot partition on the SD, and rename it to just uImage. When I try to boot from this card I get the following error

Booting with TI UBL
Device OPP (456MHz, 1.3V)SD/MMC Boot failed.

Just looking at both the shipped SD and the one I create with a file browser I see no difference, but I am obviously missing something. Any advice is welcome.

TIA

  • Have you gotten through this, or is it still an open item?

  • No I have not, it is still an open item.

  • Your UBL (the first stage boot loader after the ROM boot loader) is not finding a u-boot image.  The page you referenced states this for AM18x platforms:

    "For the AM18x/AM181x EVM, the board always boots u-boot out of SPI flash.  Instructions for putting u-boot into SPI flash are here"

    Are you following those instructions?

    Regards, Daniel

  • I am currently running the stock AM1808EVM as we got it from TI. As far as I know u-boot was already on it,

     

    I have not tried a reload. I am following the instructions in http://processors.wiki.ti.com/index.php/How_to_Make_3_Partition_SD_Card using the 2 partition instructions.

     

    The SD card is fresh.

     

  • Dennis,

    When you renamed the u-boot file, did you omit the .bin?

    You should be renaming it from u-boot-am180x-evm.bin to u-boot.bin. Also do a $ chmod 777 u-boot.bin

    Keep me updated.

  • Does the u-boot need to also be copied to the boot partition on the SD along with uImage ?

    Or is there some sort of additional info that needs to be on the SD to let the UBL/u-boot in flash work properly?

    Thanks,

    Dennis

     

  • If you follow the link in the post I made previously, it shows this:

     

    Note: The UBL binary found in the prebuilts section of the SDK is will run the processor at 456MHz. If your part will not run at that speed please use the UBL binary that ships with the Serial OMAP Flash Tool. This UBL will expect to find U-boot at a pre-defined sector on the SD Card. Please see this article on how to write u-boot for a bootable SD Card on AM180x processors.

     

    The documentation seems to contradict itself with regards to where the u-boot should be.  I would try the above instructions and see where that gets you.

    Regards, Daniel

    PS - I have never actually booted from an SD card following any of these directions.  I will see if this documentation can be clarified.

  • Thanks, I actually did run across this document which added to my confusion. As you say they sort of contradict each other.

    Once I place u-boot on the SD using this approach should I still create the 2 partitions and untar the filesystem per the other document ?

    Also I am having trouble finding the directory containing the source for uflash, where in the main tree is it?

    Thanks,

    Dennis

     

  • Dennis,

    Thats correct. Your u-boot.bin, xloader (MLO), and kernel will all reside in the first partition. The second, your filesystem. You'll partition your SD card first, then do the copies/untarring.

  • The more I look at this, I don't think these two sets of instructions are in any way compatible (the history of the pages show they are written by two entirely different people, many months apart).  So I myself am wondering what procedures are being used to prepare bootable SD cards for when the board are shipped.

    Some more investigation is in order.

    Regards, Daniel

  • I would really appreciate that Daniel, I am somewhat confused at the moment.

  • Hi,

    I have never used the steps mentioned at http://processors.wiki.ti.com/index.php/How_to_Make_3_Partition_SD_Card#How_to_Make_2_Partition_SD_Card to prepare a bootable SD card. I assume these steps are followed by the DVSDK team but I am not sure why booting fails if the steps mentioned in the page are followed.

    I have used steps mentioned at http://processors.wiki.ti.com/index.php/GSG:_OMAP-L138_DVEVM_Additional_Procedures#Creating_bootable_SD_card_for_OMAP-L138_EVM_board successfully to get a bootable SD card. As mentioned in this link, we should create two partitions on SD card, first one starting at an offset of 20 cylinders. Leave around 3 MB of space for Linux Kernel image and then create the 2nd partition for file system. U-Boot image will be flashed to first few raw sectors (the first 20 cylinders) using the "uflash" command. UBL should still be flashed to SPI as AM1808 does not support strict SD boot mode.

    Regards, Sudhakar

  • I'm using the USB reader that comes with the 1808EVM. The SD I'm using has 2 partitons that I created earlier using procedures in the "How to make a 3 partion card" document. df -hT shows /dev/sdb1 and /dev/sdb2. If I run fdisk per the L138 DVEVM document mentioned it does not see those devices. Still trying to understand this.

     

    Thanks for the additional info.

    Followup: It looks like the fdisk that comes with Ubuntu does not have some of the arguments mentioned in the L138 DVEVM document. I also have found a "clean" SD but fdisk still does not see it. Here is the result of df -hT

    Filesystem    Type    Size  Used Avail Use% Mounted on
    /dev/sda1     ext4     19G   13G  5.8G  68% /
    none      devtmpfs    245M  324K  245M   1% /dev
    none         tmpfs    249M  252K  249M   1% /dev/shm
    none         tmpfs    249M  120K  249M   1% /var/run
    none         tmpfs    249M     0  249M   0% /var/lock
    none         tmpfs    249M     0  249M   0% /lib/init/rw
    none       debugfs     19G   13G  5.8G  68% /var/lib/ureadahead/debugfs
    /dev/sdb2     vfat    3.6G  2.3M  3.6G   1% /media/untitled

    Here is what I get from fdisk

    host$ fdisk -l /dev/sdb2
    Cannot open /dev/sdb2

    This is what my fdisk offers for options. This is installed from the CD that comes with the EVM.

    Usage:
     fdisk [options] <disk>    change partition table
     fdisk [options] -l <disk> list partition table(s)
     fdisk -s <partition>      give partition size(s) in blocks

    Options:
     -b <size>                 sector size (512, 1024, 2048 or 4096)
     -c                        switch off DOS-compatible mode
     -h                        print help
     -u <size>                 give sizes in sectors instead of cylinders
     -v                        print version
     -C <number>               specify the number of cylinders
     -H <number>               specify the number of heads
     -S <number>               specify the number of sectors per track

     

  • Dennis,

    Is Ubunutu your native OS, or are you virtualizing it? If you're using VMware/VirtualBox, you'll need to "soft" connect the USB reader to your virtual-machine before the card is readable by Ubuntu.

    It looks like /sdb1 & sdb2 is your card, being the respective partitions you created. "df -hT" will display the amount of available free space on all system disks. "fdisk -l" will list the partition tables for all devices. So this is just a way to determine the correct drive letter the system has assigned to your disk (card).

  • Hi Michael,

    I am virtualizing with VMware player, will have to figure out how to do what you describe.

     

    Thanks,

    Dennis

  • Ah, I did not see your post before my last. /sdb is not your card. Also, you can use fdisk like this: sudo fdisk -l

    To connect your card reader to VM:

    • Boot your VM with the USB card reader unplugged.
    • Once booted, locate the system icons at the bottom of the VM window near the logo "vmware"
    • Plug in the card reader & notice a new icon appear (looks like a external HD, says something like "micro mass storage")
    • Right click this icon & choose Connect

    Now when you run fdisk -l again, you should see an additional drive in your list. Probably /sdc

  • OK got there, fdisk -l returns

    Disk /dev/sda: 21.5 GB, 21474836480 bytes
    255 heads, 63 sectors/track, 2610 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00013cb4

       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *           1        2497    20051968   83  Linux
    /dev/sda2            2497        2611      916481    5  Extended
    /dev/sda5            2497        2611      916480   82  Linux swap / Solaris

    Disk /dev/sdb: 3965 MB, 3965190144 bytes
    122 heads, 62 sectors/track, 1023 cylinders
    Units = cylinders of 7564 * 512 = 3872768 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00000000

       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1               1          26       98303    0  Empty
    Partition 1 has different physical/logical beginnings (non-Linux?):
         phys=(0, 0, 2) logical=(0, 0, 3)
    Partition 1 has different physical/logical endings:
         phys=(25, 65, 8) logical=(25, 121, 6)
    Partition 1 does not end on cylinder boundary.
    /dev/sdb2   *          26        1024     3772928    b  W95 FAT32
    Partition 2 has different physical/logical beginnings (non-Linux?):
         phys=(25, 65, 9) logical=(25, 121, 7)
    Partition 2 has different physical/logical endings:
         phys=(997, 143, 24) logical=(1023, 72, 28)
    Partition 2 does not end on cylinder boundary.
    /dev/sdb3            1024        1024        1024   10  OPUS
    Partition 3 has different physical/logical beginnings (non-Linux?):
         phys=(997, 143, 24) logical=(1023, 72, 29)
    Partition 3 has different physical/logical endings:
         phys=(998, 0, 1) logical=(1023, 105, 30)
    Partition 3 does not end on cylinder boundary.

    I still have the problem that my fdisk does not appear to have some of the arguments mentioned in the L138 DVEVM document (i.e. forcing a partition to start on a specific cylinder) and it still does not like /dev/sdb2 (USB card?). I'm not sure what fdisk was used in that particular document. It would be good to find out exactly how the Linux SD that ships with the 1808EVM was actually created.

    Thanks,

    Dennis

  • Denis,

    /dev/sda is your primary Hard Drive. You definitely do not want to touch that one.

    After connecting & inserting your SD card to the USB reader, a new /dev/sdX will appear in the fdisk -l list.

    You will then copy the script under How to Make 2 Partition SD Card into a file named mk2PartSDCard.sh. Make the file an executable: chmod +x mk2PartSDCard.sh

    You will then run this script on the particular, corresponding device X to format the card. DO NOT run it on /dev/sda !! . There are several warnings within that wiki describing the importance of getting the device X correctly.

    After the format is successful, you can move on to the "Copy Bootloaders, Linux Kernel and File System to SD card " section. At this point, you will see 2 partitions on your X device under fdisk -l.

  • Hi Michael,

    This is what I did originally and got the 2 partions created, rootfs, and boot created. I extracted the FS fine and copied the kernel over to the boot partition. This SD will not boot. That is what started this particular thread. There seems to be a conflict between the two documents describing how to make a bootable SD. If you look back upstream on this thread there has been discussion about what the correct procedure really is. I think it may be a combination of both documents.

     

    Thanks,

    Dennis

     

  • This is an update as of this morning referencing these documents

     

    http://processors.wiki.ti.com/index.php/How_to_Make_3_Partition_SD_Card

    http://processors.wiki.ti.com/index.php/GSG:_OMAP-L138_DVEVM_Additional_Procedures#Creating_bootable_SD_card_for_OMAP-L138_EVM_board

     

    I created the 2 partition SD per the 1st and extracted the fileystem to /media/rootfs. I then copied the prebuilt kernel to /media/boot. This does not make a bootable SD.

    I then ran uflash per the 2nd document. I do not have an fdisk with the features described in the 2nd document so I simply ran uflash. At this point the UBL seems to find u-boot but u-boot can't find the kernel. Below is what I see.

    Booting with TI UBL
    Device OPP (456MHz, 1.3V)

    U-Boot 2010.12 (Jul 05 2011 - 17:59:36)

    I2C:   ready
    DRAM:  128 MiB
    MMC:   davinci: 0
    SF: Detected M25P64 with page size 256, total 8 MiB
    *** Warning - bad CRC, using default environment

    In:    serial
    Out:   serial
    Err:   serial
    ARM Clock : 456000000 Hz
    DDR Clock : 132000000 Hz
    SF: Detected M25P64 with page size 256, total 8 MiB
    Net:   Ethernet PHY: GENERIC @ 0x00
    DaVinci-EMAC
    Hit any key to stop autoboot:  0
    reading boot.scr

    ** Unable to read "boot.scr" from mmc 0:1 **
    reading uImage
    Invalid FAT entry

    1440768 bytes read
    ## Booting kernel from Legacy Image at c0700000 ...
       Image Name:   Arago/2.6.37-psp03.21.00.04.sdk/
       Image Type:   ARM Linux Kernel Image (uncompressed)
       Data Size:    2317192 Bytes = 2.2 MiB
       Load Address: c0008000
       Entry Point:  c0008000
       Verifying Checksum ... Bad Data CRC
    ERROR: can't get kernel image!
    U-Boot >

     

    Thanks,

    Dennis

     

  • Hi,

    Have you run mkfs.vfat on the /media/boot partition?

    - Sudhakar

  • Hi,

    Have you run mkfs.vfat on the /media/boot partition before copying uImage?

    - Sudhakar

  • I run mkfs.vfat, then extract the filesystem, then copy uImage to the boot partition. At that point I run uflash to place u-boot on the SD.

    Doing it in this order gets me this far into the boot:

    Booting with TI UBL
    Device OPP (456MHz, 1.3V)

    U-Boot 2010.12 (Jul 05 2011 - 17:59:36)

    I2C:   ready
    DRAM:  128 MiB
    MMC:   davinci: 0
    SF: Detected M25P64 with page size 256, total 8 MiB
    *** Warning - bad CRC, using default environment

    In:    serial
    Out:   serial
    Err:   serial
    ARM Clock : 456000000 Hz
    DDR Clock : 132000000 Hz
    SF: Detected M25P64 with page size 256, total 8 MiB
    Net:   Ethernet PHY: GENERIC @ 0x00
    DaVinci-EMAC
    Hit any key to stop autoboot:  0
    reading boot.scr

    ** Unable to read "boot.scr" from mmc 0:1 **
    reading uImage
    Invalid FAT entry

    1440768 bytes read
    ## Booting kernel from Legacy Image at c0700000 ...
       Image Name:   Arago/2.6.37-psp03.21.00.04.sdk/
       Image Type:   ARM Linux Kernel Image (uncompressed)
       Data Size:    2317192 Bytes = 2.2 MiB
       Load Address: c0008000
       Entry Point:  c0008000
       Verifying Checksum ... Bad Data CRC
    ERROR: can't get kernel image!
    U-Boot >

     

    Update: I noticed that using the uflash utility per the instructions creates a different load address than what the shipping version uses. Knowing how the shipping disk is made would be useful info.

    Shipping version load address...

    Booting with TI UBL
    Device OPP (456MHz, 1.3V)

    U-Boot 2009.11 (Apr 15 2011 - 13:22:24)

    I2C:   ready
    DRAM:  64 MB
    MMC:   davinci: 0
    *** Warning - bad CRC, using default environment

    In:    serial
    Out:   serial
    Err:   serial
    ARM Clock : 456000000 Hz
    DDR Clock : 132000000 Hz
    Net:   Ethernet PHY: GENERIC @ 0x00

    Hit any key to stop autoboot:  0
    reading boot.scr
    Invalid FAT entry

    ** Unable to read "boot.scr" from mmc 0:1 **
    reading uImage

    2187544 bytes read
    ## Booting kernel from Legacy Image at c0700000 ...
       Image Name:   Arago/2.6.32+2.6.33-rc4-psp03.20
       Image Type:   ARM Linux Kernel Image (uncompressed)
       Data Size:    2187480 Bytes =  2.1 MB
       Load Address: c0008000
       Entry Point:  c0008000
       Verifying Checksum ... OK
       Loading Kernel Image ... OK
    OK

    Starting kernel ...

    This is what I see from uflash, it looks like it uses a different load address

    dennisg@ubuntu: sudo ./uflash -d /dev/sdb -b u-boot.bin -p OMAPL138 -vv
     
    OMAPL138
    U-Boot Size 191903
    First partition starts at 63(32256)
    U-Boot Magic Number        : a1aced66
    U-Boot Entry Point         : c1080000
    U-Boot Number of Blocks    : 00000177
    U-Boot Starting Block      : 00000075
    Load U-Boot Address        : c1080000
    Writing U-Boot Signature
    Writing U-Boot
    Done...

  • I did finally figure out how to get this going. None of the referenced documents were completely correct, but small parts of each combined were. What I ended up doing was:

     

    Modify the mk2PartSDCard script to start at Cyl 1 and create the partitions.

    Use uflash to place u-boot on the SD card.

    Copy the kernel to the boot partition.

    Extract the file system to rootfs.

     

     

     

  • Dennis,

    It would be great if you could share your modified script.

    Regards, Daniel

  • It is pasted below...

    -------------------------------------------------------------------------

    #! /bin/sh
    # mk2PartSDCard.sh v0.1
    # Licensed under terms of GPLv2

    DRIVE=$1

    dd if=/dev/zero of=$DRIVE bs=1024 count=1024

    SIZE='fdisk -l $DRIVE | grep Disk | awk '{print $5}''

    echo DISK SIZE - $SIZE bytes

    CYLINDERS='echo $SIZE/255/63/512 | bc'

    sfdisk -D -H 255 -S 63 -C $CYLINDERS $DRIVE << EOF
    1,9,0x0C,*
    10,,,,
    EOF

    mkfs.vfat -F 32 -n "boot" ${DRIVE}1
    umount ${DRIVE}1
    mkfs.ext3 -L "rootfs" ${DRIVE}2