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.

PROCESSOR-SDK-AM335X: Some SD card content missing

Part Number: PROCESSOR-SDK-AM335X

Hi,

I tried to create a SD card with create-sdcard.sh but I didn't manage to have a proper one without manually copying two files to FAT32 partition. I have now a working SD card but I'd like to have a properly working shell script too. The procedures are mentioned in the files 

laboratorio@laboratorio-ThinkPad-T410s:~$ sudo Apps/ti/ti-processor-sdk-linux-am335x-evm-06.03.00.106/bin/create-sdcard.sh 
[sudo] password for laboratorio: 


################################################################################

This script will create a bootable SD card from custom or pre-built binaries.

The script must be run with root permissions and from the bin directory of
the SDK

Example:
 $ sudo ./create-sdcard.sh

Formatting can be skipped if the SD card is already formatted and
partitioned properly.

################################################################################


Available Drives to write images to: 

#  major   minor    size   name 
1:   8       16   31166976 sdb
 
Enter Device Number or n to exit: 1
 
sdb was selected

################################################################################

		**********WARNING**********

	Selected Device is greater then 16GB
	Continuing past this point will erase data from device
	Double check that this is the correct SD Card

################################################################################

Would you like to continue [y/n] : y

 


/dev/sdb is an sdx device
Current size of sdb1  bytes
SD Card is not correctly partitioned

################################################################################

	Select 2 partitions if only need boot and rootfs (most users).
	Select 3 partitions if need SDK & other content on SD card.  This is
        usually used by device manufacturers with access to partition tarballs.

	****WARNING**** continuing will erase all data on sdb

################################################################################

Number of partitions needed [2/3] : 2

 
Now partitioning sdb with 2 partitions...
 

################################################################################

		Now making 2 partitions

################################################################################

1024+0 records in
1024+0 records out
1048576 bytes (1,0 MB, 1,0 MiB) copied, 1,0598 s, 989 kB/s
DISK SIZE - 31914983424 bytes

################################################################################

		Partitioning Boot

################################################################################
mkfs.fat 4.1 (2017-01-24)
mkfs.fat: warning - lowercase labels might not work properly with DOS or Windows

################################################################################

		Partitioning rootfs

################################################################################
mke2fs 1.44.1 (24-Mar-2018)
/dev/sdb2 contains a ext3 file system labelled 'rootfs'
	last mounted on / on Thu Jan  1 02:00:01 1970
Proceed anyway? (y,N) y
Creating filesystem with 7769600 4k blocks and 1945888 inodes
Filesystem UUID: e7f5b545-2682-4b88-b97d-ff7e0eed8c78
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
	4096000

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done   



################################################################################

   Partitioning is now done
   Continue to install filesystem or select 'n' to safe exit

   **Warning** Continuing will erase files any files in the partitions

################################################################################


Would you like to continue? [y/n] : y

 
 
Mount the partitions 
 
Emptying partitions 
 

Syncing....

################################################################################

	Choose file path to install from

	1 ) Install pre-built images from SDK
	2 ) Enter in custom boot and rootfs file paths

################################################################################

Choose now [1/2] : 2

 

################################################################################

  For U-boot and MLO

  If files are located in Tarball write complete path including the file name.
      e.x. $:  /home/user/MyCustomTars/boot.tar.xz

  If files are located in a directory write the directory path
      e.x. $: /ti-sdk/board-support/prebuilt-images/

  NOTE: Not all platforms will have an MLO file and this file can
        be ignored for platforms that do not support an MLO.

  Update: The proper location for the kernel image and device tree
          files have moved from the boot partition to the root filesystem.

################################################################################

Enter path for Boot Partition : /home/laboratorio/Apps/ti/sd_phase_1/

Directory exists

This directory contains:
MLO  u-boot.img

Is this correct? [y/n] : y


################################################################################

   For Kernel Image and Device Trees files

    What would you like to do?
     1) Reuse kernel image and device tree files found in the selected rootfs.
     2) Provide a directory that contains the kernel image and device tree files
        to be used.

################################################################################

Choose option 1 or 2 : 2  	

 
Choosing a directory that contains the kernel files to be used
 
################################################################################

  For Kernel Image and Device Trees files

  The kernel image name should contain the image type uImage or zImage depending
  on which format is used.

  The device tree files must end with .dtb
      e.g    am335x-evm.dtb am43x-gp-evm.dtb


################################################################################

Enter path for kernel image and device tree files : /home/laboratorio/Apps/ti/sd_phase_2/

Directory exists

This directory contains:
am335x-icev2-am335x-evm.dtb  zImage

