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.

Linux/TDA2EVM5777: Preparing SD card failed

Part Number: TDA2EVM5777

Tool/software: Linux

Hello,

I am following section 4.2 from the Vision SDK 3.06.00.00 Linux User Guide on Ubuntu 16.04 LTS with a SanDisk 2 GB microSD card that was delivered to us with a TDA2x EVM.

I receive the following console output while executing instruction #4:

sagar@Sagar:~/PROCESSOR_SDK_VISION_03_06_00_00/vision_sdk/build$ sudo ./hlos/scripts/linux/mksdboot.sh --device /dev/mmcblk0p1 --appname apps --makeconfig tda2xx_evm_linux_all
[sudo] password for sagar: 
-- Main device is: /dev/nvme0n1p3
************************************************************
*         THIS WILL DELETE ALL THE DATA ON /dev/mmcblk0p1        *
*                                                          *
*         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....                     *
************************************************************

ls: cannot access '/dev/mmcblk0p1?': No such file or directory
1024+0 records in
1024+0 records out
1048576 bytes (1.0 MB, 1.0 MiB) copied, 0.00369895 s, 283 MB/s

Welcome to fdisk (util-linux 2.27.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x72cb2798.

Command (m for help): Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): Partition number (1-4, default 1): First sector (2048-3858488, default 2048): Last sector, +sectors or +size{K,M,G,T,P} (2048-3858488, default 3858488): 
Created a new partition 1 of type 'Linux' and of size 256 MiB.

Command (m for help): Partition type
   p   primary (1 primary, 0 extended, 3 free)
   e   extended (container for logical partitions)
Select (default p): Partition number (2-4, default 2): First sector (526336-3858488, default 526336): Last sector, +sectors or +size{K,M,G,T,P} (526336-3858488, default 3858488): 
Created a new partition 2 of type 'Linux' and of size 1.6 GiB.

Command (m for help): Partition number (1,2, default 2): Partition type (type L to list all types): 
Changed type of partition 'Linux' to 'W95 FAT32 (LBA)'.

Command (m for help): Partition number (1,2, default 2): 
The bootable flag on partition 1 is enabled now.

Command (m for help): The partition table has been altered.
Calling ioctl() to re-read partition table.
Re-reading the partition table failed.: Invalid argument

The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8).

Press enter to continue.
./hlos/scripts/linux/mksdboot.sh: 156: read: arg count
Formating /dev/mmcblk0p11 ...
Cant find boot partition in /dev
mke2fs 1.42.13 (17-May-2015)
The file /dev/mmcblk0p1p2 does not exist and no size was specified.
Copying filesystem on /dev/mmcblk0p11,/dev/mmcblk0p12
mount: special device /dev/mmcblk0p11 does not exist

ERROR: executing mount /dev/mmcblk0p11 /tmp/sdk/4580/boot

sagar@Sagar:~/PROCESSOR_SDK_VISION_03_06_00_00/vision_sdk/build$

