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.

DM365EVM SD Card Boot Fail

Hi,

I followed the DVSDK v4.02 DM365 Software Developers Guide to create an SD card.
After the SD card insertion and power on, I don't see any message from the EVM on a console.

Could you please help me what should I do?

Thanks in advance for your cooperation

P.S.
I can run the pre-installed application under TFTP boot & NFS file system.

Best regards,
j-breeze

  • Hi,

    for the SD card boot mode the ubl and the bootloader must be present in the SD card. you need to flash them on SD card there is tool for flashing it.

    0068.uflash.txt
    ELF�4p14 (44�4�44�4���d!d!/��P� / � ���HH�H�DDQ�tdR�td/����/lib/ld-linux.so.2GNUGNUҜB�i��$��P���!'�w�
    
    	#&")��K��9����<�b )�N���U}[�G;A~w�6p��D��`����__gmon_start__libc.so.6_IO_stdin_used__printf_chkexitfopenftellstrlenmemsetfseekgetopt__fprintf_chkstdoutlseekfclosestrtouloptargstderrfread__ctype_toupper_locstrerror__libc_start_mainwriteGLIBC_2.1GLIBC_2.3GLIBC_2.3.4GLIBC_2.0ii
    �ii
    �ti	�ii
    ��`������������� �	$�
    (�,�0�
    4�8�<�@�D�H�L�P�U��S���[�Ì9��������t�N���XX[���5���%���%�h������%�h������%�h������%�h�����%�h �����%�h(�����%�h0�����%�h8�p����% �h@�`����%$�hH�P����%(�hP�@����%,�hX�0����%0�h`� ����%4�hh�����%8�hp�����%<�hx������%@�h�������%D�h�������%H�h�������%L�h������%P�h�����1�^����PTRhp�h��QVhP��������������������U��S���=��u?������������9�s�������������9�r������[]Ít&��'U�������t���t	�$����Ð��������������,�\$$�t$(���D$H��$��������t8�D$�D$�$�Q����$�����$���O�����\$$�t$(��,á���$�����t$������D$K��D$�D$����$�z���빍���W��VS�Ã� �D$H��$�"�������u'��v�D$�D$���$�\���=�vQ�t$�D$�D$�$��������~E=�w��)����T$�D$�$����딍t&�$����������� [^_Ít&�4$�D����� 1�[^_á���$�����|$�D$d��D$�D$�`��$�y������뭐��&U����WVS��4�}�D$$�D$ ��E�D$���|$�$�����������?��7w��$�h�f�����Ǎ�&������봍t&�5��1ۉ5����W���ރ�������5���4$������9�w׉t$�D$��$������Z���f�����D$�D$�$�7����D$ �2���f�����D$�D$�$�����D$$�
    ���f��������������������������D${��$�@����D$���D$���$�$����D$���D$И�$�����D$���D$���$������D$$��$������D$��D$��D$X��$�����D$��D$��D$���$�����D$���$�|���1���4[^_��]Ít&�����Ɨ���u�L$ ��u�D$ ��T$$���E�	�ƿ̗�u�|$ ��u�D$ ��t$$�������D$�$�������D$�'�L$�D$�D$���$�������J�=�����5����Ɨ��D$(����8�u,����c������N��������D$(��������7��������
    ���1Ҁ���D$,��������������	����	������	Å����
    ���Ɨ�L$�t$������(��҅����D$,��	�D$,���1������Ɨ���f���D$$�t$�����D$,�������/�D$(1���	���������L$ ���
    ��������D$ț�$�D$�L�������D$��$�D$�/�������D$��$�D$��������D$(��$�D$���������D$H��$�D$�������������5����Ɨ����D$�D$�D$2�$�w����t$�f��D$�D$���4$����=��0����3uա���L$�D$��	�D$�$�!���������M����D$�����D$���$�����D$�$�����1������D$,�L$(�T$�D$����	��	����D$,�C��L$�D$�t$�$����9�T$�~����й����������������L$���u���
    �����D$���D$(��$�P�������D$H��$�D$�3�������D$h��$�D$��������D$���$�D$���������D$���$�D$�����������6�D$��D$�D$�$�����t$��t&�����}�D$�D$���4$����=�wՋL$�$�=��������������t$�	�̗��\���u������D$�$���������������L$��	�D$�\$�$������l����D$$�������D$$�f������D$���$����������D$��1��$�����D$,���t&�|$�w�D$��$��������Q�T$,���|$(������9�)������D$��$�D$�O������~Ӊ��|$(�D$
    ��$�-����T$,���|$(�����.������D$���D$��$��������19�-��P߀�]vȃ����D$��$��������~ϋ|$(���D$���$�����D$,��������D$0��$�������������	�D$�\$�D$h��$�\����K����D$�D$2��$�?������������D$
    ��$� ����]��������������D$��	�D$�D$�$���������D$�R����
    ���L$������D$m��$����������D$�D$��$�����,����D$B��$������������$�C����D$��D$�D$�`��$�2��������D$Y��$�9����'����`��D$���D$�$������t$�D$��`��D$�$������x����D$f��$���������[����D$�D$*�뼡���$�����D$՗�D$�D$�`��$�y����$���������UWVS�L$�D$�t$��t����u}���������y�tG��t&3������3�`�����3�`�����3�`�����3�`���u<���t1Ґ�L��1�����3�`�9�u�[^_]��
    ��1�����3�`���t��u�����]���f�1���R����
    ����������������T$�D$�T$�T$�Љ$�T$���������É���'����������������U��]Ít&��'U��WVS�O��i)�����������������)�����t$1��E�D$�E�D$�E�$��������9�rރ�[^_]Ë$Ð�U��S�������t��f����Ћ���u��[]Ð�U��S���[���(�����Y[��rbFile %s Open Error : %s
    File %s Open Error: %sUsage : uflash [options]
    /dev/mmcblk0UBL.binu-boot.bin?hvd:u:b:l:e:p:DM3XXOMAPL138Device open Error : %s
    Device Read Error : %s
    %08x :     %02x,%c.UBL Size %d
    Invalid U-Boot Size %d
    Writing UBL Signature
    Writing UBL
    error
    Writing U-Boot Signature
    Writing U-Boot
    Done...
    	-d DEVNAME     - Block device Name/Node (%s)
    	-u UBL_FILE    - UBL File Name (%s)
    	-b UBOOT_FILE  - UBoot File Name (%s)
    	-p PLATFORM    - Platform name (DM3XX/OMAPL138)
    	-e UBOOT_ENTRY - UBoot Entry Point(0x%X - for DM3XX, 0x%X - for OMAPL138)
    	-l UBOOT_LOAD  - UBoot Load Address(0x%X - for DM3XX, 0x%X - for OMAPL138)
    ====================Master Boot Record=============
    ===================================================
    First partition starts at %d(%ld)
    Required Blocks %d, Available Blocks %d
    Not enough space left forflashing UBL and U-boot
    Make sure that the First PartitionStarts after %d sectors
    UBL Magic Number        : %08x
    UBL Entry Point         : %08x
    UBL Number of Blocks    : %08x
    UBL Starting Block      : %08x
    UBL Load Address        : %08x
    U-Boot Magic Number     : %08x
    U-Boot Entry Point      : %08x
    U-Boot Number of Blocks : %08x
    U-Boot Starting Block   : %08x
    Load U-Boot Address     : %08x
    ��p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�x�p�h�@�p�p���p�p�p��p�p�p���p�p�p�p������0w,a�Q	��m��jp5�c飕d�2�����y����җ+L�	�|�~-����d�� �jHq���A��}�����mQ���DžӃV�l��kdz�b���e�O\�lcc=��
    �� n;^iL�A`�rqg���<G�K��
    �k�
    ����5l��B�ɻ�@����l�2u\�E�
    ��Y=ѫ�0�&:�Q�Q��aп��!#ijV���������(�_���$���|o/LhX�a�=-f��A�vq�� Ҙ*��q���俟3Ը��x4���	���
    j-=m�ld�\c��Qkkbal�0e�Nb��l{����W���ٰeP�긾�|�����bI-��|ӌeL��Xa�M�Q�:t���0��A��Jו�=m�Ѥ����j�iC��n4F�g�и`�s-D�3_L
    ��|
    �<qP�A'�� �%�hW��o 	�f���a���^���)"����=�Y�
    �.;\���l�� ��������ұt9G��wҝ&���sc�;d�>jm
    �Zjz���	�'�
    ��}D��ң�h���i]Wb��ge�q6l�knv���+ӉZz��J�go߹��ホC��Վ�`���~�ѡ���8R��O�g��gW����?K6�H�+
    �L
    ��J6`zA��`�U�g��n1y�iF��a��f���o%6�hR�w�G��"/&U�;��(���Z�+j�\����1�е���,��[��d�&�c윣ju
    �m�	�?6�grW�J��z��+�{8���Ғ
    �����|!����ӆB������hn�����[&���w�owG��Z�pj��;f\��e�i�b���kaE�lx�
    ���
    �T�N³9a&g��`�MGiI�wn>JjѮ�Z��f�@�;�7S���Ş��ϲG���0򽽊º�0��S���$6к���)W�T�g�#.zf��Ja�h]�+o*7������Z��-��������\�
    ������o@��p�
    ������� ���oD����o���o� �����†҆����"�2�B�R�b�r���������‡҇�GCC: (Ubuntu 4.4.3-4ubuntu5) 4.4.3.symtab.strtab.shstrtab.interp.note.ABI-tag.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rel.dyn.rel.plt.init.text.fini.rodata.eh_frame.ctors.dtors.jcr.dynamic.got.got.plt.data.bss.comment4�4#H�H 1h�h$H����D���o@�@0Np�p�V��^���o�4k���oD�DPz	��� �	����
    �\�\0����`������@�@ 
     �`�`!��/��/��/� � /����/���/`�T�T0�`�\0� �0\0#0� 6p7	�<64�H�h���@�p���D�	��
    ��\���
    ��@�`���� ���T�`�����(�5 �K��Z��h����t��`�������������P�������������������	`����1�B�U �^T� iy�p����P���� � �@�����.@]mD�|�T��0�'�������`��"3X�@Q�^��Zn\����`������������������\������ږ+P��
    0\�crtstuff.c__CTOR_LIST____DTOR_LIST____JCR_LIST____do_global_dtors_auxcompleted.7021dtor_idx.7023frame_dummy__CTOR_END____FRAME_END____JCR_END____do_global_ctors_auxuflash.cget_file_sizewrite_fileverboseubl_nameplatformdev_nameuboot_namecrc32.ccrc_tableerrno.c_GLOBAL_OFFSET_TABLE___init_array_end__init_array_start_DYNAMICdata_startopen@@GLIBC_2.0strerror@@GLIBC_2.0__libc_csu_fini_startcrc32_no_comp__fprintf_chk@@GLIBC_2.3.4__gmon_start___Jv_RegisterClasses_fp_hw__printf_chk@@GLIBC_2.3.4errno_finiwrite@@GLIBC_2.0memset@@GLIBC_2.0__libc_start_main@@GLIBC_2.0read@@GLIBC_2.0_IO_stdin_used__ctype_toupper_loc@@GLIBC_2.3__data_startcrc32readbuffseek@@GLIBC_2.0fclose@@GLIBC_2.1getopt@@GLIBC_2.0stderr@@GLIBC_2.0strtoul@@GLIBC_2.0strlen@@GLIBC_2.0fopen@@GLIBC_2.1__dso_handleftell@@GLIBC_2.0__DTOR_END____libc_csu_initclose@@GLIBC_2.0__bss_startcrc32_wduboot_signature_endstdout@@GLIBC_2.0lseek@@GLIBC_2.0optarg@@GLIBC_2.0fread@@GLIBC_2.0_edataubl_signatureexit@@GLIBC_2.0__i686.get_pc_thunk.bxmain_init
    rename it uflash and use it.
    First you need to completely format you SD card(with no partitions if you want to create any partition leave a space from starting say of about 1 MB for UBL and boot loader). then use this too for flashing the ubl and booloader . here is the ubl for SD MMC
    0243.UBL_DM36x_SDMMC.bin.txt
    1���1	��8����	�4��4��4 ��R�� B�B!����� R����������� (D�/������������)����#������
    �����П��M�������/�Hʟ���8��<��@��D������ �������/�8@-�J�����P�� ���������4�����0 ����U�����������
    �
    ��8�����8���8@-�I��P�����	�� �����������	�� ��������8����C-�p��`�� ��|	��|������`���D���p	�����\��������	������P�K��P�P�U�
    	�������0	��0�� �����D���@T���
    ������
    �������+���T�P��������ȟ�8����8��!����<����<��!����@����@��!����D����D��!�������@-�?�������������@-�@���@
    ���h���� ����� ��8������
    �������0���\�0��������Ơ���������,Ơ��������� ���������,à�������������"�������#���� ���$�������%���� ���&������'��������������,Š���*����������@-�@��
    ���T���� ��@��� ����\�
    4�� ����7��� ��
    ��������Ġ���\�
    \�
    ����������8@-�X��K���� ����!���P��8������� �����P�@Dt���8����@-�4��P����U�̠�@��V�,���P��P����0P�����\���p������0��p�� f��+P�������������������������0������������
    ������������Ƞ�,ɠ������������������������ ��	���������P�9������
    �����P�2
    |����� ��������P�*��!������\�	
    ����� ������P�D��,Ƞ��������`������� �����P���&���P�
    ��i���P����
    
    \��������������������������������/����/��O-�D�����t�������ᩂ���������`�����������������������p��P��U�,�����	\���� �����������\�,������E�|�
    ��������
    pW�P����������A-�@���S��`��,��������p��ʠ��� ��,ʠ�������!��r��,��`���P�
    +���, ����\�0��0�6<������P�
    ��������ϰ����
    ����� �@-���@3�
    @L���T�
    �������������
    ���( ���\� ����������!��^�����������A-��B��p��`�����t���P������ ������!��#���P�!�������U��
    ʠ�,ʠ������������������� ����������������+�����\�0���6����P��������P�
    �����d����hŸ���������\����������A-�@������p�����`��0���,���Q��6̠��V��� ����� �� �� ��!���������P�
    +����� ��\�0��0�7<���3���@��d���T�
    ��������ϰ����
    ����� ������������A-� A��P��`�����t���p������ ������!�����P�8����0���7�����,������������������������������������������+������\��0�� ��6�����P�����D���P����g�����������ϰ����L�������\��������������� ��|���P��������������7)�����@	
    �$D �@B����**��"�����'P�������������ȟ�������������� ���(���ϰ����������\�����/�_��������x(��@-�R�����������������������\�:����Dȟ�����<����������������������������������_ˠ�������������/��ǟ�@-����ϰ���������_ˠ�������������ǟ����������������qnj���������������/��@-�'������d7��@��Q��
    Q�3�2��/�&������P��P�`@��`��q��p��q��`V�P���P���� A��(Q��_�����P�@�	���a��P��P�U����P������������Q���������@-�qG��	̄�������ɔ����Ʉ�ɔ�Ʉ�ɔ� ���Ʉ�ɔ������Ʉ��ɔ�K�����Ʉ��ɔ����Ʉ�Q���Ʉ�\Ɵ�	��Ʉ�GȠ�Ʉ�FȠ�Ʉ�Š�Ʉ�AȠ�Ʉ�4Ɵ�(	��Ʉ�,Ɵ�,��Ʉ� Ʉ�`�� ��dɄ�h��l	����p	��K��tɄ�s����K��8Ʉ�o�������|����ɔ������Ʉ����@-�qG��
    ̄�������͔����̈́�͔�̈́�͔� ���̈́�͔�2�����̈́�S�͔�K�����̈́�N�͔�T�����̈́�c���̈́�ɠ�
    ��(̈́�GȠ�̈́�FȠ�̈́�Š�̈́�AȠ�̈́�,ş�̈́�ş�̈́� ̈́�ş�`̈́����d
    ����8̈́�1�������|�������+�͔����̈́��ğ���H���������p@-�4����(A���D����A��Q�����R�p��p��`��`��`��`�� ����� ���(������������R����p����@-��Xt������U�P������Q�@E�Q�@�������@-� ����
    ������qǠ���t���t��t��
    ��t��t��	�t����
    ���t��t�������t������ ����
    ����� ��
    �������� ������#���� ��#�� ��#�� ������� ������������ ����
    ����� ��
    ����������\������T����`����`��D�������/�8@-�P��0C��d��0P���
    ���4P���� ������$�����P������������Ÿ�P��0���8������Ÿ��� ���� ��D ��$��������������/���Ÿ���$��0��������$�� ��$���/�p@-�Ÿ�`��@��P�� `��$@��@��@��P��P��P��P��x���Q������qǠ���L"��@�������������~�������� ��z���'������v�������"��r�����8���������Ġ�D������@������@��
    T���@��
    ����@������@������@������@��9�����p�������������/�x������ ���/�h�����������8����� ���$�������/�@��������/�0����������������$����@�� ����$���/�@-��@��$����� ��������������������(���ΰ����$������ ���$���������D�������>Y��������������?$'?���@@2HS2�S�S#=#�!$2J�2JSg�@@����'���UUUUUUp����������������Q�
    P��2���:P���/�Q��A-����
    �����������P��r���P��@�������� `����V�P�����P��������@T����P����������@-����� ��
    0��0��	\����0��� R����A��������
    ����������C-�p��������\����,R�
    @��e������`�^���V�P�����P����������������������Y�
    \�@�
    ���@��T����:������@-�̠� ��
    �������������O-�P�$�M����
     Q��4
    �������P�����X��� ������pA����`�� @��,��������%���Y�P�����P�����������0@�P������	P��@��'@�������
    �����J����@T����`�����PU������$Ѝ����Q��A-����
    L������I���P�hp�
    P��@���������`�����V�P�����P������������\����@T�P�����������P��/��P�����/��������/��������/�����������!������R��3�/1�!������ �������/�@-�0������S��������0S���������R����@-�
    ����0� R�0.�1��,�#������� ���������R�Ƞ�@-�,Ƞ�
    ����0� R�0.�0��0��L�#�������Ƞ�,Ƞ������0��@-���� ���A�@�0S�Ό��� �����������A-�`��p�������������P��L��ϰ�@� ��@(������PU����`��V������:����A-�P��`��p�������������@��(���ǰ��'�������(���������@T�Ƞ�,Ƞ����P��U�������:���H��@-���������@-�8���P�����@����
    �������P����������������������_������������������������P�
    ��������������$��G���������@-����������A�����������������<�/����Aborting...
     initialization passed!
     initialization failed!
    TI UBL Version: �1.50�
    Booting Catalog Boot Loader
    BootMode = SD/MMC 
    SD/MMC Boot failed.
       DONE
    Jumping to entry point at �.
    �D'H�C-�,Q���������� ���@��`��p������p�W�(���,��� ��<�� ���������P������Y�P�������p��P�@�����`������%@�����,��� ������2���P�����������������@��2T�����������@-�0��[���������P�
    ����P�
    ����������Starting SDMMC Copy...
    ���f��H@-� ��3
    �� R�(�� R�$���R� � R���R�� R���R�
    � R���R���P���@ P���@ �P���@ P���@ �P���@ P���@ �P���@ P���@ Q�"$�1���:�� ������@���/�P���@���/��/����@-���� ��
    �����������������@-�@�����������������0x<D������dd`�
    _�KN���$DDM36x�
    rename it till .bin


    Best Regards,
    Prabhakar Lad

  • Prabhakar-san,

    Thank you for your information.

    I replaced original uflash and UBL with your new one in ${DVSDK}/bin/mksdboot.sh script.
    after I execute the script, I got an error message as below.

    ---------------------------------------------------------------------------------------------------------------------
    Executing uflash tool to write ubl and u-boot.bin
    Segmentation fault
    Failed to execute uflash
    ---------------------------------------------------------------------------------------------------------------------

    The below is the complete script log. I don't know what should I do.
    Could you please let me know what I should do next.

    ---------------------------------------------------------------------------------------------------------------------
    ************************************************************
    *         THIS WILL DELETE ALL THE DATA ON /dev/sdb        *
    *                                                          *
    *         WARNING! Make sure your computer does not go     *
    *                  in to idle mode while this script is    *
    *                  running. The script will complete,      *
    *                  but your SD card may be corrupted.      *
    *                                                          *
    *         Press <ENTER> to confirm....                     *
    ************************************************************

    unmounting device '/dev/sdb1'
    unmounting device '/dev/sdb2'
    1024+0 records in
    1024+0 records out
    1048576 bytes (1.0 MB) copied, 3.74596 s, 280 kB/s
    Disk /dev/sdb doesn't contain a valid partition table
    Checking that no-one is using this disk right now ...
    OK

    Disk /dev/sdb: 954 cylinders, 255 heads, 63 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 = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

       Device Boot Start     End   #cyls    #blocks   Id  System
    /dev/sdb1         80     119      40     321300    b  W95 FAT32
    /dev/sdb2        120     953     834    6699105   83  Linux
    /dev/sdb3          0       -       0          0    0  Empty
    /dev/sdb4          0       -       0          0    0  Empty
    Warning: no primary partition is marked bootable (active)
    This does not matter for LILO, but the DOS MBR will not boot this disk.
    Successfully wrote the new partition table

    Re-reading the partition table ...

    If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)
    to zero the first 512 bytes:  dd if=/dev/zero of=/dev/foo7 bs=512 count=1
    (See fdisk(8).)
    Formating /dev/sdb1 ...
    Formating /dev/sdb2 ...
    mke2fs 1.41.11 (14-Mar-2010)
    Executing mkimage utilty to create a boot.scr file
    Image Name:   Execute uImage
    Created:      Wed Aug 17 17:00:37 2011
    Image Type:   ARM Linux Script (uncompressed)
    Data Size:    365 Bytes = 0.36 kB = 0.00 MB
    Load Address: 0x00000000
    Entry Point:  0x00000000
    Contents:
       Image 0:      357 Bytes =    0 kB = 0 MB
    Copying uImage/boot.scr on /dev/sdb1
    Executing uflash tool to write ubl and u-boot.bin
    Segmentation fault
    Failed to execute uflash
    ---------------------------------------------------------------------------------------------------------------------

    Best regards,
    j-breeze

  • Hi j-breeze,

    what was your command you gave? did you format your SD card completely,after completely formatting your SD card you do the below  if your SD is mounted at say /dev/sdb , the command needed to be given is ,

     ./uflash -d /dev/sdb -u <UBL_DM36x_SDMMC.bin> -b <u-boot.bin> -p <DM3XX>  -e <0x81080000>  -l <0x81080000>



    Best Regards,
    Prabhakar Lad

  • 2388.mksdboot.txt
    #! /bin/sh
    # Script to create SD card for DM365 plaform.
    #
    # Author: Brijesh Singh, Texas Instruments Inc.
    #
    #         Arnie Reynoso, Texas Insturments Inc.
    #           Update to use uflash utility
    #
    
    VERSION="0.4"
    
    execute ()
    {
        $* >/dev/null
        if [ $? -ne 0 ]; then
            echo
            echo "ERROR: executing $*"
            echo
            exit 1
        fi
    }
    
    version ()
    {
      echo
      echo "`basename $1` version $VERSION"
      echo "Script to create bootable SD card for DM365 EVM"
      echo
    
      exit 0
    }
    
    usage ()
    {
      echo "
    Usage: `basename $1` [options] <sdk_install_dir> <device>
    
    Mandatory options:
      --device              SD block device node (e.g /dev/sdd)
      --sdk                 Where is sdk installed ?
    
    Optional options:
      --version             Print version.
      --help                Print this help message.
    "
      exit 1
    }
    
    # Process command line...
    while [ $# -gt 0 ]; do
      case $1 in
        --help | -h)
          usage $0
          ;;
        --device) shift; device=$1; shift; ;;
        --sdk) shift; sdkdir=$1; shift; ;;
        --version) version $0;;
        *) copy="$copy $1"; shift;;
      esac
    done
    
    test -z $sdkdir && usage $0
    test -z $device && usage $0
    
    if [ ! -d $sdkdir ]; then
       echo "ERROR: $sdkdir does not exist"
       exit 1;
    fi
    
    if [ ! -f $sdkdir/filesystem/dvsdk-dm365-evm-rootfs.tar.gz ]; then
      echo "ERROR: failed to find rootfs $sdkdir/filesystem/dvsdk-dm365-evm-rootfs.tar.gz"
      exit 1;
    fi
     
    if [ ! -b $device ]; then
       echo "ERROR: $device is not a block device file"
       exit 1;
    fi
    
    echo "************************************************************"
    echo "*         THIS WILL DELETE ALL THE DATA ON $device        *"
    echo "*                                                          *"
    echo "*         WARNING! Make sure your computer does not go     *"
    echo "*                  in to idle mode while this script is    *"
    echo "*                  running. The script will complete,      *"
    echo "*                  but your SD card may be corrupted.      *"
    echo "*                                                          *"
    echo "*         Press <ENTER> to confirm....                     *"
    echo "************************************************************"
    read junk
    
    for i in `ls -1 $device?`; do
     echo "unmounting device '$i'"
     umount $i 2>/dev/null
    done
    
    execute "dd if=/dev/zero of=$device bs=1024 count=1024"
    
    # get the partition information.
    total_size=`fdisk -l $device | grep Disk | awk '{print $5}'`
    total_cyln=`echo $total_size/255/63/512 | bc`
    
    # start from cylinder 20, this should give enough space for flashing utility
    # to write u-boot binary.
    pc1_start=20
    pc1_end=10
    
    # start of rootfs partition
    pc2_start=$(($pc1_start + $pc1_end))
    
    # calculate number of cylinder for the second parition
    if [ "$copy" != "" ]; then
      pc2_end=$((($total_cyln - $pc1_end) / 2))
      pc3_start=$(($pc2_start + $pc2_end))
    fi
    
    {
    if [ "$copy" != "" ]; then
     echo $pc1_start,$pc1_end,0x0B,-
     echo $pc2_start,$pc2_end,,-
     echo $pc3_start,,-
    else
      echo $pc1_start,$pc1_end,0x0B,-
      echo $pc2_start,,-
    fi
    } | sfdisk -D -H 255 -S 63 -C $total_cyln $device
    
    if [ $? -ne 0 ]; then
        echo ERROR
        exit 1;
    fi
    
    echo "Formating ${device}1 ..."
    execute "mkfs.vfat -F 32 -n "BOOT" ${device}1"
    echo "Formating ${device}2 ..."
    execute "mke2fs -j -L "ROOTFS" ${device}2"
    if [ "$copy" != "" ]; then
      echo "Formating ${device}3 ..."
      execute "mke2fs -j -L "START_HERE" ${device}3"
    fi
    
    # creating boot.scr
    execute "mkdir -p /tmp/sdk"
    cat <<EOF >/tmp/sdk/boot.cmd
    mmc rescan 0
    setenv bootargs 'console=ttyS0,115200n8 root=/dev/mmcblk0p2 rw ip=off mem=54M video=davincifb:vid0=OFF:vid1=OFF:osd0=720x576x16,4050K dm365_imp.oper_mode=0 davinci_capture.device_type=4 vpfe_capture.cont_bufsize=6291456 davinci_enc_mngr.ch0_output=COMPONENT davinci_enc_mngr.ch0_mode=480P-60 rootwait'
    fatload mmc 0 80700000 uImage
    bootm 80700000
    EOF
    
    echo "Executing mkimage utilty to create a boot.scr file"
    mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n 'Execute uImage' -d /tmp/sdk/boot.cmd /tmp/sdk/boot.scr
    
    if [ $? -ne 0 ]; then
      echo "Failed to execute mkimage to create boot.scr"
      echo "Execute 'sudo apt-get install uboot-mkimage' to install the package"
      exit 1
    fi
    
    echo "Copying uImage/boot.scr on ${device}1"
    execute "mkdir -p /tmp/sdk/$$"
    execute "mount ${device}1 /tmp/sdk/$$"
    execute "cp /tmp/sdk/boot.scr /tmp/sdk/$$/"
    execute "cp /tmp/sdk/boot.cmd /tmp/sdk/$$/"
    execute "cp $sdkdir/psp/prebuilt-images/uImage*.bin /tmp/sdk/$$/uImage"
    #execute "cp $sdkdir/bin/top_emv365_evm.png /tmp/sdk/$$/"
    #execute "cp $sdkdir/bin/windows_users.htm /tmp/sdk/$$/"
    #execute "cp $sdkdir/bin/README.boot.scr /tmp/sdk/$$/"
    sync
    execute "umount /tmp/sdk/$$"
    
    FILE=$sdkdir/psp/u-boot-*/tools/uflash/uflash
    if [ -f $FILE ]; then
      echo "Executing uflash tool to write ubl and u-boot.bin"
      $sdkdir/psp/u-boot-*/tools/uflash/uflash -d ${device} -u ${sdkdir}/psp/board_utilities/serial_flash/dm365/UBL_DM36x_SDMMC.bin -b ${sdkdir}/psp/prebuilt-images/u-boot-dm365-evm.bin -vv
    else 
      echo "uflash utility not found, u-boot must be built prior to running script"
      echo "From the $sdkdir directory run: make u-boot"
      exit 1
    fi
    
    if [ $? -ne 0 ]; then
      echo "Failed to execute uflash"
      exit 1
    fi
    
    echo "Extracting filesystem on ${device}2 ..."
    execute "mkdir -p /tmp/sdk/$$"
    execute "mount ${device}2 /tmp/sdk/$$"
    execute "tar zxf $sdkdir/filesystem/dvsdk-dm365-evm-rootfs.tar.gz -C /tmp/sdk/$$"
    
    # check if we need to create symbolic link for matrix 
    echo -n "Creating matrix-gui-e symbolic link..."
    if [ -f /tmp/sdk/$$/etc/init.d/matrix-gui-e ]; then
      if [ -h /tmp/sdk/$$/etc/rc3.d/*matrix* ]; then
        echo " (skipped) "
      else
        ln -s  ../init.d/matrix-gui-e /tmp/sdk/$$/etc/rc3.d/S99matrix-gui-e
        ln -s  ../init.d/matrix-gui-e /tmp/sdk/$$/etc/rc5.d/S99matrix-gui-e
        echo "done"
      fi
    fi
    
    sync
    echo "unmounting ${device}2"
    execute "umount /tmp/sdk/$$"
    
    if [ "$copy" != "" ]; then
      echo "Copying $copy on ${device}3 ..."
      execute "mount ${device}3 /tmp/sdk/$$"
      execute "cp -ar $copy /tmp/sdk/$$"
    #  execute "cp $sdkdir/bin/setup.htm /tmp/sdk/$$"
    #  execute "cp $sdkdir/bin/top_dm365_evm.png /tmp/sdk/$$/"
    #  execute "cp $sdkdir/docs/DM365_EVM_Quick_Start_Guide.pdf /tmp/sdk/$$/quickstartguide.pdf"
      sync
      echo "unmounting ${device}3"
      execute "umount /tmp/sdk/$$"
    fi
    
    execute "rm -rf /tmp/sdk/$$"
    echo "completed!"
    
    
    Hi Prabhakar-san,

    Thank you for your quick response.

    I tryed the uflash command you gave and uflash was done!
    However, can not boot from the SD card and still  don't see any message from the EVM on a console.

    I think that SD card is formated completely in the script. I would like to attach the original one.
    If you don't mind could you please check it if  formatting completely or not.

    Thanks in advance for your cooperation.

    Best regards,
    j-breeze

  • Hi j-breeze ,


    you  can format the SD card manually by using fdisk command.
    for example is you SD card is at /dev/sdb
    do the following: sudo fdisk /dev/sdb

    Command (m for help): d

    Selected partition 1

    .......

    .

    .

    ..go on doing this till you get : No partitions available

     

    Command (m for help): d

    No partition is defined yet!

     

    Command (m for help): n

    Command action

       e   extended

       p   primary partition (1-4)

    p

    Partition number (1-4): 1

    First cylinder (1-1015, default 1): 50

    Last cylinder or +size or +sizeM or +sizeK (50-1015, default 1015):

    Using default value 1015

     

    Command (m for help): x

     

    Expert command (m for help): c

    Number of cylinders (1-1048576, default 1015):

    Using default value 1015

     

    Expert command (m for help): w

    The partition table has been altered!

     

    Calling ioctl() to re-read partition table.

    Syncing disks.

     

     

    then do the following :

    :sudo fdisk /dev/sdb

     

    Command (m for help): p

     

    Disk /dev/sdc: 1967 MB, 1967128576 bytes

    61 heads, 62 sectors/track, 1015 cylinders

    Units = cylinders of 3782 * 512 = 1936384 bytes

    Disk identifier: 0x00000000

     

       Device Boot      Start         End      Blocks   Id  System

    /dev/sdc1              50        1015     1826706   83  Linux

     

    Command (m for help): w

    The partition table has been altered!

     

    Calling ioctl() to re-read partition table.

    Syncing disks.

     

    later do

    sudo mkfs.ext3 /dev/sdb1

     

     

    After doing the above you run this command:

    ./uflash -d /dev/sdb -u <UBL_DM36x_SDMMC.bin> -b <u-boot.bin> -p <DM3XX>  -e <0x81080000>  -l <0x81080000>

  • Hi Prabhakar-san,

    I appreciate your kindly support. I've done!

    Best regards,
    j-breeze

  • I follow the all steps give her. But I am not able to prepare sd card. uflash is giving segmentation fault.
    Please find bellow log and please help.


    vaibhav@CPU-194:~/home/dm365_low_latency_camera/Reference/SDFlash/sd_final$ sudo ./mksdboot_vaibhav.sh --device /dev/sdc --sdk .
    ************************************************************
    * THIS WILL DELETE ALL THE DATA ON /dev/sdc *
    * *
    * WARNING! Make sure your computer does not go *
    * in to idle mode while this script is *
    * running. The script will complete, *
    * but your SD card may be corrupted. *
    * *
    * Press <ENTER> to confirm.... *
    ************************************************************

    unmounting device '/dev/sdc1'
    1024+0 records in
    1024+0 records out
    1048576 bytes (1.0 MB) copied, 0.345 s, 3.0 MB/s

    WARNING: GPT (GUID Partition Table) detected on '/dev/sdc'! The util fdisk doesn't support GPT. Use GNU Parted.

    Disk /dev/sdc doesn't contain a valid partition table
    Checking that no-one is using this disk right now ...
    OK

    Disk /dev/sdc: 966 cylinders, 255 heads, 63 sectors/track

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

    Device Boot Start End #cyls #blocks Id System
    /dev/sdc1 20 29 10 80325 b W95 FAT32
    /dev/sdc2 30 965 936 7518420 83 Linux
    /dev/sdc3 0 - 0 0 0 Empty
    /dev/sdc4 0 - 0 0 0 Empty
    Warning: no primary partition is marked bootable (active)
    This does not matter for LILO, but the DOS MBR will not boot this disk.
    Successfully wrote the new partition table

    Re-reading the partition table ...

    If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)
    to zero the first 512 bytes: dd if=/dev/zero of=/dev/foo7 bs=512 count=1
    (See fdisk(8).)
    Formating /dev/sdc1 ...
    Formating /dev/sdc2 ...
    mke2fs 1.42 (29-Nov-2011)
    Executing mkimage utilty to create a boot.scr file
    Image Name: Execute uImage
    Created: Wed Dec 17 19:09:02 2014
    Image Type: ARM Linux Script (uncompressed)
    Data Size: 368 Bytes = 0.36 kB = 0.00 MB
    Load Address: 00000000
    Entry Point: 00000000
    Contents:
    Image 0: 360 Bytes = 0.35 kB = 0.00 MB
    Copying uImage/boot.scr on /dev/sdc1
    Executing uflash tool to write ubl and u-boot.bin
    ./mksdboot_vaibhav.sh: line 180: 24733 Segmentation fault (core dumped) $sdkdir/uflash -d ${device} -u ${sdkdir}/UBL_DM36x_SDMMC.bin -b ${sdkdir}/u-boot-dm365-evm.bin -vv
    Failed to execute uflash
    vaibhav@CPU-194:~/home/dm365_low_latency_camera/Reference/SDFlash/sd_final$