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.

dm368 file system booting problem

Hi 

I am flashing the UBL and u-boot to DM 368 through JTAG and i am able to boot the kernel using tftp boot but once i give the file system through tftp and try to boot the board the board does not get booted at all.

Following are the args that i gave in the u-boot console

 

:>tftp 0x80700000 uImage_dm368
:>erase 0x02080000 0x0231FFFF
 :>cp.b 0x80700000 0x02080000 0x226ac0
Copy to Flash... .0done
 :>setenv bootcmd 'cp.b 0x02080000 0x80700000 0x226ac0;bootm'
 :>saveenv

And then when i load the file system using the following commands

 :>tftp 0x83000000 ppc_AV_stack_PreAlpha_1.03-C0-0.09.image
 :>erase 0x02320000 0x02FFFFFF


 :>cp.b 0x83000000 0x02320000 0xa16000
Copy to Flash... .0done
 :>saveenv

:>boot

It tells that 

Wrong Image Format for bootm command
ERROR: can't get kernel image!

And when i switch off  the board and switch it on the board does not boot at all.

Then again i have to flash UBL and u-boot through JTAG and then the board gets booted.Is it that the flash is getting corrupted after i copy the file system since after the file system is loaded the UBL also does not come up or is there any problem with the bootm command that i am giving.I also verified that with these same commands DM365 gets booted properly till the file system.Is there any change in the address of the flash for DM368 and DM365 so that the flash is getting corrupted.

Regards

