U-Boot 2013 Boot from SATA

Discussion in 'General Discussion' started by tibmeister, Jan 3, 2014.

  1. Flint

    Flint New Member

    Joined:
    Dec 18, 2013
    Messages:
    21
    Likes Received:
    0
    I would like to be able to just use the Udoo as a computer. It would be nice to be able to dual boot and compare operating systems. Using the SD card is slow, so putting it on SATA is so much better. I am also experiencing other problems that need to be ironed out, so seeing it working on one operating system helps narrow the problem to software and keeps me from bothering you.
     
  2. peter247

    peter247 Member

    Joined:
    Mar 10, 2014
    Messages:
    263
    Likes Received:
    2
    Having Uboot stored on the sd card doesn`t alter the boot speed , or stop you from dual booting etc , or change anything , and stop you doing anything which you would be able to do if the uboot was stored on the sata drive , in fact it adds things which you would not be able to do if it was stored on the sata.
    HOW TO BOOTS , it reads the first few sectors stored on the sd card which take a few milliseconds and waits 5 seconds for you press a key just in case you have a serial connection , then starts using the sata drive to load the kernel and the rootfs .
    To me it`s easier to dual boot with a sd card on uboot , because how it boots is now controlled by the sd card and all the uboot environment variables are stored on the sd card .

    So if you have 2 sd cards , one can be made to boot from partition 1 and the other partition 2 , so with a simple swop of the sd card to can make to multi-boot .
     
  3. mkopack

    mkopack Member

    Joined:
    Jun 14, 2013
    Messages:
    451
    Likes Received:
    21
    Flint:

    This issue was discussed on the IRC channel several months ago (around December IIRC). As others have said, there's a certain kind of NAND that (again, going from memory here) uses SPI interface to store the Uboot data. the pads DO exist for that chip on the bottom of the udoo board, but I don't know if all the supporting circuitry is also there or not. A few folks were supposedly looking into it though. Not sure what ever happened with it though.

    Like Peter said though, there are ways around this - just get a couple cheap 2GB microSD's to do what he suggested... I believe you also have the ability to change the timeout from 5 seconds to something shorter in the uboot environment variables.
     
  4. maara

    maara Member

    Joined:
    Jun 11, 2013
    Messages:
    44
    Likes Received:
    4
    Hi,

    First, thanks a lot for this guide!!
    Second, I am having issues and can't get it working for some reason...
    I have attached a sata hdd and made a dd copy of the mmc partition to /dev/sda2 (so there is an ext3 partition holding all the data from the sdcard of the latest lubuntu on /dev/sda2 and I am expecting it to be on sata 0:1). It works fine when I boot from the sata using my old sdcard (which contains also the full fs). After that, I took an empty card and installed there the uboot. Following your guide, I have set up everything but can't boot from this minimal setup:

    Code:
    U-Boot 2013.10-rc3 (Jan 20 2014 - 13:33:34)
    
    CPU:   Freescale i.MX6Q rev1.2 at 792 MHz
    Reset cause: WDOG
    Board: UDOO
    DRAM:  1 GiB
    MMC:   FSL_SDHC: 0
    auto-detected panel HDMI
    Display: HDMI (1024x768)
    In:    serial
    Out:   serial
    Err:   serial
    Net:   using phy at 6
    FEC [PRIME]
    Hit any key to stop autoboot:  0
    AHCI 0001.0300 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
    flags: ncq stag pm led clo only pmp pio slum part
    SATA Device Info:
    S/N:             5VJ2GJM0
    Product model number: ST9500420ASG
    Firmware version: 0002SDM1
    Capacity: 976773168 sectors
    
    SATA device 0: Model: ST9500420ASG Firm: 0002SDM1 Ser#:             5VJ2GJM0
                Type: Hard Disk
                Supports 48-bit addressing
                Capacity: 476940.0 MB = 465.7 GB (976773168 x 512)
    ... is now current device
    Failed to mount ext2 filesystem...
    ** Unrecognized filesystem type **
    Booting from sata ...
    Wrong Image Format for bootm command
    ERROR: can't get kernel image!
    moreover, I am not able to even use ext2ls to list the fs...

    Code:
    UDOO board => ext2ls sata 0:0
    Failed to mount ext2 filesystem...
    ** Unrecognized filesystem type **
    UDOO board => ext2ls sata 0:1
    Failed to mount ext2 filesystem...
    ** Unrecognized filesystem type **
    UDOO board => ext2ls sata 0:2
    ** Invalid partition 2 **
    UDOO board => ext2ls sata 0:3
    ** Invalid partition 3 **
    thanks for help!
     
  5. LDighera

    LDighera UDOOer

    Joined:
    Jan 13, 2014
    Messages:
    206
    Likes Received:
    36
  6. peter247

    peter247 Member

    Joined:
    Mar 10, 2014
    Messages:
    263
    Likes Received:
    2
    You say to copied the mmc to sda2 , so you have set satapart=2 .. ?
     
  7. maara

    maara Member

    Joined:
    Jun 11, 2013
    Messages:
    44
    Likes Received:
    4
    Yes... I tried 0,1,2 but none of them works...

    Code:
    UDOO board => env print
    baudrate=115200
    boot_fdt=try
    bootargs=console=ttymxc1,115200 root=/dev/sda2 fbmem=24M video=mxcfb0:dev=hdmi,1920x1080M@60,bpp=32
    bootcmd=sata dev ${satadev}; run loaduimagesata; run sataboot;
    bootdelay=5
    bootscript=echo Running bootscript from mmc ...; source
    console=ttymxc1
    ethact=FEC
    ethaddr=00:c0:08:88:16:da
    ethprime=FEC
    fdt_addr=0x11000000
    fdt_file=imx6q-udoo.dtb
    fdt_high=0xffffffff
    initrd_high=0xffffffff
    ip_dyn=yes
    loadaddr=0x12000000
    loadbootscript=ext2load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};
    loadfdt=ext2load mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}
    loaduimage=ext2load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}
    loaduimagesata=ext2load sata ${satadev}:${satapart} ${loadaddr} ${uimage}
    mmcargs=setenv bootargs console=${console},${baudrate} root=${mmcroot} ${hdmi_patch} fbmem=24M video=mxcfb0:dev=hdmi,1920x1080M@60,bpp=32
    mmcboot=echo Booting from mmc ...; run mmcargs; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if run loadfdt; then bootm ${loadaddr} - ${fdt_addr}; else if test ${boot_fdt} = try; then bootm; else echo WARN: Cannot load the DT; fi; fi; else bootm; fi;
    mmcdev=0
    mmcpart=1
    mmcroot=/dev/sda2 rootwait rw
    netargs=setenv bootargs console=${console},${baudrate} root=/dev/nfs ${hdmi_patch} ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp
    netboot=echo Booting from net ...; run netargs; if test ${ip_dyn} = yes; then setenv get_cmd dhcp; else setenv get_cmd tftp; fi; ${get_cmd} ${uimage}; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if ${get_cmd} ${fdt_addr} ${fdt_file}; then bootm ${loadaddr} - ${fdt_addr}; else if test ${boot_fdt} = try; then bootm; else echo WARN: Cannot load the DT; fi; fi; else bootm; fi;
    sataargs=setenv bootargs console=${console},${baudrate} root=${sataroot} ${hdmi_patch} fbmem=24M video=mxcfb0:dev=hdmi,1920x1080M@60,bpp=32
    sataboot=echo Booting from sata ...; run sataargs ; bootm
    satadev=0
    satapart=2
    sataroot=/dev/sda2
    script=boot.scr
    splashpos=m,m
    uimage=/boot/uImage
    update_sd_firmware=if test ${ip_dyn} = yes; then setenv get_cmd dhcp; else setenv get_cmd tftp; fi; if mmc dev ${mmcdev}; then if ${get_cmd} ${update_sd_firmware_filename}; then setexpr fw_sz ${filesize} / 0x200; setexpr fw_sz ${fw_sz} + 1; mmc write ${loadaddr} 0x2 ${fw_sz}; fi; fi
    update_sd_firmware_filename=u-boot.imx
    
    Environment size: 2379/8188 bytes
    Results in:

    Code:
    U-Boot 2013.10-rc3 (Jan 20 2014 - 13:33:34)
    
    CPU:   Freescale i.MX6Q rev1.2 at 792 MHz
    Reset cause: WDOG
    Board: UDOO
    DRAM:  1 GiB
    MMC:   FSL_SDHC: 0
    No panel detected: default to LDB-WVGA
    Display: LDB-WVGA (800x480)
    In:    serial
    Out:   serial
    Err:   serial
    Net:   using phy at 6
    FEC [PRIME]
    Hit any key to stop autoboot:  0
    AHCI 0001.0300 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
    flags: ncq stag pm led clo only pmp pio slum part
    SATA Device Info:
    S/N:             5VJ2GJM0
    Product model number: ST9500420ASG
    Firmware version: 0002SDM1
    Capacity: 976773168 sectors
    
    SATA device 0: Model: ST9500420ASG Firm: 0002SDM1 Ser#:             5VJ2GJM0
                Type: Hard Disk
                Supports 48-bit addressing
                Capacity: 476940.0 MB = 465.7 GB (976773168 x 512)
    ... is now current device
    ** Invalid partition 2 **
    Booting from sata ...
    Wrong Image Format for bootm command
    ERROR: can't get kernel image!
     
  8. maara

    maara Member

    Joined:
    Jun 11, 2013
    Messages:
    44
    Likes Received:
    4
    anyone guys?
     
  9. LDighera

    LDighera UDOOer

    Joined:
    Jan 13, 2014
    Messages:
    206
    Likes Received:
    36
    Are you able to mount your SATA partition two after booting from MMC SD card?

    Have you run FSCK on partition two?
     
  10. maara

    maara Member

    Joined:
    Jun 11, 2013
    Messages:
    44
    Likes Received:
    4
    Hi and thanks for reply!
    The partition is ok and I found the problem. For some reason, the partition table was not mbr but gpt - the lubuntu itself can mount gpt without any issue so I was so confused because I was able to mount the partition from lubuntu but not from the uboot which needs it to be mbr.
    After converting it, it boots fine and I am good to go!

    thanks for help guys and remember - MBR :)
     
  11. jrk

    jrk New Member

    Joined:
    Jan 25, 2014
    Messages:
    30
    Likes Received:
    0
    This is simply driving me insane. I've tried several methods of "making" a Samsung EVO 120GB SSD my main drive to include copying files to a single ext3 and ext4 partition on the drive. I've followed the Uboot 2013 directions and everything looks good until I get the following error,

    Code:
    VFS: Cannot open root device "sda1" or unknown-block(0,0)
    [    3.229056] Please append a correct "root=" boot option; here are the available partitions:
    [    3.237473] b300        15558144 mmcblk0  driver: mmcblk
    [    3.242806]   b301        15550111 mmcblk0p1 00000000-0000-0000-0000-000000000000
    [    3.250314] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
    
    Here is the beginning of my boot process,

    Code:
    Hit any key to stop autoboot:  0
    AHCI 0001.0300 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
    flags: ncq stag pm led clo only pmp pio slum part
    SATA Device Info:
    
    Product model number: Samsung SSD 840 EVO 120GB
    Firmware version: EXT0BB6Q
    Capacity: 234441648 sectors
    
    SATA device 0: Model: Samsung SSD 840 EVO 120GB Firm: EXT0BB6Q Ser#: S1D5NSBDC50613P
                Type: Hard Disk
                Supports 48-bit addressing
                Capacity: 114473.4 MB = 111.7 GB (234441648 x 512)
    ... is now current device
    4788388 bytes read in 81 ms (56.4 MiB/s)
    Booting from sata ...
    ## Booting kernel from Legacy Image at 12000000 ...
       Image Name:   Linux-3.0.35
       Image Type:   ARM Linux Kernel Image (uncompressed)
       Data Size:    4788324 Bytes = 4.6 MiB
       Load Address: 10008000
       Entry Point:  10008000
       Verifying Checksum ... OK
       Loading Kernel Image ... OK
    I can flip back to the SD card and everything runs fine, but EVERY FREAKING TIME I switch to the SSD I get this stupid error. I've mounted the drive and see that everything looks fine. It's on sda partition 1. What am I missing?
     
  12. jrk

    jrk New Member

    Joined:
    Jan 25, 2014
    Messages:
    30
    Likes Received:
    0
    Yeah, the booting from sata and the fact that it found AND loads the kernel is what is throwing me off. It's like it forgets that the sata drive is mounted when it tries to mount it. I should add that I've successfully loaded and booted off of a 750GB spinning hard drive using the same set of procedures. It looks like it's something related to my SSD type.
     
  13. Davide Nicotra

    Davide Nicotra New Member

    Joined:
    Feb 19, 2016
    Messages:
    5
    Likes Received:
    3
    Andrea Rovai likes this.
  14. whitakeshriram

    whitakeshriram UDOOer

    Joined:
    Oct 2, 2020
    Messages:
    19
    Likes Received:
    0
    I have an Arduino sketch running which locked up the serial port on the Udoo
    So am I correct in that the setenv commands are typed in on the pc terminal?
     

Share This Page