U-Boot 2013 Boot from SATA

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

  1. tibmeister

    tibmeister New Member

    Joined:
    Oct 20, 2013
    Messages:
    19
    Likes Received:
    0
    Had some issues with the Wiki article on performing a boot from SATA with the new U-Boot code and variables. So, I got the commands working to boot from SATA with the new U-Boot running the Ubuntu 12.04 image. Note, this does not require the /boot directory to be on the MMC card, the only thing needed to be on the MMC card is the U-Boot code itself, otherwise the card can be blank. Here's the commands I ran after stopping autoboot, note the single quotes, these are very important for predictable results.

    setenv sataroot "/dev/sda1"
    setenv satadev 0
    setenv satapart 1
    setenv loaduimagesata 'ext2load sata ${satadev}:${satapart} ${loadaddr} ${uimage}'
    setenv sataargs 'setenv bootargs console=${console},${baudrate} root=${sataroot} ${hdmi_patch} fbmem=24M video=mxcfb0:dev=hdmi,1920x1080M@60,bpp=32'
    setenv sataboot 'echo Booting from sata ...; run sataargs ; bootm'
    setenv bootcmd 'sata dev ${satadev}; run loaduimagesata; run sataboot;'
    saveenv
    reset


    To switch back to the MMC card being the boot device, just change the bootcmd back to default like so:

    setenv bootcmd 'mmc dev ${mmcdev}; if mmc rescan; then if run loadbootscript; then run bootscript; else if run loaduimage; then run mmcboot; else run netboot; fi; fi; else run netboot; fi'
    saveenv
    reset


    Enjoy!!
     
  2. punk45rock

    punk45rock Member

    Joined:
    Dec 21, 2013
    Messages:
    32
    Likes Received:
    2
    Thanks for posting this here, I have been going nuts trying to boot from SATA. Gonna give this a go tomorrow.
     
  3. salouma

    salouma Member

    Joined:
    Jan 24, 2014
    Messages:
    49
    Likes Received:
    2
    I test your method and it worked fine !

    I would suggest adding to this tutorial the fact that you need to flash the Uboot on the SDcard and not only to mont your SD card and copy file.
    So you have to use this command first :

    Code:
    sudo dd if=u-boot-q.imx of=/dev/<MICROSD_DEVICE> bs=512 seek=2
    and then your code

    The wiki ( http://www.elinux.org/UDOO_boot_from_sata ) Is wrong and not working. Can someone update it ?
     
  4. DangerousThing

    DangerousThing New Member

    Joined:
    Jan 23, 2014
    Messages:
    21
    Likes Received:
    0
    ...

    Don't all the disk images have this already copied to the bottom of the microsd device?

    If I copied that code at the bottom of the SSD would it allow me to boot from SATA, or would that require a firmware release?

    I've never liked using a boot loader that doesn't exist in a partition, but rather in "free" space.
     
  5. LDighera

    LDighera UDOOer

    Joined:
    Jan 13, 2014
    Messages:
    203
    Likes Received:
    36
  6. moorsb

    moorsb New Member

    Joined:
    Feb 20, 2014
    Messages:
    36
    Likes Received:
    1
    I am new to Linux and a bit confused by all these different versions. I the example above to change the enviroment setting I am confused. I am using 12.04 LTS image and Bash shell does not know these commands. How do I change the shell or can I use BASH export command instead, but I do not see how to save the settings using export.
    Can I use gedit and just modify a file or does this have to be done via command line.
     
  7. peter247

    peter247 New Member

    Joined:
    Mar 10, 2014
    Messages:
    263
    Likes Received:
    2
    if you are saying can you do away with the SD card entirely it think that will be a never , because it is a hardware problem , there is no onboard nand flash so where does to store the uboot code to tell it to boot from sata entirely.
     
  8. moorsb

    moorsb New Member

    Joined:
    Feb 20, 2014
    Messages:
    36
    Likes Received:
    1
    How do you know U-Boot 2013 is working? Are you looking at the Udoo video or on the pc terminal?
    I think I found an issue. 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?
    Windows 7 does not have a terminal emulator built in so, I had to download one. Note J18 has to have its jumper or you will not get any data on pc terminal!!
     
  9. mkopack

    mkopack Member

    Joined:
    Jun 14, 2013
    Messages:
    451
    Likes Received:
    21
    No, I think you're confused. Most of those commands are ones you run in the Uboot console. You need to hook up another computer to the UDoo with a terminal program through one of the mini USB ports. Think of the Uboot as something like your PC's bios (although it runs on the SD card). It starts up first - you need to hit a key on the keyboard (of the host PC inside the terminal program) to stop the UBoot process, and then you'll have a prompt to run those commands...

    See here for help:

    http://www.udoo.org/ProjectsAndTutorial ... lioID=1394
     
  10. moorsb

    moorsb New Member

    Joined:
    Feb 20, 2014
    Messages:
    36
    Likes Received:
    1
    I now have Uboot going to my PC terminal. I have had a problem getting the commands entered correctly. So I save it once it accepts the line. I have had it not accept the command , because of a typo on my part. Is there away to get it to come back to the prompt?? Once I do get it all in there do I have to copy it to the sata drive? I put uboot on my hard drive at the start of this process, do I have to copy it again to get all of the setting there or does the system get all of the boot settings from the SD card?
     
  11. mkopack

    mkopack Member

    Joined:
    Jun 14, 2013
    Messages:
    451
    Likes Received:
    21
    Don't have to put it on the SATA drive... It basically will end up being arranged like this:

    microSD card - Has Uboot on it
    SATA drive - has everything else on it.

    The Udoo powers up, looks on the microSD for the uboot, starts booting. If you hit a key to stop the boot process (from a terminal connection) then you can enter commands to the Uboot.

    Now assuming you have everything set up properly, then the uboot will tell the system to continue the boot off the SATA drive, and that's where the kernel and root filesystem will be started off of.

    Follow?

    You don't need Uboot on the hard drive (it won't get used at all). All the boot settings come from the uboot on the SD card.
     
  12. moorsb

    moorsb New Member

    Joined:
    Feb 20, 2014
    Messages:
    36
    Likes Received:
    1
    Please take a look at my forum post under troubleshooting
    It look like the system is running, but I do not have any video
     
  13. moorsb

    moorsb New Member

    Joined:
    Feb 20, 2014
    Messages:
    36
    Likes Received:
    1
  14. Flint

    Flint New Member

    Joined:
    Dec 18, 2013
    Messages:
    21
    Likes Received:
    0
    I used printenv hdmi_patch to see what it was using, but it doesn't seem to have data there. Any idea what needs to be there?
     
  15. mkopack

    mkopack Member

    Joined:
    Jun 14, 2013
    Messages:
    451
    Likes Received:
    21
    It gets it ALL off the SD card... U boot ONLY runs from the SD card, once it starts Uboot and reads in the parameters from the SD, it sees that it needs to expect the kernel and filesystem to be on the SATA and then continues off the SATA from that point forward. (Assuming you set everything up right)
     
  16. Flint

    Flint New Member

    Joined:
    Dec 18, 2013
    Messages:
    21
    Likes Received:
    0
    you've got to fix that, quad should be able to run from the SATA alone.
     
  17. mkopack

    mkopack Member

    Joined:
    Jun 14, 2013
    Messages:
    451
    Likes Received:
    21
    It's a hardware issue. To do it would require an additional chip on the board to hold the U-boot data.

    Is it REALLY that big a deal though? You could get away with a very small microSD and then everything else is off the SATA.
     
  18. peter247

    peter247 New Member

    Joined:
    Mar 10, 2014
    Messages:
    263
    Likes Received:
    2
    THERE IS NO NAND FLASH INSTALLED ON THIS BOARD , IT`S DESIGNED TO USE THE SD CARD TO BOOT.

    You are asking "why doesn`t my diesel car run on petrol" and saying it`s a design fault which should be fixed .
    NO just get a petrol car , which in this case is dev board which has nand flash installed OR live with the limits of the board ,
     
  19. Flint

    Flint New Member

    Joined:
    Dec 18, 2013
    Messages:
    21
    Likes Received:
    0
    So, if I tap into and install some nand flash to hold the U-boot it would work.... we get rid of computers all the time, cant we salvage some from something old and fix this? Sure it would be a little trouble, but the maker community is not opposed to doing something like this.
     
  20. peter247

    peter247 New Member

    Joined:
    Mar 10, 2014
    Messages:
    263
    Likes Received:
    2
    I would say it`s possible , but not feasible !!!!

    Like I said before, you are completely changing the way it is designed to boot .
    what you are asking for is equal to adding more ram , easy in the design stages , but not so when the board is completed.
    I don`t think the maker community has the skills or the desire to completely redesign to board for nand flash .

    Flint Why is booting direct from sata so important ?

    There are many dev board out there like the Cubieboard which as nand flash and sata , but that only has dual core , but I`m sure you can just swop that out ( joke ).
    To me having the uboot on the sd card and the rootfs on the sata is not a bigee.

    The udoo would have been better if they had used a Atmel Mega and did not share pins , But I know the hardware specs before purchasing, and know it`s limits .
     

Share This Page