Haran

  • Hi Haran,

    Post the complete log of all the steps that you are doing 

  • Dear Renjith:

    This is in reply to your query for complete log of steps that are followed for loading kernel and file system on DM368 through TFTP.

    [1] Load Procedure for kernel throughTFTP

    SHELL PROMPT :>tftp 0x80700000 uImage_dm368
    TFTP from server 10.60.2.81; our IP address is 10.60.2.221
    Filename 'uImage_dm368'.
    Load address: 0x80700000
    Loading: #################################################################
             ####################################################
    done
    Bytes transferred = 1709312 (1a1500 hex)
    SHELL PROMPT :>erase 0x02080000 0x0231FFFF

    ..................... done
    Erased 21 sectors
    SHELL PROMPT :>cp.l 0x80700000 0x02080000 0x68541
    Copy to Flash... .0done

    SHELL PROMPT :>setenv bootcmd 'cp.l 0x02080000 0x80700000 0x68541;bootm'
    SHELL PROMPT :>saveenv
    Saving Environment to Flash...
    . done
    Un-Protected 1 sectors
    Erasing Flash...
    . done
    Erased 1 sectors
    Writing to Flash... .0done
    . done
    Protected 1 sectors

    [2] Load procedure for fie system along with application

    SHELL PROMPT :>tftp 0x83000000 application.image
    TFTP from server 10.60.2.81; our IP address is 10.60.2.221
    Filename 'application.image'.
    Load address: 0x83000000
    Loading: #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             ######
    done
    Bytes transferred = 10575872 (a16000 hex)
    SHELL PROMPT :>erase 0x02320000 0x02FFFFFF

    ....................................................................................................... done
    Erased 103 sectors
    SHELL PROMPT :>cp.b 0x83000000 0x02320000 0xa16000
    Copy to Flash... .Flash not Erased
    SHELL PROMPT :>

    Observations:

    • Once the file system loading gets failed , we when we restart board,  we are not able to get ubl, uboot not running. nothing comes on the serial console.
    • If we just load the kernel and does not load the file system , kernel comes up properly , except that it could not find the file system.

    Can any one tell us what could have gone wrong and how to fix this.

    Best Regards,

    Kiran.

  • Kiran,

    I assume that you are using NOR flash for this. What is the size of the NOR flash? If possible can you share the part number that you are using? Can you share the bootlogs of kernel and the boot args. Which is the filesystem that you are using for the image?

  • Dear Renjith,

    Thanks for your instant response. Below are my answers for your queries.

    [1] I assume that you are using NOR flash for this. What is the size of the NOR flash?

    [Kiran] Yes , we are using NOR flash of 16MB size

    [2] Which is the filesystem that you are using for the image?

    [Kiran] We are using CRAMFS file system

    [3] Can you share the bootlogs of kernel and the boot args.

    [Kiran]

    Boot Args

    SHELL PROMPT :>printenv
    baudrate=115200
    ethaddr=02:81:00:00:00:00
    bootdelay=2
    verify=no
    bootfile=uImage_dm368
    filesize=1A1500
    fileaddr=80700000
    ipaddr=10.60.2.221
    serverip=10.60.2.81
    bootcmd=cp.l 0x02080000 0x80700000 0x68541;bootm
    bootargs=console=ttyS0,115200n8 ip=10.60.3.222:10.60.3.60:10.60.3.60:255.255.255.0 root=/dev/mtdblock4 rw mem=100M lpj=741376 init=bin/pan
    stdin=serial
    stdout=serial
    stderr=serial
    ver=U-Boot 1.3.4 (Sep  7 2012 - 01:39:57)

    SHELL PROMPT :>

    Boot Logs

     
     ###### DM368 UBL VERSION: xxxxxx #######

                                                               Flash: 16 MB

     --- u-boot for DM368 version xxxxx ---
    In:    serial
    Out:   serial
    Err:   serial
    Ethernet PHY: GENERIC @ 0x00
    Hit any key to stop autoboot:  0
    ## Booting kernel from Legacy Image at 80700000 ...
       Image Name:
       Image Type:   ARM Linux Kernel Image (uncompressed)
       Data Size:    1709248 Bytes =  1.6 MB
       Load Address: 80008000
       Entry Point:  80008000
       Loading Kernel Image ... OK
    OK

    Starting kernel ...

    Linux version 2.6.18_pro500-davinci_evm-arm_v5t_le (root@Levin) (gcc ????? 4.2.0 (MontaVista 4.2.0-16.0.32.0801914 2008-08-30)) #1 PREEMPT Tue Aug 30 16:54:04 JST 2011
    CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
    Machine: DaVinci DM365 EVM
    Memory policy: ECC disabled, Data cache writeback
    DaVinci DM0365 variant 0x8
    PLL0: fixedrate: 24000000, commonrate: 170000000, vpssrate: 340000000
    PLL0: vencrate_sd: 680000000, ddrrate: 170000000 mmcsdrate: 170000000
    PLL1: armrate: 432000000, voicerate: 144000000, vencrate_hd: 27000000
    CPU0: D VIVT write-back cache
    CPU0: I cache: 16384 bytes, associativity 4, 32 byte lines, 128 sets
    CPU0: D cache: 8192 bytes, associativity 4, 32 byte lines, 64 sets
    Built 1 zonelists.  Total pages: 25600
    Kernel command line: console=ttyS0,115200n8 ip=10.60.3.222:10.60.3.60:10.60.3.60:255.255.255.0 root=/dev/mtdblock4 rw mem=100M lpj=741376 init=bin/pan
    PID hash table entries: 512 (order: 9, 2048 bytes)
    Clock event device timer0_0 configured with caps set: 07
    Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
    Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
    Memory: 100MB = 100MB total
    Memory: 99584KB available (1328K code, 368K data, 76K init)
    Calibrating delay loop (skipped)... 148.27 BogoMIPS preset
    Mount-cache hash table entries: 512
    CPU: Testing write buffer coherency: ok
    NET: Registered protocol family 16
    DaVinci: 104 gpio irqs
    DM365 IPIPE initialized in Single Shot mode
    Generic PHY: Registered new driver
    ch0 default output "COMPOSITE", mode "NTSC"
    PPC: Configuring YCC8 for Proxy Card in NTSC Mode
    VPBE Encoder Initialized
    dm365_afew_hw_init
    Initializing Cryptographic API
    io scheduler noop registered (default)
    Serial: 8250/16550 driver $Revision: 1.90 $ 2 ports, IRQ sharing disabled
    serial8250.0: ttyS0 at MMIO map 0x1d06000 mem 0xfbd06000 (irq = 41) is a 16550A
    serial8250.0: ttyS1 at MMIO map 0x1c20000 mem 0xfbc20000 (irq = 40) is a 16550A
    RAMDISK driver initialized: 1 RAM disks of 32768K size 1024 blocksize
    Linux video capture interface: v2.00
    vpfe ccdc capture vpfe ccdc capture.1: vpif_register_decoder: decoder = VIPERFPGA
    Trying to register davinci display video device.
    layer=c03bbc00,layer->video_dev=c03bbd60
    Trying to register davinci display video device.
    layer=c03bba00,layer->video_dev=c03bbb60
    davinci_init:DaVinci V4L2 Display Driver V1.0 loaded
    i2c /dev entries driver
    davinciflash.0: Found 1 x16 devices at 0x0 in 16-bit bank
     Amd/Fujitsu Extended Query Table at 0x0040
    davinciflash.0: CFI does not contain boot bank location. Assuming top.
    number of CFI chips: 1
    cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.
    cmdlinepart partition parsing not available
    Creating 5 MTD partitions on "davinciflash.0":
    0x00000000-0x00020000 : "ubl"
    0x00020000-0x00040000 : "bootloader"
    0x00040000-0x00080000 : "params"
    0x00080000-0x00320000 : "kernel1"
    0x00320000-0x01000000 : "filesystem"
    NET: Registered protocol family 1
    Time: timer0_1 clocksource has been installed.
    No filesystem could mount root, tried:  cramfs
    Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,4)

    Best Regards,

    Kiran.

  • Kiran,

    Your kernel image size is 0x1a1500 and you are flashing only 0x68541.

  • Your kernel image size is 0x1a1500 and you are flashing only 0x68541.

    [Kiran] We are using word transfer instead of byte transfer , and hence we are giving 1/4th of actual kernel size.

  • Hi,

    Can anyone help me on this?Sould we change the bootargs since the kernel is not able to find the place where the file system is loaded.??

    Regards

    Haran 

  • Haran,

    Change the bootargs to  "root=/dev/mtdblock4 rootfstype=cramfs" and try. 

  • Hi Renjith,

    Thanks for the reply.I tried whatever you said but then it dint workout for me.Still same error.Actually there is a very peculiar observation with our NOR flash.When we flash u-boot and UBL through JTAG and when i do flinfo the following is the observation

    flinfo

    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 16 MB in 128 Sectors
      AMD Standard command set, Manufacturer ID: 0x01, Device ID: 0x227E
      Erase timeout: 4096 ms, write timeout: 1 ms
      Buffer write timeout: 3 ms, buffer size: 64 bytes

      Sector Start Addresses:
      02000000        02020000        02040000   RO   02060000 E      02080000 E
      020A0000 E    020C0000 E      020E0000 E      02100000 E      02120000 E
      02140000 E    02160000 E      02180000 E      021A0000 E      021C0000 E
      021E0000 E    02200000 E      02220000 E      02240000 E      02260000 E
      02280000 E    022A0000 E      022C0000 E      022E0000 E      02300000 E
      02320000 E    02340000 E      02360000 E      02380000 E      023A0000 E
      023C0000 E    023E0000 E      02400000 E      02420000 E      02440000 E
      02460000 E    02480000 E      024A0000 E      024C0000 E      024E0000 E
      02500000 E    02520000 E      02540000 E      02560000 E      02580000 E
      025A0000 E    025C0000 E      025E0000 E      02600000 E      02620000 E
      02640000 E    02660000 E      02680000 E      026A0000 E      026C0000 E
      026E0000 E    02700000 E      02720000 E      02740000 E      02760000 E
      02780000 E    027A0000 E      027C0000 E      027E0000 E      02800000
      02820000        02840000 E      02860000 E      02880000 E      028A0000 E
      028C0000 E    028E0000 E      02900000 E      02920000 E      02940000 E
      02960000 E     02980000 E      029A0000 E      029C0000 E      029E0000 E
      02A00000 E     02A20000 E      02A40000 E      02A60000 E      02A80000 E
      02AA0000 E    02AC0000 E      02AE0000 E      02B00000 E      02B20000 E
      02B40000 E    02B60000 E      02B80000 E      02BA0000 E      02BC0000 E
      02BE0000 E    02C00000 E      02C20000 E      02C40000 E      02C60000 E
      02C80000 E    02CA0000 E      02CC0000 E      02CE0000 E      02D00000 E
      02D20000 E    02D40000 E      02D60000 E      02D80000 E      02DA0000 E
      02DC0000 E    02DE0000 E      02E00000 E      02E20000 E      02E40000 E
      02E60000 E      02E80000 E      02EA0000 E      02EC0000 E      02EE0000 E
      02F00000 E      02F20000 E      02F40000 E      02F60000 E      02F80000 E
      02FA0000 E      02FC0000 E      02FE0000 E

    If you observe the addresses from 02800000 02820000 they are not empty sectory and whenever i try to overwrite this address the UBL goes off and the board does not boot at all.Is this a common observation?

    So in order to refrain from rewriting this memory area what i did is i flash the file system from 0x02960000 and my kernel occupies the flash from 0x02080000 to 0x02220000 so should i specify in the bootargs that my file system is present from 0x02960000 in the flash or how will the kernel know that my file system is present at this location of the flash.

    Following are my printenv variables

    baudrate=115200
    ethaddr=02:81:00:00:00:00
    bootdelay=2
    verify=no
    bootfile=uImage_dm368
    filesize=549000
    fileaddr=83000000
    ipaddr=10.60.2.221
    serverip=10.60.2.81
    bootargs=console=ttyS0,115200n8 ip=10.60.3.225:10.60.2.81:10.60.2.81:255.255.255.0 root=/dev/mtdblock4 rootfstype=cramfs rw mem=100M lpj=741376 init=bin/pan
    bootcmd=cp.b 0x02080000 0x80700000 0x1a1500;bootm
    stdin=serial
    stdout=serial
    stderr=serial
    ver=U-Boot 1.3.4 (Sep  7 2012 - 01:39:57)

    Regards

    Haran

  • HI,

    I was able to boot my file system.

    Thanks and Regards

    Haran