Is this correct? [y/n] : y


################################################################################

   For Rootfs partition

   If files are located in Tarball write complete path including the file name.
      e.x. $:  /home/user/MyCustomTars/rootfs.tar.xz

  If files are located in a directory write the directory path
      e.x. $: /ti-sdk/targetNFS/

################################################################################

Enter path for Rootfs Partition : /home/laboratorio/Apps/ti/sd_phase_3/salla-com-base-image-am335x-evm-20210303123126.rootfs.tar.xz 

File exists


################################################################################

	Copying files now... will take minutes

################################################################################

Copying boot partition



MLO copied


u-boot.img copied


Copying rootfs System partition
                                                                                                                                                       

ls: cannot access '/home/laboratorio/Apps/ti/sd_phase_1//zImage': No such file or directory
Kernel image copied
am335x-icev2-am335x-evm.dtb copied
 
Syncing...
 
Un-mount the partitions 
 
Remove created temp directories 
 
Operation Finished
 
laboratorio@laboratorio-ThinkPad-T410s:~$ 

and 
laboratorio@laboratorio-ThinkPad-T410s:~$ sudo Apps/ti/ti-processor-sdk-linux-am335x-evm-06.03.00.106/bin/create-sdcard.sh 


################################################################################

This script will create a bootable SD card from custom or pre-built binaries.

The script must be run with root permissions and from the bin directory of
the SDK

Example:
 $ sudo ./create-sdcard.sh

Formatting can be skipped if the SD card is already formatted and
partitioned properly.

################################################################################


Available Drives to write images to: 

#  major   minor    size   name 
1:   8       16   31166976 sdb
 
Enter Device Number or n to exit: 1
 
sdb was selected

################################################################################

		**********WARNING**********

	Selected Device is greater then 16GB
	Continuing past this point will erase data from device
	Double check that this is the correct SD Card

################################################################################

Would you like to continue [y/n] : y

 


/dev/sdb is an sdx device
Current size of sdb1 71680 bytes
Current size of sdb2 31078400 bytes

################################################################################

	Select 2 partitions if only need boot and rootfs (most users).
	Select 3 partitions if need SDK & other content on SD card.  This is
        usually used by device manufacturers with access to partition tarballs.

	****WARNING**** continuing will erase all data on sdb

################################################################################

Number of partitions needed [2/3] : 2

 
Now partitioning sdb with 2 partitions...
 

################################################################################

		Now making 2 partitions

################################################################################

1024+0 records in
1024+0 records out
1048576 bytes (1,0 MB, 1,0 MiB) copied, 1,00965 s, 1,0 MB/s
DISK SIZE - 31914983424 bytes

################################################################################

		Partitioning Boot

################################################################################
mkfs.fat 4.1 (2017-01-24)
mkfs.fat: warning - lowercase labels might not work properly with DOS or Windows

################################################################################

		Partitioning rootfs

################################################################################
mke2fs 1.44.1 (24-Mar-2018)
/dev/sdb2 contains a ext3 file system labelled 'rootfs'
	last mounted on /home/laboratorio/rootfs on Fri Mar  5 10:14:33 2021
Proceed anyway? (y,N) y
Creating filesystem with 7769600 4k blocks and 1945888 inodes
Filesystem UUID: 71edfeb8-c2d2-408e-88c2-fbbe8916e6a6
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
	4096000

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done   



################################################################################

   Partitioning is now done
   Continue to install filesystem or select 'n' to safe exit

   **Warning** Continuing will erase files any files in the partitions

################################################################################


Would you like to continue? [y/n] : y

 
 
Mount the partitions 
 
Emptying partitions 
 

Syncing....

################################################################################

	Choose file path to install from

	1 ) Install pre-built images from SDK
	2 ) Enter in custom boot and rootfs file paths

################################################################################

Choose now [1/2] : 2

 

################################################################################

  For U-boot and MLO

  If files are located in Tarball write complete path including the file name.
      e.x. $:  /home/user/MyCustomTars/boot.tar.xz

  If files are located in a directory write the directory path
      e.x. $: /ti-sdk/board-support/prebuilt-images/

  NOTE: Not all platforms will have an MLO file and this file can
        be ignored for platforms that do not support an MLO.

  Update: The proper location for the kernel image and device tree
          files have moved from the boot partition to the root filesystem.

################################################################################

Enter path for Boot Partition : /home/laboratorio/Apps/ti/sd_phase_1/

Directory exists

This directory contains:
MLO  u-boot.img  zImage

Is this correct? [y/n] : y


