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/PROCESSOR-SDK-AM335X: Problems with create-sd.sh

Part Number: PROCESSOR-SDK-AM335X

Tool/software: Linux

Hello,

I was following the instructions in processors.wiki.ti.com/.../Add-wilink8-to-processor-sdk-3.0 website. I was able to build the boot and rootfs tar.xz files after running the build-wilink.sh script. To flash the tar files to sd card, I run the  create-sd.sh script. During the partitioning stage, the partitioning is now done message is shown but later when the script tries to mount the second partition, it fails. The error message is as follows :

mount: wrong fs type, bad option, bad superblock on /dev/sdd2,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so


Also, after the tar files are copied, unmounting the partition fails. Here are the logs:

Copying boot partition
Written 95%  

Copying rootfs System partition
Written 100%  

Syncing...
 
Un-mount the partitions
umount2: Invalid argument
umount: rootfs: not mounted

The boot partition is mounted correctly and the files are copied. I can verify this by opening the boot partition and can physically see the u-boot.img, uEnv,txt and MLO files. But, the second partition (which should be rootfs) cannot be mounted. If I open GParted and look at the sd card partitions, I see fat32 for partition 1 and unknown filesystem type for partition 2 and there is some unallocated space in the end. I am using 16GB microSD card. The create-sd.sh script is run with sudo command.

I tried booting the BeagleBone Green wireless (BBGW) from the sd card, but, the BBGW does not boot. I can see following messages on serial debug output :

SD/MMC found on device 0                                                        
reading boot.scr                                                                
** Unable to read file boot.scr **                                              
reading uEnv.txt                                                                
** Unable to read file uEnv.txt **                                              
Failed to mount ext2 filesystem...                                              
** Unrecognized filesystem type **                                              
switch to partitions #0, OK                                                     
mmc1(part 0) is current device                                                  
Scanning mmc 1:1...                                                             
switch to partitions #0, OK                                                     
mmc1(part 0) is current device                                                  
SD/MMC found on device 1                                                        
switch to partitions #0, OK                                                     
mmc1(part 0) is current device                                                  
SD/MMC found on device 1                                                        
** File not found boot.scr **                                                   
** Unrecognized filesystem type **                                              
** Invalid partition 2 **                                                       
## Error: "bootcmd_nand0"

The shellscripts for build-wilink.sh were downloaded from gforge.ti.com/.../sdk3-wilink8-am335x-v1.01.tar.gz the link given in the webpage I mentioned before.

Please let me know what I am doiing wrong, how I should proceed.

Thanks in advance

  • Hello Aditya,

    Please check if sfdisk command is used in the create SD card script and its version. Since the version 2.26 sfdisk supports MBR (DOS), GPT, SUN and SGI disk labels, but no longer provides any functionality for CHS (Cylinder-Head-Sector) addressing. Please check this thread.

    Best regards,
    Kemal

  • Hello Kemal,
    Thanks for the quick reply.

    The sd card script does not contain the sfdisk command but uses the parted command as mentioned in the link you suggested :

    parted -s $DRIVE mklabel msdos
    parted -s $DRIVE unit cyl mkpart primary fat32 -- 0 9
    parted -s $DRIVE set 1 boot on
    parted -s $DRIVE unit cyl mkpart primary ext2 -- 9 -2

    While browsing through some previous questions posted on the forum, I came across this link https://e2e.ti.com/support/arm/sitara_arm/f/791/t/390175 , where the user changed the memory card reader and it worked for him. So, I tried the process with a new memory card reader, and the process worked for me too. Seems like the issue was with the card reader. Now, I am able to boot the BBGW with the memory card and can see the kernel starting and various other messages on serial console.

    Thanks for your help and time.

    Best Regards,
    Aditya Kamat

  • Thank you for coming back and sharing the solution.