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.

Howto download program bin to empty IPNC36X from sd card?

Hi, everyone,

I read the article "SD card boot and flashing tool for DM355", but It is so simple, I still don't know howto do.  It say,

4. copy boot data to SD card from regular user (not root):

$ make install
or 
$ ./dm3xx_sd_boot data [/media/disk/dm3xx.dat]
What is "boot data"? Where is it from? It contains what? Howto orgnizte or format the data? 
For IPNC36X, I just want to pack uboot, linux kernel, rootfs all in one binary file, copy it to sd card with a sd card flash writer, boot ipnc in sd mode, then the sd card flash writer flash my binary file to nand autoly.
I don't like to waste time for the source code of the dm3xx_sd_boot. I only need use it.

  • Default configuration of the utility installs binaries of evaluation demo. For IPNC you need to edit config file. Please read carefully manual without panic.

  • Just to add to above point.

    In IPNC 2.5 Release we have attached latest Package for IPNC DM36x SD boot with updated binaries. The package contains 'sd_boot_readme.txt' which gives you procedure of how to update the SDCard appropriately.

  • Hello Mathew,

    I've faced with the following problem - I'm trying to prepare bootable SD card to restore DM368 IPNC. Going through steps documented in the IPNC User Guide, part 2.2.2 (Updating UBL, U-boot and Diagnostic file using SDCARD) I see error messages in the log like "Failed to copy boot record...".

    Please see below the log (I didn't put steps for make and export commands here, they are OK):

    ubuntu@ubuntu-laptop:~/workdir/IPNC_src/Utils/dm3xx_sd_boot-6.1$ sudo ./dm3xx_sd_boot format /dev/sdb
    cleaning SD card
    1000+0 records in
    1000+0 records out
    1024000 bytes (1.0 MB) copied, 0.425341 s, 2.4 MB/s

    Disk /dev/sdb: 1015 cylinders, 61 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-     41601+   b  W95 FAT32
    /dev/sdb2   *    40+  1874-  1834-   1877763   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.7 (24 Dec 2009)
    Seek to 1733196800:Invalid argument
    0+0 records in
    0+0 records out
    0 bytes (0 B) copied, 2.7099e-05 s, 0.0 kB/s
    0+1 records in
    0+1 records out
    19 bytes (19 B) copied, 3.7644e-05 s, 505 kB/s
    total 15000
    -rwxr-xr-x 1 root root 15360000 2011-03-18 12:31 dm3xx.dat
    SD card /dev/sdb formatted
    10000+0 records in
    10000+0 records out
    10240000 bytes (10 MB) copied, 0.552774 s, 18.5 MB/s
    dm3xx_boot_data_addr=0x0a4400
    ./dm3xx_sd_boot: line 64: bin.x86/dm3xx_boot_make_image: Permission denied
    Failed to copy boot record to SD card
    Please reinsert the card for auto mounting or mount it manually
    ubuntu@ubuntu-laptop:~/workdir/IPNC_src/Utils/dm3xx_sd_boot-6.1$ cat /proc/partitions
    major minor  #blocks  name

       8        0  244198584 sda
       8        1  238163593 sda1
       8        2          1 sda2
       8        5    6032376 sda5
       8       16    1921024 sdb
       8       17      41601 sdb1
       8       18    1877763 sdb2
    ubuntu@ubuntu-laptop:~/workdir/IPNC_src/Utils/dm3xx_sd_boot-6.1$ sudo umount /dev/sdb1
    ubuntu@ubuntu-laptop:~/workdir/IPNC_src/Utils/dm3xx_sd_boot-6.1$ sudo umount /dev/sdb2
    umount: /dev/sdb2: not mounted
    ubuntu@ubuntu-laptop:~/workdir/IPNC_src/Utils/dm3xx_sd_boot-6.1$ mount /dev/sdb1 /media/disk
    mount: only root can do that
    ubuntu@ubuntu-laptop:~/workdir/IPNC_src/Utils/dm3xx_sd_boot-6.1$ sudo mount /dev/sdb1 /media/disk
    ubuntu@ubuntu-laptop:~/workdir/IPNC_src/Utils/dm3xx_sd_boot-6.1$ sudo make install
    ./dm3xx_sd_boot data
    copying data to
    ./dm3xx_sd_boot: line 125: bin.x86/dm3xx_boot_make_image: Permission denied
    failed to build data image
    ubuntu@ubuntu-laptop:~/workdir/IPNC_src/Utils/dm3xx_sd_boot-6.1$ sudo ./dm3xx_sd_boot data /media/disk/
    copying data to
    ./dm3xx_sd_boot: line 125: bin.x86/dm3xx_boot_make_image: Permission denied
    failed to build data image
    ubuntu@ubuntu-laptop:~/workdir/IPNC_src/Utils/dm3xx_sd_boot-6.1$

    Could you please advise what could be wrong here?

    Best regards,

    Ilya

  • Ilya,

    Could you please share the dm3xx_sd.config file. Also could you check if you first format the Card using HP USB Disk Storage Format Tool and then try once more. It does not seem to have partitioned correctly. Also could you try mounting /dev/sdb partition instead of /dev/sdb1 to /media/disk

    Thanks,

    Anith

     

  • Anith,

    Please have a look at the attached file.

    I tried to format SD card with HP USB Disk Storage Format tool, as well as with fdisk. Both ways don't work, still the same problem.

    Regarding mount - the script partitions SD-card to two parts, one FAT32 and another one - Linux (though it  looks like that it was formatted incorrectly and I then manually formatted it to ext3).

     

    Best regards,

    Ilya

  • I have also encountered the sd card format fail, the log as following,

     

    [root@localhost dm3xx_sd_boot-6.1]# ./dm3xx_sd_boot format /dev/sdb1
    cleaning SD card
    1000+0 records in
    1000+0 records out
    1024000 bytes (1.0 MB) copied, 0.00250123 s, 409 MB/s
    BLKRRPART: Invalid argument
    Failed to format SD card
    10000+0 records in
    10000+0 records out
    10240000 bytes (10 MB) copied, 0.868302 s, 11.8 MB/s
    dm3xx_boot_data_addr=0x
    Image dm3xx_boot_rec:please define dm3xx_boot_data_addr
    10000+0 records in
    10000+0 records out
    10240000 bytes (10 MB) copied, 0.08996 s, 114 MB/s
    dm3xx boot record is written
    Please reinsert the card for auto mounting or mount it manually
    [root@localhost dm3xx_sd_boot-6.1]# sh -x ./dm3xx_sd_boot format /dev/sdb1
    + 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/' -e 's/x86.*/x86/'
    + arch=x86
    + export PATH=/usr/lib/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib/ccache:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/jre1.6.0_23/bin:/opt/cmake-2.8.3-Linux-i386/bin:/opt/mv_pro_4.0/montavista/pro/devkit/arm/v5t_le/bin:/opt/mv_pro_4.0/motavista/pro/bin:/opt/mv_pro_4.0/montavista/common/bin:/root/bin:bin.x86
    + PATH=/usr/lib/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib/ccache:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/jre1.6.0_23/bin:/opt/cmake-2.8.3-Linux-i386/bin:/opt/mv_pro_4.0/montavista/pro/devkit/arm/v5t_le/bin:/opt/mv_pro_4.0/motavista/pro/bin:/opt/mv_pro_4.0/montavista/common/bin:/root/bin:bin.x86
    + . ./dm3xx_sd.config
    ++ a=DM36x
    ++ case $platform in
    ++ 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/*/dm3xx.dat'
    ++ data_file='/media/*/dm3xx.dat'
    ++ ls sdcard_flash/sdcard_flash_DM36x.bin
    + sdboot=sdcard_flash/sdcard_flash_DM36x.bin
    + cmd=format
    + '[' -z format ']'
    + shift
    + sd=/dev/sdb1
    + case "$cmd" in
    + :
    + sdcard_fat /dev/sdb1
    + sd=/dev/sdb1
    + '[' -z /dev/sdb1 ']'
    + test -b /dev/sdb11
    + test -b /dev/sdb1p1
    + sfdisk -s
    + umount /mnt/sdc
    + true
    + umount
    + true
    + printf 'cleaning SD card\n'
    cleaning SD card
    + dd if=/dev/zero of=/dev/sdb1 bs=1024 count=1000
    1000+0 records in
    1000+0 records out
    1024000 bytes (1.0 MB) copied, 0.0215047 s, 47.6 MB/s
    + umount
    + true
    + printf ',40,b,*\n,,,*\n'
    + sfdisk -uM -q /dev/sdb1
    BLKRRPART: Invalid argument
    + echo_failure Failed to format SD card
    + printf '\033[0;31mFailed to format SD card\033[0;39m\n'
    Failed to format SD card
    + return 1
    + return
    + sdcard_dm3xx_boot /dev/sdb1
    + sd=/dev/sdb1
    + '[' -z /dev/sdb1 ']'
    + dm3xx_boot_rec=dm3xx_boot_rec
    + rm -f dm3xx_boot_rec
    + dm3xx_boot_data_addr_get /dev/sdb1
    + '[' -z '' ']'
    + sd=/dev/sdb1
    + '[' -z /dev/sdb1 ']'
    + dd if=/dev/sdb1 of=/tmp/image.fat bs=1024 count=10000
    10000+0 records in
    10000+0 records out
    10240000 bytes (10 MB) copied, 0.975364 s, 10.5 MB/s
    ++ od -A x -t x8 /tmp/image.fat
    +++ echo -n dm3xx_boot_magic
    +++ od -A n -t x8
    ++ cut -f 1 -d ' '
    ++ grep ' 6f625f7878336d64 636967616d5f746f'
    + export dm3xx_boot_data_addr=0x
    + dm3xx_boot_data_addr=0x
    + printf 'dm3xx_boot_data_addr=0x\n'
    dm3xx_boot_data_addr=0x
    + dm3xx_boot_make_image
    Image dm3xx_boot_rec:please define dm3xx_boot_data_addr
    + dd if=dm3xx_boot_rec of=/dev/sdb1 seek=8
    + dd if=/dev/sdb1 of=/tmp/image.fat bs=1024 count=10000
    10000+0 records in
    10000+0 records out
    10240000 bytes (10 MB) copied, 1.32289 s, 7.7 MB/s
    + echo_success dm3xx boot record is written
    + printf '\033[2;32mdm3xx boot record is written\033[0;39m\n'
    dm3xx boot record is written
    + chmod 777 /tmp/image.fat
    + echo Please reinsert the card for auto mounting or mount it manually
    Please reinsert the card for auto mounting or mount it manually
    + set -o allexport

  • ./dm3xx_sd_boot format /dev/sdb1

  • Constantin,

    I've put the command exactly like you mentioned, please have a look couple of post earlier - it gives en error when trying to copy boot data.
    What could be wrong there?

    Best regards,
    Ilya


  • Why

    IlyaChepurin said:
    ./dm3xx_sd_boot: line 64: bin.x86/dm3xx_boot_make_image: Permission denied
    ?

  • That's a good question - this error I get after running dn3xx_sd_boot format command.
    And I wonder what I do wrong.
    The process I do is as follows:
    1. Format 2Gb SD-card to FAT32 (either with HP utility or with fdisk). I also changed the geometry of SD card (255 heads, 63 sectors and 239 cylinders), then formatted to FAT32 (one partition).
    2. Mount SD-card and then run dm3xx_sd_boot (after make and PATH as mentioned in the readme)
    After these two steps I get the log which I shown earlier.
    I tried also two SD-cards, no difference.

    Best regards,
    Ilya

  • IlyaChepurin said:
    I also changed the geometry of SD card

      -- no need.

    IlyaChepurin said:
    That's a good question - this error I get after running dn3xx_sd_boot format command.

    -- the problem in on host, not on SD. Try to recompile that utility with your native (not cross) compiler.

  • I've figured out what was wrong: in the bin.x86 folder I had old dm3xx_boot_make_image binary.
    Don't know why but make clean doesn't delete this file (I guess there is an error in the line rm-f  dm3xx_boot_mke_image - it should point to the right location) and also when I compile the newly compiled doesn't overwrites the old one.
    So I just deleted this file, recompile and now everything works fine.

    BR,
    Ilya

  • Hi Ilya,

     

    Did you succeed to boot from SD on IPNC ???

    I also trying to boot and there's no error to write.

    but after short J2 and boot, nothing happened.

    IPNC doesn't support sd boot?

     

    thank you.

    Jay.

  • Jay, As I've posted before, I've succeded with boot from SD on IPNC. I suggest you look into console and see what goes wrong, may be you have wrong u-boot configuration. BR, Ilya
  • Thank you for your answer. It works!

    Jay.