################################################################################

   For Kernel Image and Device Trees files

    What would you like to do?
     1) Reuse kernel image and device tree files found in the selected rootfs.
     2) Provide a directory that contains the kernel image and device tree files
        to be used.

################################################################################

Choose option 1 or 2 : 2

 
Choosing a directory that contains the kernel files to be used
 
################################################################################

  For Kernel Image and Device Trees files

  The kernel image name should contain the image type uImage or zImage depending
  on which format is used.

  The device tree files must end with .dtb
      e.g    am335x-evm.dtb am43x-gp-evm.dtb


################################################################################

Enter path for kernel image and device tree files : /home/laboratorio/Apps/ti/sd_phase_2/

Directory exists

This directory contains:
am335x-icev2-am335x-evm.dtb

Is this correct? [y/n] : y


################################################################################

   For Rootfs partition

   If files are located in Tarball write complete path including the file name.
      e.x. $:  /home/user/MyCustomTars/rootfs.tar.xz

  If files are located in a directory write the directory path
      e.x. $: /ti-sdk/targetNFS/

################################################################################

Enter path for Rootfs Partition : /home/laboratorio/Apps/ti/sd_phase_3/salla-com-base-image-am335x-evm-20210303123126.rootfs.tar.xz 

File exists


################################################################################

	Copying files now... will take minutes

################################################################################

Copying boot partition



MLO copied


u-boot.img copied


Copying rootfs System partition
                                                                                                                                                       

 file not found
am335x-icev2-am335x-evm.dtb copied
 
Syncing...
 
Un-mount the partitions 
 
Remove created temp directories 
 
Operation Finished
 
laboratorio@laboratorio-ThinkPad-T410s:~$ 

. The first one contains an error "zImage: No such file or directory" and the second one " file not found" without the filename. Only MLO and u-boot.img were in the FAT32 partition but no zImage and dtb file.

Regards,

Jani

  • Hi Jani,

    Which version of the Processor SDK do you use?

    Please share the full log of your create sdcard process.

  • Hi Bin,

    Can't you see the two attachments? I thought in the first place that these answer to your questions.  I can see them as in this new picture. 

    Regards,

    Jani

  • Hi Jani,

    In the first log, the answer for the question below should be '1' instead. Kernel image and device tree file should be in the rootfs, so you don't have to specify them in this step.

    ################################################################################

       For Kernel Image and Device Trees files

        What would you like to do?
         1) Reuse kernel image and device tree files found in the selected rootfs.
         2) Provide a directory that contains the kernel image and device tree files
            to be used.

    ################################################################################

    Choose option 1 or 2 : 2  

  • Thanks, Bin,

    That raises a question should I let the am335x-icev2.dtb file to be the only one as there are several:

    root@am335x-evm:~# find / -name *.dtb
    /boot/am335x-bonegreen.dtb
    /boot/am335x-boneblack-iot-cape.dtb
    /boot/am335x-bonegreen-wireless.dtb
    /boot/am335x-boneblue.dtb
    /boot/am335x-evm.dtb
    /boot/am335x-icev2-pru-excl-uio.dtb
    /boot/am335x-evmsk.dtb
    /boot/am335x-sancloud-bbe.dtb
    /boot/am335x-icev2-prueth.dtb
    /boot/am335x-boneblack-pru-adc.dtb
    /boot/am335x-icev2-prueth-pps.dtb
    /boot/am335x-bone.dtb
    /boot/am335x-icev2.dtb
    /boot/am335x-pocketbeagle.dtb
    /boot/am335x-boneblack-wireless.dtb
    /boot/am335x-boneblack-prusuart.dtb
    /boot/am335x-boneblack.dtb
    root@am335x-evm:~#

    Regards,

    Jani

  • Hi Jani,

    The Processor SDK supports multiple AM335x boards and usecases, so it provides multiple .dtb files. Only one will be used at runtime, so you can only keep the ones which you use.

  • Thanks, Bin,

    Are you able to say how the one is chosen to be used at runtime?

  • Hi Jani,

    You might know that there is EEPROM on TI EVM which has information for U-Boot to detect what board it is, then U-Boot has built-in logic to know which dtb to use and assign the dtb filename to U-Boot variable 'fdtfile'. Then the rest of the U-Boot script/env will ensure the dtb will be loaded for kernel to boot.

    Your custom board probably doesn't have EEPROM but you should know which dtb to use, so you can directly assign the dtb filename to U-Boot env 'fdtfile', it should be loaded when U-Boot boot kernel.

  • Thanks, Bin,

    I have to look for more information about the fdtfile.

    Regards,

    Jani