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.

SD Card Boot and Flashing Tool for DM355 and DM365

Other Parts Discussed in Thread: TEST2

I am glad to announce 6th release of SD Card Boot and Flashing Tool.

Online manual, downloads, Project page at TI GForge

New features and fixes:

  1. Supports DM355 and DM365
  2. Flashes UBL, u-boot, kernel and root file system from SD card
  3. Marks bad blocks during format (thanks to TI flash_utils)
  4. Improved and simplified scripts. The scripts is Ubuntu/Debian Dash compatible.
  5. Compiled with gcc 4.2.0 from MVL 5
  6. Clean source code and makefiles

Thank everybody who used this tool and sent me comments!
Waiting for your  feedback.

  • we  appreciated your  works! It is so convenient to burn firmware!

    At the same time,you can make it strong ,for example,you can add yaffs2 or jeffs2 rootfs to the utility,because most users use them for nor and nand flash, ramdisk is used few!

  •  

      I'm trying to use your 6th release to do sd upgrade, but there's some problems, when I try to do

    ./dm3xx_sd_boot format /dev/<sd device>, I wait 20+ minutes and it still running.

       so I have two questions:

      1.  I use a card reader, connect  to my linux PC usb socket,  does your release support this kind of

    format ?  or I need directly connect SD card to PC's SD socket ? (unfortunnetly my PC desn't have SD socket)

      2. my SD card has capacity of 4GB, thisis SDHC format. does your release support SDHC card ?

       thanx.

  • Thank you for feedback.

    richardHoo said:
    ./dm3xx_sd_boot format /dev/<sd device>, I wait 20+ minutes and it still running.

    Run please as:

    sh -x ./dm3xx_sd_boot format /dev/<sd device>

    and send me results.

    I use my tool on PC and EVM too. If you have problems with PC you could try use EVM.

    richardHoo said:
    my SD card has capacity of 4GB, thisis SDHC format. does your release support SDHC card ?

    The question is "does DM365 supports SDHC?" I haven't tested it.

  • could you tell me your test environment ?

     1. SD card capacity you used

     2. did you access SD card through card reader ?

     3. your linux version ?  I use redhat EL4

     

    thanx.

  • richardHoo said:
     1. SD card capacity you used

    1 GB and 2 GB

    richardHoo said:
     2. did you access SD card through card reader ?

    Yes

    richardHoo said:
     3. your linux version ? 

    Debian 5.0.3 (right now), sometimes Ubuntu 9.04 and Fedora 10 and 11

  • I tried but always failed, I will try to write down more detailed steps:

     1. my work environment

          pc: redhat linux enterprise 4

          target:  TI DM365 EVM board

          SD card: 2GB

          I use a usb card reader which has SD slot to connect to PC

          and cause u-boot on evm board is crashed, I can only try create SD image on pc

    2. create sd image without modify your dm3xx_sd_boot script

         it failed on PC, following is message log:

    [root@redhatES4 dm3xx_sd_boot-6]# ./dm3xx_sd_boot format /dev/sdd1
    cleaning SD card
    1000+0 records in
    1000+0 records out
    test


    Disk /dev/sdd1: 1015 cylinders, 61 heads, 62 sectors/track

    sfdisk: ERROR: sector 0 does not have an msdos signature
     /dev/sdd1: unrecognized partition
    Old situation:
    No partitions found
    New situation:
    Units = mebibytes of 1048576 bytes, blocks of 1024 bytes, counting from 0

       Device Boot Start   End    MiB    #blocks   Id  System
    /dev/sdd1p1   *     0+    40-    41-     41601+   b  W95 FAT32
    /dev/sdd1p2   *    40+  1874-  1834-   1877763   83  Linux
    /dev/sdd1p3         0      -      0          0    0  Empty
    /dev/sdd1p4         0      -      0          0    0  Empty
    Successfully wrote the new partition table

    Re-reading the partition table ...
    BLKRRPART: Invalid argument
    The command to re-read the partition table failed
    Reboot your system now, before using mkfs

    mkfs.vfat 2.8 (28 Feb 2001)
    No device specified.
    Usage: mkdosfs [-A] [-c] [-C] [-v] [-I] [-l bad-block-file] [-b backup-boot-sector]
           [-m boot-msg-file] [-n volume-name] [-i volume-id]
           [-s sectors-per-cluster] [-S logical-sector-size] [-f number-of-FATs]
           [-F fat-size] [-r root-dir-entries] [-R reserved-sectors]
           /dev/name [blocks]
    mount: can't find /mnt/sdc in /etc/fstab or /etc/mtab
    failed to mount SD card
    10000+0 records in
    10000+0 records out
    dm3xx_boot_data_addr=0x3ad400
    Image dm3xx_boot_rec:a1aced00 100 3c 1d6b 0 0 0 0 3ad400
    10000+0 records in
    10000+0 records out
    dm3xx boot record is written
    Please reinsert the card for auto mounting or mount it manually

    3. create sd image with modify your script

        (1) modification

          diff result:, < is modified one, > is your original one

    64c64
    <     ./dm3xx_boot_make_image   
    ---
    >     dm3xx_boot_make_image   
    83,86d82
    <
    <     #part=${sd}p1
    <     part=${sd}
    <
    93,96d88
    <
    <     echo "test"   
    <     echo $part
    <
    98c90
    <     printf ",40,b,*\n,,,*\n"  | sfdisk -f --no-reread -uM -q $sd  || ( echo_failure Failed to format SD card && return 1 ) || return
    ---
    >     printf ",40,b,*\n,,,*\n"  | sfdisk -uM -q $sd  || ( echo_failure Failed to format SD card && return 1 ) || return
    133c125
    <     ./dm3xx_boot_make_image    || ( echo_failure failed to build data image && return 1 ) || return
    ---
    >     dm3xx_boot_make_image    || ( echo_failure failed to build data image && return 1 ) || return

       (2)  format

           format output message:

    [root@redhatES4 dm3xx_sd_boot-6]# ./dm3xx_sd_boot format /dev/sdd1
    cleaning SD card
    1000+0 records in
    1000+0 records out
    test
    /dev/sdd1

    Disk /dev/sdd1: 1015 cylinders, 61 heads, 62 sectors/track

    sfdisk: ERROR: sector 0 does not have an msdos signature
     /dev/sdd1: unrecognized partition
    Old situation:
    No partitions found
    New situation:
    Units = mebibytes of 1048576 bytes, blocks of 1024 bytes, counting from 0

       Device Boot Start   End    MiB    #blocks   Id  System
    /dev/sdd1p1   *     0+    40-    41-     41601+   b  W95 FAT32
    /dev/sdd1p2   *    40+  1874-  1834-   1877763   83  Linux
    /dev/sdd1p3         0      -      0          0    0  Empty
    /dev/sdd1p4         0      -      0          0    0  Empty
    Successfully wrote the new partition table

    Re-reading the partition table ...
    BLKRRPART: Invalid argument
    The command to re-read the partition table failed
    Reboot your system now, before using mkfs

    mkfs.vfat 2.8 (28 Feb 2001)
    dd: advancing past 15360000 bytes in output file `/mnt/sdc/dm3xx.dat':
    Operation not permitted
    0+1 records in
    0+1 records out
    total 4
    -rwxr-xr-x  1 root root 19 Sep 23 11:24 dm3xx.dat
    SD card /dev/sdd1 formatted
    10000+0 records in
    10000+0 records out
    dm3xx_boot_data_addr=0x3ad400
    Image dm3xx_boot_rec:a1aced00 100 3c 1d6b 0 0 0 0 3ad400
    10000+0 records in
    10000+0 records out
    dm3xx boot record is written
    Please reinsert the card for auto mounting or mount it manually

        (3) data

    output message:

    [root@redhatES4 dm3xx_sd_boot-6]# ./dm3xx_sd_boot data
    /media/usbdisk/dm3xx.dat
    copying data to
    Writing /media/usbdisk/dm3xx.dat
    000200-006724,    25892 bytes <- sdcard_flash/sdcard_flash_DM36x.bin
    008000-008200,    512 bytes <- test pattern 1 2 3
    010000-015000,    20480 bytes <- original/UBL_DM36x_NAND.bin
    020000-045308,   152328 bytes <- original/u-boot-1.3.4-dm365_evm.bin
    060000-2547c8,  2049992 bytes <- original/uImage-dm365
    400000-6740c7,  2572487 bytes <- original/ramdisk.gz
    syncing
    DM355 boot data copied in data file /media/usbdisk/dm3xx.dat on
    Filesystem           1K-blocks      Used Available Use% Mounted on
    /dev/sdc1              1917192      6616   1910576   1% /media/usbdisk

    4. put sd card on TI EVM board

        I change SW4 boot config,  use old UART setting( as TI's document) , tried both 2 slots ( SD and SD/MMC), 

    but nothing output on terminal

       could you help me ?  thanx.

  • richardHoo said:
    ./dm3xx_sd_boot format /dev/sdd1

    run:  ./dm3xx_sd_boot format /dev/sdd <-------------- without 1

    /dev/sdd - is whole disk

    /dev/sdd1 - is just first partition

     

  • it works, thanx :)

  • I am trying 6th release on the DM355 EVM board.
    However, it stops in the following part when booting it from SD card.

    ==========
    SD card boot and flashing tool for DM355 and DM365
    by Constantine Shulyupin http://www.LinuxDriver.co.il/
    Online manual: http://wiki.davincidsp.com/index.php/SD_card_boot_and_flashing_tool_for_DM355_and_DM365
    based on TI DM35x FlashAndBootUtils 1.10 SFT, TI flash_utils and SpectrumDigital evmdm355, evmdm365
    Compiled on Sep 22 2009 at 00:31:41 with gcc 4.2.0 (MontaVista 4.2.0-16.0.32.0801914 2008-08-30)
    SYSTEM->DEVICE_ID=0x0B73B02F

    DM355_MHZ=216 DDR_MHZ=171

    PLL1->PLLM=143 PLL2->PLLM=113 PLL1->PLLDIV3=0x0000800F DDR->SDTIMR=0x2A923249 DDR->SDTIMR2=0x3C17C763

    &EMIFStart=0x02000000

    nand->devID=0x000000DA nand->dataBytesPerPage=2048 nand->pagesPerBlock=64 nand->numBlocks=8192 nand_size=1073741824

    sdcard_init

    sdcard_read sdc_src=0x00001000 dst=0x80001044 len=0x00000200 dst + len=0x80001244
    ==========

     

    I created the image on the DM355 EVM board, and the following message was output.

    ==========
    # ./dm3xx_sd_boot format /dev/mmcblk0
    cleaning SD card
    1000+0 records in
    1000+0 records out
     mmcblk0: unknown partition table

    Disk /dev/mmcblk0: 30992 cylinders, 4 heads, 16 sectors/track

    sfdisk: ERROR: sector 0 does not have an msdos signature
     /dev/mmcblk0: unrecognized partition
    Old situation:
    No partitions found
    New situation:
    Units = mebibytes of 1048576 bytes, blocks of 1024 bytes, counting from 0

       Device Boot Start   End    MiB    #blocks   Id  System
    /dev/mmcblk0p1   *     0+    39     40-     40959+   b  W95 FAT32
    /dev/mmcblk0p2   *    40    968-   929-    950784   83  Linux
    /dev/mmcblk0p3         0      -      0          0    0  Empty
    /dev/mmcblk0p4         0      -      0          0    0  Empty
    Successfully wrote the new partition table

    Re-reading the partition table ...
     mmcblk0: p1 p2

    mkfs.vfat 2.11 (12 Mar 2005)
    dd: advancing past 15360000 bytes in output file `/mnt/sdc/dm3xx.dat': Operation not permitted
    0+1 records in
    0+1 records out
    total 1
    -rwxr--r--  1 root root 19 Jan  1 00:50 dm3xx.dat
    SD card /dev/mmcblk0 formatted
    10000+0 records in
    10000+0 records out
    dm3xx_boot_data_addr=0x0a1c00
    Image dm3xx_boot_rec:a1aced00 100 3c 50f 0 0 0 0 a1c00
    10000+0 records in
    10000+0 records out
    dm3xx boot record is written
    Please reinsert the card for auto mounting or mount it manually
    # pnp: Device 00:01 disabled.
     mmcblk0: p1 p2

    # mount /dev/mmcblk0 /mnt/m sdc/
    FAT: bogus number of reserved sectors
    VFS: Can't find a valid FAT filesystem on dev mmcblk0.
    FAT: bogus number of reserved sectors
    VFS: Can't find a valid FAT filesystem on dev mmcblk0.
    yaffs: dev is 266338304 name is "mmcblk0"
    yaffs: Attempting MTD mount on 254.0, "mmcblk0"
    yaffs: dev is 266338304 name is "mmcblk0"
    yaffs: Attempting MTD mount on 254.0, "mmcblk0"
    mount: you must specify the filesystem type
    # mount /dev/mmcblk0p1 /mnt/sdc
    # ./dm3xx_sd_boot data /mnt/sdc/dm3xx.dat
    copying data to
    Writing /mnt/sdc/dm3xx.dat
    000200-006914,    26388 bytes <- sdcard_flash/sdcard_flash_DM35x.bin
    008000-008200,    512 bytes <- test pattern 1 2 3
    010000-012e00,    11776 bytes <- original/ublDM355-nand.bin
    020000-03f648,   128584 bytes <- original/u-boot-1.2.0-dm355_evm.bin
    060000-24e3bc,  2024380 bytes <- original/uImage-dm355
    400000-6740c7,  2572487 bytes <- original/ramdisk.gz
    syncing
    DM355 boot data copied in data file /mnt/sdc/dm3xx.dat on
    Filesystem           1K-blocks      Used Available Use% Mounted on
    /dev/mmcblk0p1           40313      6609     33704  17% /mnt/sdc
    ==========

    It would be greatly appreciated if some advice could be gotten.

     

  • Kenji Nishimura said:
    I am trying 6th release on the DM355 EVM board.
    However, it stops in the following part when booting it from SD card.

    It seem you have a problem with SD card.

    What kind of SD card do you use?

    Can you try another kind SD card?

    You my change some sd card parameter:

    in sdcard_init change MMCSD_DATA_BUS_4 to MMCSD_DATA_BUS_1

    in MMCSD_initCard increase MMCSD_MMCCLK to 101, 102, 110 .. 1FF

  • It boots by changing the SD card from 1GB to 2GB.
    Thank you.

  • It fails in boot if the kernel and the image that I made are installed in NAND with the bud block.

    ==========
    Loading from NAND 256MiB 3,3V 8-bit, offset 0x400000
       Image Name:   Linux-2.6.10_mvl401
       Image Type:   ARM Linux Kernel Image (uncompressed)
       Data Size:    1577900 Bytes =  1.5 MB
       Load Address: 80008000
       Entry Point:  80008000
    ## Booting image at 80700000 ...
       Image Name:   Linux-2.6.10_mvl401
       Image Type:   ARM Linux Kernel Image (uncompressed)
       Data Size:    1577900 Bytes =  1.5 MB
       Load Address: 80008000
       Entry Point:  80008000
       Verifying Checksum ... OK
    OK

    Starting kernel ...

    Uncompressing Linux........................................................................................................... done, booting the ke.DaVinci I2C DEBUG: 18:12:25 Aug 29 2009
    invalid compressed format (err=2)
    FATAKernel panic - not syncing: Attempted to kill init!
    ==========

    could you help me ?

  • Hi,

    I'm getting ready to try using this tool but have some questions:

    We're using this board as part of a prototype and I am working remotely. Most frequently I will want to update the filesystem but sometimes the kernel. Will this allow me to send my users files that they can copy to the SD card using a card reader? If it isn't this straight forward how might they use this tool to update the filesystem or kernel image?

    Is there a description of the theory of operations? Something that would describe where it obtains the images for the filesystem, the kernel, and the bootloaders?

    Thanks,

    Ken

  • Ken Koller said:
    Will this allow me to send my users files that they can copy to the SD card using a card reader?

    You can prepare boot data file and sent it to your users. You users should carefully copy the file to preformated for DM3xx booy SD card. Carefully means ovewrite previous data file content with new one. Beter to do it with commands dd or cat. Physical location of the file on the card should be intact.

    Ken Koller said:
    Is there a description of the theory of operations? Something that would describe where it obtains the images for the filesystem, the kernel, and the bootloaders?

    You can define in file dm3xx_sd.config location of images to store on SD card for flashing on dm3xx board.

    Also online manual could be helpful.

  • Kenji Nishimura said:
    It fails in boot if the kernel and the image that I made are installed in NAND with the bud block.

    Yes, it could be a problem now.

    I future new fault tolerant flashing algorithm could be developed.

     

  • I am trying to use this with out success.  First I run this:

    keith@KeithM1330:~/share/test2/dm3xx_sd_boot-6$ sudo ./dm3xx_sd_boot format /dev/mmcblk0

    cleaning SD card

    1000+0 records in

    1000+0 records out

    1024000 bytes (1.0 MB) copied, 0.59135 s, 1.7 MB/s

     

    Disk /dev/mmcblk0: 60032 cylinders, 4 heads, 16 sectors/track

     

    sfdisk: ERROR: sector 0 does not have an msdos signature

     /dev/mmcblk0: unrecognized partition table type

    Old situation:

    No partitions found

    New situation:

    Units = mebibytes of 1048576 bytes, blocks of 1024 bytes, counting from 0

     

       Device Boot Start   End    MiB    #blocks   Id  System

    /dev/mmcblk0p1   *     0+    39     40-     40959+   b  W95 FAT32

    /dev/mmcblk0p2   *    40   1875   1836    1880064   83  Linux

    /dev/mmcblk0p3         0      -      0          0    0  Empty

    /dev/mmcblk0p4         0      -      0          0    0  Empty

    Successfully wrote the new partition table

     

    Re-reading the partition table ...

     

    mkfs.vfat 2.11 (12 Mar 2005)

    0+0 records in

    0+0 records out

    0 bytes (0 B) copied, 3.1291e-05 s, 0.0 kB/s

    0+1 records in

    0+1 records out

    18 bytes (18 B) copied, 2.4306e-05 s, 741 kB/s

    total 15000

    -rwxr-xr-x 1 root root 15360000 2009-10-14 22:42 dm3xx.dat

    SD card /dev/mmcblk0 formatted

    10000+0 records in

    10000+0 records out

    10240000 bytes (10 MB) copied, 0.71771 s, 14.3 MB/s

    dm3xx_boot_data_addr=0x0a1c00

    ./dm3xx_sd_boot: 165: dm3xx_boot_make_image: not found

    Failed to copy boot record to SD card

    Please reinsert the card for auto mounting or mount it manually

    keith@KeithM1330:~/share/test2/dm3xx_sd_boot-6$ 

     

    Then I replug the card and see it mount.  Then I run this to verify the card is formated:

     

    keith@KeithM1330:~/share/test2/dm3xx_sd_boot-6$ ls /media/disk/

    dm3xx.dat

    keith@KeithM1330:~/share/test2/dm3xx_sd_boot-6$

     

    Now I run this and it fails?

     

    keith@KeithM1330:~/share/test2/dm3xx_sd_boot-6$ sh -x ./dm3xx_sd_boot data /media/disk/dm3xx.dat 

    + set -o allexport

    + SUCCESS=\033[2;32m

    + BLUE=\033[1;34m

    + RED=\033[0;31m

    + WARNING=\033[0;33m

    + NOCOLOR=\033[0;39m

    + GREENU=\033[4;32m

    + sdc_mnt=/mnt/sdc

    + u=DM35x_FlashAndBootUtils_1_10_sd

    + uname -m

    + sed -e s/i?86.*/x86/ -e s/arm.*/arm/

    + arch=i686

    + export PATH=/opt/mvl/montavista/pro/devkit/arm/v5t_le/bin:/opt/mvl/montavista/pro/bin:/opt/mvl/montavista/common/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:bin.i686

    + . ./dm3xx_sd.config

    + a=DM36x

    + ubl=original/UBL_DM36x_NAND.bin

    + uboot=original/u-boot-1.3.4-dm365_evm.bin

    + kernel=original/uImage-dm365

    + rootfs=original/ramdisk.gz

    + echo /media/disk/dm3xx.dat

    + data_file=/media/disk/dm3xx.dat

    + ls sdcard_flash/sdcard_flash_DM36x.bin

    + sdboot=sdcard_flash/sdcard_flash_DM36x.bin

    + cmd=data

    + [ -z data ]

    + shift

    + sd=/media/disk/dm3xx.dat

    + :

    + data_file=/media/disk/dm3xx.dat

    + ubl=original/UBL_DM36x_NAND.bin

    + uboot=original/u-boot-1.3.4-dm365_evm.bin

    + kernel=original/uImage-dm365

    + rootfs=original/ramdisk.gz

    + sdcard_data

    + set -a

    + echo copying data to

    copying data to

    + dm3xx_boot_data=/media/disk/dm3xx.dat

    + dm3xx_boot_make_image

    ./dm3xx_sd_boot: 1: dm3xx_boot_make_image: not found

    + echo_failure failed to build data image

    + printf \033[0;31mfailed to build data image\033[0;39m\n

    failed to build data image

    + return 1

    + return

    + set -o allexport

    keith@KeithM1330:~/share/test2/dm3xx_sd_boot-6$ 

    keith@KeithM1330:~/share/test2/dm3xx_sd_boot-6$ ls /media/disk/

    dm3xx.dat

    keith@KeithM1330:~/share/test2/dm3xx_sd_boot-6$ 

     

    Any ideas?  

     

     

  • before running script run please:

    export PATH=$PATH:bin.x86

  • I don't know what I had done but I finally deleted the whole directory and uncompressed it again.  Now it gets further.  I run:

     

    make install

    ./dm3xx_sd_boot data

    copying data to

    Writing /media/disk/dm3xx.dat

    000200-006724,    25892 bytes <- sdcard_flash/sdcard_flash_DM36x.bin

    008000-008200,    512 bytes <- test pattern 1 2 3

    010000-015000,    20480 bytes <- original/UBL_DM36x_NAND.bin

    020000-045308,   152328 bytes <- original/u-boot-1.3.4-dm365_evm.bin

    060000-2547c8,  2049992 bytes <- original/uImage-dm365

    400000-6740c7,  2572487 bytes <- original/ramdisk.gz

    syncing

    DM355 boot data copied in data file /media/disk/dm3xx.dat on

    Filesystem           1K-blocks      Used Available Use% Mounted on

    /dev/mmcblk0p1           40313     15001     25313  38% /media/disk

    So I think the SD card is now generated correctly.   I then place the2 gig SD card in the EVM365 and switch BTLSel1 to on so that I am no longer in NAND boot but now in SD boot mode.  I power on the unit and wait 5 minutes.  Nothing happens that I can see.  So I power down the board and switch BTLSel1 back to off to put me back in NAND boot.  I power on the board to see if I have restored the original UBoot or if I still have my new UBoot.  Terra term shows that I still have my new UBoot.
    Am I missing a step for SD boot or is there something wrong with the way I generated the SD card?  I am trying to make an SD card that I can send to others to update their UBoots.

  • Try please read documentation to do it carefully again.
    Pay attention to errors.
    The tool is tested by many peoples and it works.
    Insert SD in top slot on dm365 and bottom on dm355.
    There could be still incomparability issues with some OS (as arch and PATH issue).
    I tested the tool on Fedora, Debian  and Ubuntu.
    What OS do you use?

  • I am using Ubuntu 8.04 on  a Dell M1330

  • I have tried this many times now.  I don't see anything that looks like an unexpected error.

    After the format I see an sfdisk: ERROR but then it looks like it creates a partition and it is happy.  Is this the expected output?

    I then run the make install and it looks like it is working.

    I unmount the SD card and stick it in the top slot of the DM365.  Slide the BTSEL1 switch to change from NAND BOOT to SD BOOT.  Power on the board and nothing happens.  Not a single character comes out the console port.  I have read the direction many times and tried this many many times.  Does the sd contents look correct and does the log below look correct?  If so I go an bur a different SD card and try that next.

     

    ls -l /media/disk/

    total 15000

    -rwx------ 1 keith root 15360000 2009-10-15 11:31 dm3xx.dat

     

     

    keith@KeithM1330:~/share/test2/dm3xx_sd_boot-6$ sudo ./dm3xx_sd_boot format /dev/mmcblk0

    cleaning SD card

    1000+0 records in

    1000+0 records out

    1024000 bytes (1.0 MB) copied, 0.50758 s, 2.0 MB/s

     

    Disk /dev/mmcblk0: 60032 cylinders, 4 heads, 16 sectors/track

     

    sfdisk: ERROR: sector 0 does not have an msdos signature

     /dev/mmcblk0: unrecognized partition table type

    Old situation:

    No partitions found

    New situation:

    Units = mebibytes of 1048576 bytes, blocks of 1024 bytes, counting from 0

     

       Device Boot Start   End    MiB    #blocks   Id  System

    /dev/mmcblk0p1   *     0+    39     40-     40959+   b  W95 FAT32

    /dev/mmcblk0p2   *    40   1875   1836    1880064   83  Linux

    /dev/mmcblk0p3         0      -      0          0    0  Empty

    /dev/mmcblk0p4         0      -      0          0    0  Empty

    Successfully wrote the new partition table

     

    Re-reading the partition table ...

     

    mkfs.vfat 2.11 (12 Mar 2005)

    0+0 records in

    0+0 records out

    0 bytes (0 B) copied, 2.5913e-05 s, 0.0 kB/s

    0+1 records in

    0+1 records out

    18 bytes (18 B) copied, 2.4306e-05 s, 741 kB/s

    total 15000

    -rwxr-xr-x 1 root root 15360000 2009-10-15 11:15 dm3xx.dat

    SD card /dev/mmcblk0 formatted

    10000+0 records in

    10000+0 records out

    10240000 bytes (10 MB) copied, 0.721003 s, 14.2 MB/s

    dm3xx_boot_data_addr=0x0a1c00

    ./dm3xx_sd_boot: 165: dm3xx_boot_make_image: not found

    Failed to copy boot record to SD card

    Please reinsert the card for auto mounting or mount it manually

    keith@KeithM1330:~/share/test2/dm3xx_sd_boot-6$ make install

    ./dm3xx_sd_boot data

    copying data to

    Writing /media/disk/dm3xx.dat

    000200-006724,    25892 bytes <- sdcard_flash/sdcard_flash_DM36x.bin

    008000-008200,    512 bytes <- test pattern 1 2 3

    010000-015000,    20480 bytes <- original/UBL_DM36x_NAND.bin

    020000-045308,   152328 bytes <- original/u-boot-1.3.4-dm365_evm.bin

    060000-2547c8,  2049992 bytes <- original/uImage-dm365

    400000-6740c7,  2572487 bytes <- original/ramdisk.gz

    syncing

    DM355 boot data copied in data file /media/disk/dm3xx.dat on

    Filesystem           1K-blocks      Used Available Use% Mounted on

    /dev/mmcblk0p1           40313     15001     25313  38% /media/disk

    keith@KeithM1330:~/share/test2/dm3xx_sd_boot-6$ sudo umount /media/disk/

    keith@KeithM1330:~/share/test2/dm3xx_sd_boot-6$ 

  • You log looks OK.
    It seems you use internal SD reader on PC.
    Can you please try to record SD on EVM (if you have it in working condition)?

  • I am working now.  Here is what I had to do:

    Format using the internal SD slot in my PC would make it not work.

    Format using the EVM365 would work.  I noticed that the EVM version took a long time while running it from my PC would complete in a second or two.

    After it has been formatted using the EVM365 I can then run make install from the PC to update the software.  Also I can now put different versions of UBoot by running make install on my Ubuntu PC.

    So the issue was the format from the PC was doing something wrong but  the rest would work.  I don't know why but I can now accomplish what I wanted to do.

     

    Thanks for the EVM suggestion.

  • Hi,

     

    I wonder if this tool can be used without any NAND flash on the target.I removed NAND flash from my DM355 EVM and I get nand_open errors during boot. My goal is to start u-boot without any NAND intervention.

     

    BTW, looking at the TI boot utilities sources, I don't see any sdmmc.c which needed for sd boot I guess.

     

    Thanks,

    Caglar

  • It looks to me this is a linux specific tool, but not everyone uses linux.

    What about a Flash tool similar to the one I know from DM6446, where you could boot a complete blank system via UART and flash your system with the binary created from Code Composer Studio? The source code was even available in C#.   I'm still missing this one for the DM 365. I actually would rather see a USB boot because of speed and data size. 

     

  • I think I have recorded my sd card successfully,and I enter the chosing operation mode , I select 'install' ,and the logs as bellosws:

    check_pattern_123        
    1 - boot; 2 - install; 3 - erase flash, 4 - nand boot, 5 - test first 16MB of RAM
    u - install ubl only, d - nand flash dump
    sdcard_init
    sdcard_read sdc_src=0x00001000 dst=0x80002248 len=0x00000200 dst + len=0x80002448 *data0=0xA1ACED00
    flasher_data=0x000A3400  
    sdcard_read sdc_src=0x000AB400 dst=0x80002248 len=0x00000200 dst + len=0x80002448 *data0=0x00010000
    check_pattern_123        
    sdcard_install
     * Flashing UBL
    sdcard_read sdc_src=0x000B3400 dst=0x8000244C len=0x00007800 dst + len=0x80009C4C *data0=0xE59F0124
    Writing header data to Block 00000001, Offset 00040000
     * Flashing u-boot
    sdcard_read sdc_src=0x000C3400 dst=0x81080000 len=0x00028000 dst + len=0x810A8000 *data0=0xEA000012
    Assuming CCS UBL UBL_CCS_ENTRY=0x00000020
    uboot_install_for_ccs_ubl
    nandBoot->numPage=0x00000028
    numBlks=0x00000001
    block_idx=0x00000009
    ptr[0]=0xB1ACED22 ptr[1]=0x00000019 ptr[2]=0x81080000 ptr[3]=0x81080000 ptr[4]=0x00000028 ptr[5]=0x00000000

     * Flashing kernel
    sdcard_read sdc_src=0x00103400 dst=0x80700000 len=0x00300000 dst + len=0x80A00000 *data0=0x56190527
    nand_write dst_nand=0x00400000 block_idx=0x00000010 len=0x00300000
     * Flashing Root FS        
    sdcard_read sdc_src=0x004A3400 dst=0x82000000 len=0x00400000 dst + len=0x82400000 *data0=0x08088B1F
    nand_write dst_nand=0x00600000 block_idx=0x00000018 len=0x00400000
    DONE           

    But when I set my EVM board to boot from nand flash and reset , I can't get any messege in minicom .What's wrong ?

    thanks advanced.

  • Your log looks good. Check switches and try again.

    There could be comparability issues with issues NAND flash. Do you use original or another one?

  • On dm355 blinking LED means boot error. Read manual for details.

  • Is it possible to make the ubl, uboot, kernel, filesystem flash address as configurable parameters ?

    I say this because for NAND flash devices other than one in the EVM board this will be a bottleneck.

    It will be of great help.

     

    Thanks,

    Snehal

     

  • Snehal Parmar said:
    Is it possible to make the ubl, uboot, kernel, filesystem flash address as configurable parameters ?

    It is defined in sdcard_flash/sdboot_flash_cfg.h

  • Help...

    I'm trying to get the SD boot work on the leopardboard using the SD card boot/flashing tools.  I believe that I am correctly writing everything to the SD...but no luck in seeing any console on the leopardboard.

    What baud is the code running at?  115k?  Can I use the default ubl, uboot, kernel, filesys given?  I tried both the ones from RidgeRun and the 'original' ones...nothing.

    My host machine is a PC running Ubuntu 9.10

    I have extracted the files and have a usb-to-SD card reader/writer attached to the linux PC.  When I do all the steps...I do not see any console on the leopardboard.  Can these tools be used for the leopardboard?

    - I believe the erase (format) is working correctly...and the data is too.  But, when I move the SD card to the leopardboard...I do not see any console.

    Here is what I see:

     

    tliebau@baboon:~/dm3xx_sd/dm3xx_sd_boot-6$ sudo ./dm3xx_sd_boot format /dev/sdb
    cleaning SD card
    1000+0 records in
    1000+0 records out
    1024000 bytes (1.0 MB) copied, 1.03712 s, 987 kB/s

    Disk /dev/sdb: 1014 cylinders, 31 heads, 62 sectors/track

    sfdisk: ERROR: sector 0 does not have an msdos signature
     /dev/sdb: unrecognized partition table type
    Old situation:
    No partitions found
    New situation:
    Units = mebibytes of 1048576 bytes, blocks of 1024 bytes, counting from 0

       Device Boot Start   End    MiB    #blocks   Id  System
    /dev/sdb1   *     0+    40-    41-     41322+   b  W95 FAT32
    /dev/sdb2   *    40+   951-   912-    933131   83  Linux
    /dev/sdb3         0      -      0          0    0  Empty
    /dev/sdb4         0      -      0          0    0  Empty
    Successfully wrote the new partition table

    Re-reading the partition table ...

    mkfs.vfat 3.0.1 (23 Nov 2008)
    0+0 records in
    0+0 records out
    0 bytes (0 B) copied, 2.2684e-05 s, 0.0 kB/s
    0+1 records in
    0+1 records out
    18 bytes (18 B) copied, 4.2314e-05 s, 425 kB/s
    sfdisk: ERROR: sector 0 does not have an msdos signatutotal 15000
    -rwxr-xr-x 1 root root 15360000 2009-11-16 14:34 dm3xx.dat
    SD card /dev/sdb formatted
    10000+0 records in
    10000+0 records out
    10240000 bytes (10 MB) copied, 2.49476 s, 4.1 MB/s
    dm3xx_boot_data_addr=0x0a3400
    Image dm3xx_boot_rec:a1aced00 100 3c 51b 0 0 0 0 a3400
    10000+0 records in
    10000+0 records out
    10240000 bytes (10 MB) copied, 2.49992 s, 4.1 MB/s
    dm3xx boot record is written
    Please reinsert the card for auto mounting or mount it manually
    tliebau@baboon:

    I then mount /dev/sdb1 to /sd on the Ubuntu PC...

    tliebau@baboon:~/dm3xx_sd/dm3xx_sd_boot-6$ sudo ./dm3xx_sd_boot data /sd/dm3xx.dat
    copying data to
    Writing /sd/dm3xx.dat
    000200-006724,    25892 bytes <- sdcard_flash/sdcard_flash_DM36x.bin
    008000-008200,    512 bytes <- test pattern 1 2 3
    010000-015000,    20480 bytes <- original/UBL_DM36x_NAND.bin
    020000-045308,   152328 bytes <- original/u-boot-1.3.4-dm365_evm.bin
    060000-2547c8,  2049992 bytes <- original/uImage-dm365
    400000-6740c7,  2572487 bytes <- original/ramdisk.gz
    syncing
    DM355 boot data copied in data file /sd/dm3xx.dat on
    Filesystem           1K-blocks      Used Available Use% Mounted on
    /dev/sdb1                40670     15001     25670  37% /sd
    tliebau@baboon:~/dm3xx_sd/dm3xx_sd_boot-6$

     

    Any help would be great!

    Tim Liebau

    tliebau@visual-ii.com

     

  • Hey Constantine!

    First of all, thanks for your great tool! It really saved me a lot of time, and in general it just works fine.

    Although i have a little issue that comes up when the tool reads its data from the card:

    The tool simply stops at an address (in my case its 0x2a0000 and 0x680000). So the first time i try to boot or write to nand (it does not matter which one of those 2) it stops at 2a. Then i reset and it stops at 68. Then i reset again and it succeeds!

     

    It appears that the problem only comes up after i pull the power cord and put it back in again. So after succeeding the first time and reset it succeeds again.

     

    Did ever someone came across this issue, or has a clue where to start searching?

    In the next days i'll get a different sd card that i'll try.

     

    Thanks for any help!

    Valentin

     

  • Valentin said:
    In the next days i'll get a different sd card that i'll try.

    Hi Valentin,

    Indeed, strange problem. Have you succeeded to solve it?

     

     

  • Is it possible to have access to the sources ? The gforge page says permission denied

  • Here are compiled sources: http://www.linux-davinci.info/data/boot/

  • Thank you, I thought the sources were not included in the binary download, but they are.

  • I am having a problem on booting Linux Kernel after flashing with sd card tool. When flashing with precompiled u-boot deliverd with sd card tool everything works fine. But when I use my own u-boot, I get an error loading Linux Kernel: "Bad Data or CRC". My u-boot image is larger than the one deliverd with the tool (134K instead of 125K). My NAND is K9F1G08 Samsung SLC Nand. Blocksize of this device is 128K, so my u-boot image needs a second Block. Could this be a probelm?

     

    Using my own u-boot, I can load my Linux Image over TFTP. Its only a problem when booting from NAND.

  • What happens when you load your kernel with default u-boot?

  • What do you mean by "default u-boot"?

    booting from NAND using:

    u-boot delivered with your tool:                                                      works fine

    u-boot delivered with dvsdk 2.00, default settings:                   Bad Data CRC

    u-boot delivered with dvsdk 2.00 and changed by me:            Bad Data CRC

    u-boot delivered with dvsdk 1.30, default settings:                   works fine

     

    could this be a problem of the NAND driver?

    dvsdk 1.30 and 2.00 both use u-boot 1.2.0, but it seems that there are differences.


  • Constantine said:

    In the next days i'll get a different sd card that i'll try.

    Hi Valentin,

    Indeed, strange problem. Have you succeeded to solve it?

    [/quote]

     

    Hi Constanine!

    sorry for my very very late response on that issue.

     

    I tried now a 2gig SanDisk card, and it works without any flaws. So the described strange behavior only happens on my "old" sd card (a 128mb i got from an old compaq ipaq ;) ).

     

    If any one of you is thinking about buying sd cards...mine is the following:

    SanDisk 2GB class 2 (non SDHC)

    serial number on the back is:

    BE0933714685G, Made in China

    they come in a 2pack without any case and are blue with the Logo in white-red

     

    maybe it helps someone

     

    Valentin

  • Thank you Valentin!

    I am very happy to see sucessful usage of my tool.

    Positive feedbacks are very important!

  •  Hi Constantine,

    Thank you for your support. I use the tools you provided and it works perfect(2G SD Card).

    But I want to use it work with SDHC(4 G).The board starts coming up so the boot process at the ROM boot loader level was actually successful, but the re-flashing utility on the SD card hangs as sdcard_init. 

    What Should I do?

     

     

    Regards,

    Weidong

  • You can try the following patch.
    Non SDHC card still works after this.

    For SDHC, you need to send CMD8 before initialisation. And you also need to use block address instead of byte address..

    PS : Hope the forum did no trash the patch.

  • Thank you, bandini.

  • Thank you for bandini's help.

    But an strange things happened.

    I flash sd card with the tools you provided On DM365.

    I think it's done correctly.

    root@192.168.1.180:/mnt/dm3xx_sd_boot-6.1# ./dm3xx_sd_boot data /mnt/sdc/dm3xx.at 

    copying data to

    Writing /mnt/sdc/dm3xx.dat

    000200-006724,    25892 bytes <- sdcard_flash/sdcard_flash_DM36x.bin

    008000-008200,    512 bytes <- test pattern 1 2 3

    010000-015000,    20480 bytes <- original/UBL_DM36x_NAND.bin

    020000-045308,   152328 bytes <- original/u-boot-1.3.4-dm365_evm.bin

    060000-2547c8,  2049992 bytes <- original/uImage-dm365

    400000-6740c7,  2572487 bytes <- original/ramdisk.gz

    syncing

    DM355 boot data copied in data file /mnt/sdc/dm3xx.dat on

    Filesystem           1K-blocks      Used Available Use% Mounted on

    /dev/mmcblk0p1           40313     15001     25313  38% /mnt/sdc

     

    But when set sw4 to sd card boot and reboot the EVM.

    =========================================================================================

    SD card boot and flashing tool for DM355 and DM365

    by Constantine Shulyupin http://www.LinuxDriver.co.il/

    Online manual: http://wiki.davincidsp.com/index.php/SD_card_boot_and_flashing_tool_for_DM355_and_DM365

    based on TI DM35x FlashAndBootUtils 1.10 SFT, TI flash_utils and SpectrumDigital evmdm355, evmdm365

    Compiled on Sep 22 2009 at 00:31:39 with gcc 4.2.0 (MontaVista 4.2.0-16.0.32.0801914 2008-08-30)

    SYSTEM->DEVICE_ID=0x0B83E02F

    &EMIFStart=0x02000000

    nand->devID=0x000000D3 nand->dataBytesPerPage=2048 nand->pagesPerBlock=64 nand->numBlocks=8192 nand_size=1073741824

    sdcard_init

    sdcard_read sdc_src=0x00001000 dst=0x80001044 len=0x00000200 dst + len=0x80001244 *data0=0xA1ACED00 

    flasher_data=0x000A1C00   

    sdcard_read sdc_src=0x000A9C00 dst=0x80001044 len=0x00000200 dst + len=0x80001244 *data0=0x00010000 

    check_pattern_123         

    1 - boot; 2 - install; 3 - erase flash, 4 - nand boot, 5 - test first 16MB of RAM

    u - install ubl only, d - nand flash dump

     > 

    ====================================================================================================

    And then I press the number "1",

    the system go to uboot in Nand and boot the filesystem and kernel in Nand. The log is displayed as shows:

     

    ========================================================================

    sdcard_init

    sdcard_read sdc_src=0x00001000 dst=0x80001248 len=0x00000200 dst + len=0x80001448 *data0=0xA1ACED00 

    flasher_data=0x000A1C00   

    sdcard_read sdc_src=0x000A9C00 dst=0x80001248 len=0x00000200 dst + len=0x80001448 *data0=0x00010000 

    check_pattern_123         

    sdcard_boot

     u-boot  sdcard_read sdc_src=0x000C1C00 dst=0x81080000 len=0x00028000 dst + len=0x810A8000 *data0=0xEA000012 

     kernel  sdcard_read sdc_src=0x00101C00 dst=0x80700000 len=0x00300000 dst + len=0x80A00000 *data0=0x56190527 

     root FS sdcard_read sdc_src=0x004A1C00 dst=0x82000000 len=0x00400000 dst + len=0x82400000 *data0=0x08088B1F 

     

     

    U-Boot 1.3.4 (May 22 2009 - 11:25:39)

     

    I2C:   ready

    DRAM:  128 MB

    NAND:  NAND device: Manufacturer ID: 0x2c, Chip ID: 0xd3 (Micron NAND 1GiB 3,3V 8-bit)

    Bad block table found at page 524224, version 0x01

    Bad block table found at page 524160, version 0x01

    nand_bbt: ECC error while reading bad block table

    NAND device: Manufacturer ID: 0x2c, Chip ID: 0xd3 (Micron NAND 1GiB 3,3V 8-bit)

    Bad block table found at page 524224, version 0x01

    Bad block table found at page 524160, version 0x01

    2048 MiB

    In:    serial

    Out:   serial

    Err:   serial

    Ethernet PHY: GENERIC @ 0x00

    Hit any key to stop autoboot:  0 

    DM365 EVM :>

    DM365 EVM :>

    =============================================================================================

     

    Could you give me some help?

    Thank you

  • I want to boot the EVM only use SD card not NAND flash. I think the filesystem and kernel in SD card are not boot.
  • weidong shi said:

    And then I press the number "1",

    the system go to uboot in Nand and boot the filesystem and kernel in Nand. The log is displayed as shows:

    It is because u-boot default configuration uses NAND. You need to reconfigure u-boot to boot from memory.

     

  • weidong shi said:
    I want to boot the EVM only use SD card not NAND flash. I think the filesystem and kernel in SD card are not boot.

    First of all you need to alter uboot, if it hangs searching nand. Then you need configure the kernel to boot from SD. I had some problems mounting root FS on SD and gave up.

  • Hi Constantine,

    Thanks for developing such a nice handy flash utility. I am facing some issue with particular scenario:

    I am using DM365-EVM Silicon ver 1.1. Using this SD card utlity I have successfully flashed NAND MT29F16G08FAA-WC-A which comes with EVM board. However on our DM365 based (It will be higher than silicon ver 1.2) custom board we are planning to use NAND MT29F16G08DAA-WP-WT-A.

    As to finalize the flashing mechanism for our custom board I am trying to flash NAND MT29F16G08DAA-WP-ET-A on DM365-EVM silicon rev1.1 (I dont have silicon ver higher than 1.2). The NAND is flashed successfully without any error, but the EVM does not boot from NAND.

    I have tried to boot using SD card and it works fine.

    I have already gone throug verious posts related to DAA NAND part issue on silicon version 1.1 but it is not clear to me whether silicon version and your utility supports DAA part or not.

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/99/t/34519.aspx

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/100/p/7689/30540.aspx#30540

    Can you please suggest me what can be the possible resons for this. Do I need to modify the utlity. If yes what part needs to be modified?

    Thanks in advance!!

     

    Regards,

    Krunal

  • Hi Krunal,

    booting from specific NAND depends solely from RBL and HW revision.

    Flashing utility uses flash_utils from TI to flash. File ./flash_utils/DM35x/Common/src/device_nand.c have table DEVICE_NAND_CHIP_infoTable with NAND types and parameters.
    There is nothing to do more with flashing tool if it already flashes.