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.

BOOTING FROM SD CARD

Hi

 

I m using DM355 board. I am able to boot successfully from flash but i want to boot it from sd card and when i change bootargs root to root=B301(drive partition) and the boot the kernel, there is an error that it cannot connect to the partition B301 and then it give the list of drives available for booting and then it shows kernel panic.

I am not able to make any progress.

Can anyone please help me out.

 

Thanks

  • Hi,

    Make sure that you pass root=/dev/mmcblk0pX from the bootargs where X is the partition number in which file system is residing.

    Regards, Sudhakar

  • Hi sudhakar

     

    I tried with root=/dev/mmcblk0p1(the partition) but still its not working.. Here's the bootargs and the output

     

    setenv bootargs console=ttyS0,115200n8 video=davincifb:osd1=0x0x8 mem=116M root=/dev/mmcblk0p1 ro rootdelay=2 rootfstype=ext3 mtdparts=davinci_nand.0:640k(UBOOT),128k(UBOOT_ENV),3840k(KERNEL))

     

     

    OUTPUT:

     

     

    [42949374.370000] davinci_nand davinci_nand.0: controller rev. 2.3
    [42949374.380000] Initializing USB Mass Storage driver...
    [42949374.390000] usbcore: registered new interface driver usb-storage
    [42949374.390000] USB Mass Storage support registered.
    [42949374.400000] i2c /dev entries driver
    [42949374.410000] watchdog watchdog: heartbeat 60 sec
    [42949374.420000] davinci_mmc davinci_mmc.0: Using DMA, 4-bit mode
    [42949374.430000] davinci_mmc davinci_mmc.1: Using DMA, 4-bit mode
    [42949374.440000] Advanced Linux Sound Architecture Driver Version 1.0.18a.
    [42949374.450000] No device for DAI tlv320aic3x
    [42949374.460000] No device for DAI davinci-i2s
    [42949374.470000] AIC3X Audio Codec 0.2
    [42949374.470000] asoc: tlv320aic3x <-> davinci-i2s mapping ok
    [42949374.500000] ALSA device list:
    [42949374.510000]   #0: Leopard Board (tlv320aic3x)
    [42949374.510000] TCP cubic registered
    [42949374.520000] NET: Registered protocol family 17
    [42949374.520000] RPC: Registered udp transport module.
    [42949374.530000] RPC: Registered tcp transport module.
    [42949374.540000] drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
    [42949374.540000] Waiting 2sec before mounting root device...
    [42949374.550000] mmc0: host does not support reading read-only switch. assuming write-enable.
    [42949374.560000] mmc0: new SDHC card at address e624
    [42949374.570000] mmcblk0: mmc0:e624 SD04G 3.69 GiB
    [42949374.570000]  mmcblk0: p1
    [42949376.560000] VFS: Cannot open root device "mmcblk0p1" or unknown-block(179,1)
    [42949376.560000] Please append a correct "root=" boot option; here are the available partitions:
    [42949376.570000] 1f00             640 mtdblock0 (driver?)
    [42949376.580000] 1f01             128 mtdblock1 (driver?)
    [42949376.580000] 1f02            3840 mtdblock2 (driver?)
    [42949376.590000] b300         3872256 mmcblk0 driver: mmcblk
    [42949376.600000]   b301         3868955 mmcblk0p1
    [42949376.600000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(179,1)

     

     

  • Hi,

    Can you report the behavior after configuring bootargs as root=/dev/mmcblk0p1 rw instead of ro?

    Regards, Sudhakar

  • Here's the output after changing ro to rw..

     

     

    [42949374.340000] Creating 3 MTD partitions on "davinci_nand.0":
    [42949374.340000] 0x000000000000-0x0000000a0000 : "UBOOT"
    [42949374.350000] 0x0000000a0000-0x0000000c0000 : "UBOOT_ENV"
    [42949374.360000] 0x0000000c0000-0x000000480000 : "KERNEL"
    [42949374.370000] davinci_nand davinci_nand.0: controller rev. 2.3
    [42949374.380000] Initializing USB Mass Storage driver...
    [42949374.390000] usbcore: registered new interface driver usb-storage
    [42949374.390000] USB Mass Storage support registered.
    [42949374.400000] i2c /dev entries driver
    [42949374.410000] watchdog watchdog: heartbeat 60 sec
    [42949374.420000] davinci_mmc davinci_mmc.0: Using DMA, 4-bit mode
    [42949374.430000] davinci_mmc davinci_mmc.1: Using DMA, 4-bit mode
    [42949374.440000] Advanced Linux Sound Architecture Driver Version 1.0.18a.
    [42949374.460000] No device for DAI tlv320aic3x
    [42949374.460000] No device for DAI davinci-i2s
    [42949374.470000] mmc0: host does not support reading read-only switch. assuming write-enable.
    [42949374.470000] mmc0: new SDHC card at address e624
    [42949374.480000] mmcblk0: mmc0:e624 SD04G 3.69 GiB
    [42949374.490000]  mmcblk0:<6>AIC3X Audio Codec 0.2
    [42949374.500000]  p1
    [42949374.510000] asoc: tlv320aic3x <-> davinci-i2s mapping ok
    [42949374.540000] ALSA device list:
    [42949374.540000]   #0: Leopard Board (tlv320aic3x)
    [42949374.550000] TCP cubic registered
    [42949374.550000] NET: Registered protocol family 17
    [42949374.560000] RPC: Registered udp transport module.
    [42949374.570000] RPC: Registered tcp transport module.
    [42949374.570000] drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
    [42949374.580000] Waiting 2sec before mounting root device...
    [42949376.600000] VFS: Cannot open root device "mmcblk0p1" or unknown-block(179,1)
    [42949376.600000] Please append a correct "root=" boot option; here are the available partitions:
    [42949376.610000] 1f00             640 mtdblock0 (driver?)
    [42949376.620000] 1f01             128 mtdblock1 (driver?)
    [42949376.620000] 1f02            3840 mtdblock2 (driver?)
    [42949376.630000] b300         3872256 mmcblk0 driver: mmcblk
    [42949376.640000]   b301         3868955 mmcblk0p1
    [42949376.640000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(179,1)

     

    Regards

    himanshu

  • himanshu meenia said:

     setenv bootargs console=ttyS0,115200n8 video=davincifb:osd1=0x0x8 mem=116M root=/dev/mmcblk0p1 ro rootdelay=2 rootfstype=ext3 mtdparts=davinci_nand.0:640k(UBOOT),128k(UBOOT_ENV),3840k(KERNEL))

    Instead of rootdelay=2 can you use 'rootwait' so yoy wait for whatever time is necessary?

    Also, are you able to detect the MMC/SD card and mount the partition if you boot-up by some other means and use mount command?

    Thanks,
    Sekhar

  • yes, when I boot via nand flash, I am able to see /dev/mmcblk0 but I am unable to mount it. when I try to run the mount command it gives some error about /etc/fstab

    rootwait didn't work either.

    One more question, to boot from sd card, what should be the boot mode of the board, normal nand boot mode or sd/mmc boot mode. When I try to reset the board in sd boot mode, the board just hangs.

     

    thanks in advance...

  • Hi ,

    what are you trying to achieve, boot from SD card or trying to mount file system from the SD card in NAND boot mode.
    if you are trying to boot from SD card yes the boot mode must be set if are using evm board sw7 must be set ,

    Pos 2  Pos 1

    OFF      ON    Boot from SD/MMC

    refer this doc for setting the switch.

    0535.EVMDM355_TechRef_RevD.pdf

    If u switched to boot mode to SD card mode you said " the board just hangs " ,  have you put the ubl and u-boot in the SD card ?

     


    best regards,

    Prabhakar Lad

  • Hi

    First of all, thanks for your reply. Yes, the board hangs in the sd mode. after changing the switches, when I press the reset button, nothing happens. It seems that what you are suggesting might be the problem. Can you tell me how to put ubl and u-boot in sd card. I have searched around the internet and followed this link :

    http://www.google.com/url?sa=t&source=web&cd=1&ved=0CBQQFjAA&url=http%3A%2F%2Fprocessors.wiki.ti.com%2Findex.php%2FSD_card_boot_and_flashing_tool_for_DM355_and_DM365&ei=cYM9ToTGEIqIrAfJxNkb&usg=AFQjCNEvimgxuJAbtYQa1-hHWsye0OVYtA&sig2=b8w8i4-1PjUBa6ByYBpFOQ

    Following this link makes two partitions on the sd card: one fat and the other linux partition. The fat one contains a dat file. But it didn't seem to work. sd boot mode still hangs. What is it I'm missing?

    --

    himanshu

  • Assuming you want to leave the ubl, u-boot, u-boot env and kernel in flash, a single partition SD card for file system should work. How are you creating the SD card? Usually you have to untar an rootfs archive onto the SD Card. You also have to untar as root.

  • So what you mean to say is to keep kernel, ubl etc. in flash and use sd card only for filesystem. How should we implements this? I used sd card boot and flashing utility(version 6) which automatically created two partitions. I followed this link: 

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

    Is that correct? Or there some other way to do this? Please clarify.

    After doing this, what should be boot options(boot mode and environ vars)?

     

    thanks

    --

    himanshu

     

     

  • The bootargs would be the same as what you have been doing with "root=/dev/mmcblk0p1". All other u-boot envs should the same as having everything in flash. Usual way is to untar a filesystem archive onto your SD Card. Something like:

    sudo tar -xvf rootfs.tar.gz -C path_your_sd_card

    where rootfs.tar.gz is the FS archive and path_your_sd_card is the path to your mounted and formated SD card. Be sure to format the SD Card as an "ext3" to match your bootarg "rootfstype=ext3". Can you find a copy of the rootfs that is currently in your flash?

    I am not familiar with the DM355. On my platform, it not possible to have UBL or U-Boot on SD. Only kernel and FS can be on SD Card. Your platform looks to be different.

  • hi himanshu,

    you can use a tool uflash to boot from SD Card .

    1> All you have to do is format your SD card completely with no partitions (you can use gparted for this).

    2> Leave a raw space  from beginning say about 10 MB for boot loader and ubl  and create a partition of type ext3 for the file system.

    3>Use uflash tool , to flash the ubl and boot loader to the SD card.

    find the uflash tool below 7701.uflash.txt
    rename it uflash.
    do $: ./uflash --help to get details.


    4> boot through SD card mode you will get the U-Boot.



    Best Regards
    Prabhakar Lad