Please advise on how to resolve this problem. Thank you.

  • Hi Sagar,

    do you use a laptop with a built-in card reader? Can you try with external card reader (your SD card should appear ad '/dev/sdX'), there was a similar thread:

    e2e.ti.com/.../2824446

    Regards,
    Yordan
  • Hello Yordan,

    I am using a laptop with a built-in card reader; I do not have an external card reader.

    Regardless of that, the procedure detailed in the guide should work for the in-built card reader too.

    One of my colleagues was able to follow the same instructions and prepare the SD card without any trouble.

    Is there anything else I can try?

    Thank you.

  • Hi Sagar,

    the argument for '--device' should be the parent device, for example with a card reader you could have /dev/sdb as parent (this node should be used) and /dev/sdb0, /dev/sdb1, ... for the partitions on the device. I am not able to try on laptop how sd card are listed in /dev, but I suspect that '/dev/mmcblk0p1' that you use might be the first partition of the card and parent device should be '/dev/mmcblk0'. Can you check if that is the case?

    Regards,
    Yordan
  • Hello,

    I tried executing the script in the way you instructed. The script executed only partially though, with the following console output:

    sagar@Sagar:~/PROCESSOR_SDK_VISION_03_06_00_00/vision_sdk/build$ sudo ./hlos/scripts/linux/mksdboot.sh --device /dev/mmcblk0 --appname apps --makeconfig tda2xx_evm_linux_all
    [sudo] password for sagar: 
    -- Main device is: /dev/nvme0n1p3
    ************************************************************
    *         THIS WILL DELETE ALL THE DATA ON /dev/mmcblk0        *
    *                                                          *
    *         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....                     *
    ************************************************************
    
    ls: cannot access '/dev/mmcblk0?': No such file or directory
    1024+0 records in
    1024+0 records out
    1048576 bytes (1.0 MB, 1.0 MiB) copied, 0.191185 s, 5.5 MB/s
    
    Welcome to fdisk (util-linux 2.27.1).
    Changes will remain in memory only, until you decide to write them.
    Be careful before using the write command.
    
    Device does not contain a recognized partition table.
    Created a new DOS disklabel with disk identifier 0xc628035c.
    
    Command (m for help): Partition type
       p   primary (0 primary, 0 extended, 4 free)
       e   extended (container for logical partitions)
    Select (default p): Partition number (1-4, default 1): First sector (2048-3862527, default 2048): Last sector, +sectors or +size{K,M,G,T,P} (2048-3862527, default 3862527): 
    Created a new partition 1 of type 'Linux' and of size 256 MiB.
    
    Command (m for help): Partition type
       p   primary (1 primary, 0 extended, 3 free)
       e   extended (container for logical partitions)
    Select (default p): Partition number (2-4, default 2): First sector (526336-3862527, default 526336): Last sector, +sectors or +size{K,M,G,T,P} (526336-3862527, default 3862527): 
    Created a new partition 2 of type 'Linux' and of size 1.6 GiB.
    
    Command (m for help): Partition number (1,2, default 2): Partition type (type L to list all types): 
    Changed type of partition 'Linux' to 'W95 FAT32 (LBA)'.
    
    Command (m for help): Partition number (1,2, default 2): 
    The bootable flag on partition 1 is enabled now.
    
    Command (m for help): The partition table has been altered.
    Calling ioctl() to re-read partition table.
    Re-reading the partition table failed.: Device or resource busy
    
    The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8).
    
    Press enter to continue.
    ./hlos/scripts/linux/mksdboot.sh: 156: read: arg count
    Formating /dev/mmcblk01 ...
    mkfs.fat 3.0.28 (2015-05-16)
    mkfs.fat: warning - lowercase labels might not work properly with DOS or Windows
    mkfs.vfat: /dev/mmcblk0p1 contains a mounted filesystem.
    mke2fs 1.42.13 (17-May-2015)
    The file /dev/mmcblk0p2 does not exist and no size was specified.
    Copying filesystem on /dev/mmcblk01,/dev/mmcblk02
    mount: special device /dev/mmcblk01 does not exist
    
    ERROR: executing mount /dev/mmcblk01 /tmp/sdk/5828/boot
    
    sagar@Sagar:~/PROCESSOR_SDK_VISION_03_06_00_00/vision_sdk/build$ 

    I modified the script to mount partitions p1/p2, instead of the regular 1/2. This resulted in the following output:

    sagar@Sagar:~/PROCESSOR_SDK_VISION_03_06_00_00/vision_sdk/build$ sudo ./hlos/scripts/linux/mksdboot.sh --device /dev/mmcblk0 --appname apps --makeconfig tda2xx_evm_linux_all
    [sudo] password for sagar: 
    -- Main device is: /dev/nvme0n1p3
    ************************************************************
    *         THIS WILL DELETE ALL THE DATA ON /dev/mmcblk0        *
    *                                                          *
    *         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....                     *
    ************************************************************
    
    ls: cannot access '/dev/mmcblk0?': No such file or directory
    1024+0 records in
    1024+0 records out
    1048576 bytes (1.0 MB, 1.0 MiB) copied, 0.366632 s, 2.9 MB/s
    
    Welcome to fdisk (util-linux 2.27.1).
    Changes will remain in memory only, until you decide to write them.
    Be careful before using the write command.
    
    Device does not contain a recognized partition table.
    Created a new DOS disklabel with disk identifier 0x5cc72c42.
    
    Command (m for help): Partition type
       p   primary (0 primary, 0 extended, 4 free)
       e   extended (container for logical partitions)
    Select (default p): Partition number (1-4, default 1): First sector (2048-3862527, default 2048): Last sector, +sectors or +size{K,M,G,T,P} (2048-3862527, default 3862527): 
    Created a new partition 1 of type 'Linux' and of size 256 MiB.
    
    Command (m for help): Partition type
       p   primary (1 primary, 0 extended, 3 free)
       e   extended (container for logical partitions)
    Select (default p): Partition number (2-4, default 2): First sector (526336-3862527, default 526336): Last sector, +sectors or +size{K,M,G,T,P} (526336-3862527, default 3862527): 
    Created a new partition 2 of type 'Linux' and of size 1.6 GiB.
    
    Command (m for help): Partition number (1,2, default 2): Partition type (type L to list all types): 
    Changed type of partition 'Linux' to 'W95 FAT32 (LBA)'.
    
    Command (m for help): Partition number (1,2, default 2): 
    The bootable flag on partition 1 is enabled now.
    
    Command (m for help): The partition table has been altered.
    Calling ioctl() to re-read partition table.
    Syncing disks.
    
    Press enter to continue.
    ./hlos/scripts/linux/mksdboot.sh: 156: read: arg count
    Formating /dev/mmcblk01 ...
    mkfs.fat 3.0.28 (2015-05-16)
    mkfs.fat: warning - lowercase labels might not work properly with DOS or Windows
    mkfs.vfat: /dev/mmcblk0p1 contains a mounted filesystem.
    mke2fs 1.42.13 (17-May-2015)
    Creating filesystem with 417024 4k blocks and 104416 inodes
    Filesystem UUID: 20a7e58f-4c4f-4e14-9765-f6157715c9c7
    Superblock backups stored on blocks: 
    	32768, 98304, 163840, 229376, 294912
    
    Allocating group tables: done                            
    Writing inode tables: done                            
    Creating journal (8192 blocks): done
    Writing superblocks and filesystem accounting information: done 
    
    Copying filesystem on /dev/mmcblk01,/dev/mmcblk02
    mount: wrong fs type, bad option, bad superblock on /dev/mmcblk0p1,
           missing codepage or helper program, or other error
    
           In some cases useful info is found in syslog - try
           dmesg | tail or so.
    
    ERROR: executing mount /dev/mmcblk0p1 /tmp/sdk/6727/boot
    
    sagar@Sagar:~/PROCESSOR_SDK_VISION_03_06_00_00/vision_sdk/build$

    I cannot figure out what the problem is. Thank you.

  • Hi Sagar,

    it seems that you had some progress with your modification. I am concerned about first 'ls' error and mkfs.vfat complaining about mounted fs. Can you check also this part of the script:

    for i in `ls -1 $device?`; do
     echo "unmounting device '$i'"
     umount $i 2>/dev/null
    done

    and modify it to:

    for i in `ls -1 $device??`; do
     echo "unmounting device '$i'"
     umount $i 2>/dev/null
    done

    Regards,

    Yordan

  • Hello,

    My issue is resolved.
    It appears that the SD card must be clean formatted on Linux OS in order for the script to work properly.

    Thank you.