Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

Linux/PROCESSOR-SDK-AM335X: Flashing eMMC using sd card

$
0
0

Part Number:PROCESSOR-SDK-AM335X

Tool/software: Linux

Hi,

We are trying to flash eMMC through micro sd card in beaglebone black by the document present in TI E2E community. Please find the document below.

We are unable to copy files into partitions of eMMC and it is showing no such file or directory. Kindly suggest what wrong.

How to format and partition the eMMC flash

Using this method, you need to first boot the board from the SD card and have the arago filesystem tarball copied to the SD card's root partition. Then follow these steps:

  1. The eMMC is /dev/mmcblk1. Format it this way:
    1.01. fdisk /dev/mmcblk1
    1.02. o - this clears the existing partitions
    1.03. p - this lists all partition tables on the card (there should be none)
    1.04. n - create a new partition
    1.05. p - primary partition
    1.06. 1 - partition number
    1.07. 2048 - default value for the first sector
    1.08. +16M - last sector / partition size
    1.09. t - change the partition type (select partition 1)
    1.10. e - change tha partition type to "W95 FAT16 (LBA)"
    1.11. a - set the bootable flag for the selected partition (select partition 1)
    1.12. n - create a new partition
    1.13. p - primary partition
    1.14. 2 - partition number
    1.15. hit Enter to choose the default (next available) value for the first sector
    1.16. hit Enter to choose the default (last) value for the last sector
    1.17. p - this lists all partition tables on the card (there should be two)
    1.18. w - write all the above changes to disk
    1.19. umount /dev/mmcblk1p1 - if mounted
    1.20. mkfs.vfat -F 16 /dev/mmcblk1p1 - format the first partition
    1.21. umount /dev/mmcblk1p2 - if mounted
    1.22. mkfs.ext4 /dev/mmcblk1p2 - format the second partition

  2. Copy the {MLO,u-boot.img,uImage} files to the first partition:
    2.1. mkdir boot
    2.2. mount /dev/mmcblk1p1 boot
    2.3. cp /media/mmcblk0p1/{MLO,u-boot.img,uImage} boot
    2.4. sync
    2.5. umount boot

  3. Extract the root file system to the second partition:
    3.1. mkdir root
    3.2. mount /dev/mmcblk1p2 root
    3.3. tar -xf /tisdk-rootfs-image-am335x-evm.tar.gz -C root
    3.4. sync
    3.5. umount root

  4. Shutdown the MTR board, remove the SD card and start it from the eMMC.

  5. To copy psplash:

    1. mount /dev/mmcblk1p2 /mnt

              2. cp /usr/bin/psplash /mnt/usr/bin/

              3. sync

              4. umount /mnt

 

 

Terminal window:

root@am335x-evm:~# mkfs.ext4 /dev/mmcblk1p2
mke2fs 1.43.5 (04-Aug-2017)
Discarding device blocks: done                            
Creating filesystem with 929536 4k blocks and 232464 inodes
Filesystem UUID: 76cf6bfe-9418-4c8c-82a1-6ad171a7eeb9
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736

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

root@am335x-evm:~# mkdir boot
root@am335x-evm:~# mount /dev/mmcblk1p1 boot
root@am335x-evm:~# cp /media/mmcblk0p1/{MLO,u-boot.img,uImage} boot
cp: can't stat '/media/mmcblk0p1/MLO': No such file or directory
cp: can't stat '/media/mmcblk0p1/u-boot.img': No such file or directory
cp: can't stat '/media/mmcblk0p1/uImage': No such file or directory
root@am335x-evm:~# ls
Images  boot
root@am335x-evm:~# cd Images/
root@am335x-evm:~/Images# cp u-boot.img /dev/                
Display all 683 possibilities? (y or n)
root@am335x-evm:~/Images# cp MLO /dev/mmcblk1p1                                                                                             
root@am335x-evm:~/Images# cp u-boot.img /dev/mmcblk1p1                                                                                      
root@am335x-evm:~/Images# cp uEnv.txt /dev/mmcblk1p1                                                                                        
root@am335x-evm:~/Images# cd /
root@am335x-evm:/# cd /dev/mmcblk1p1
-sh: cd: /dev/mmcblk1p1: Not a directory

 

root@am335x-evm:/# ls boot/
am335x-bone.dtb                                  devicetree-zImage-am335x-boneblack-wireless.dtb
am335x-boneblack-pru-adc.dtb                     devicetree-zImage-am335x-boneblack.dtb
am335x-boneblack-wireless.dtb                    devicetree-zImage-am335x-boneblue.dtb
am335x-boneblack.dtb                             devicetree-zImage-am335x-bonegreen-wireless.dtb
am335x-boneblue.dtb                              devicetree-zImage-am335x-bonegreen.dtb
am335x-bonegreen-wireless.dtb                    devicetree-zImage-am335x-evm.dtb
am335x-bonegreen.dtb                             devicetree-zImage-am335x-evmsk.dtb
am335x-evm.dtb                                   devicetree-zImage-am335x-icev2-pru-excl-uio.dtb
am335x-evmsk.dtb                                 devicetree-zImage-am335x-icev2-prueth.dtb
am335x-icev2-pru-excl-uio.dtb                    devicetree-zImage-am335x-icev2.dtb
am335x-icev2-prueth.dtb                          vmlinux-4.14.67-gd315a9bb00
am335x-icev2.dtb                                 zImage
devicetree-zImage-am335x-bone.dtb                zImage-4.14.67-gd315a9bb00
devicetree-zImage-am335x-boneblack-pru-adc.dtb
root@am335x-evm:/# cd
root@am335x-evm:~# ls
Images  boot
root@am335x-evm:~# cd Images/
root@am335x-evm:~/Images# ls
MLO                                   tisdk-rootfs-image-am335x-evm.tar.xz  uEnv.txt
create-emmc.sh                        u-boot.img
root@am335x-evm:~/Images# cd ..
root@am335x-evm:~# ls boot/
root@am335x-evm:~# ls
Images  boot
root@am335x-evm:~# mkdir kernal
root@am335x-evm:~# ls
Images  boot    kernal
root@am335x-evm:~# cp /boot/zImage /home/root/kernal
root@am335x-evm:~# cp /boot/am335x-bone
am335x-bone.dtb                am335x-boneblack-wireless.dtb  am335x-boneblue.dtb            am335x-bonegreen.dtb
am335x-boneblack-pru-adc.dtb   am335x-boneblack.dtb           am335x-bonegreen-wireless.dtb  
root@am335x-evm:~# cp /boot/am335x-boneblack.dtb /home/root/kernal
root@am335x-evm:~# cd kernal/
root@am335x-evm:~/kernal# ls
am335x-boneblack.dtb  zImage
root@am335x-evm:~/kernal# cd ..
root@am335x-evm:~# mv kernal Images
root@am335x-evm:~# ls
Images  boot
root@am335x-evm:~# cd Images/
root@am335x-evm:~/Images# ls
MLO                                   kernal                                u-boot.img
create-emmc.sh                        tisdk-rootfs-image-am335x-evm.tar.xz  uEnv.txt
root@am335x-evm:~/Images# cd kernal
root@am335x-evm:~/Images/kernal# ls
am335x-boneblack.dtb  zImage
root@am335x-evm:~/Images/kernal# cd /
root@am335x-evm:/# cd run/media/mmcblk1p1/                                                                                                  
-sh: cd: run/media/mmcblk1p1/: No such file or directory
root@am335x-evm:/# cd dev/mmcblk1p1
-sh: cd: dev/mmcblk1p1: Not a directory
root@am335x-evm:/# cd
root@am335x-evm:~# cd /Images/
root@am335x-evm:/Images# cd  
root@am335x-evm:~# cd /home/root/Images/kernal/
root@am335x-evm:~/Images/kernal# ls
am335x-boneblack.dtb  zImage
root@am335x-evm:~/Images/kernal# cp am335x-boneblack.dtb /run/media/mmcblk1p1/boot/                                                         
cp: can't create '/run/media/mmcblk1p1/boot/': No such file or directory
root@am335x-evm:~/Images/kernal# cd
root@am335x-evm:~# ls
Images  boot

root@am335x-evm:/dev# cd mmcblk1p1
-sh: cd: mmcblk1p1: Not a directory
root@am335x-evm:/dev# cd mmcblk1p1
-sh: cd: mmcblk1p1: Not a directory
root@am335x-evm:/dev# cd mmcblk1boot0
-sh: cd: mmcblk1boot0: Not a directory
root@am335x-evm:/dev# cd mmcblk0p1
-sh: cd: mmcblk0p1: Not a directory
root@am335x-evm:/dev# ls mmcblk0p1
mmcblk0p1
root@am335x-evm:/dev# ls mmcblk1p1
mmcblk1p1
root@am335x-evm:/dev# cd mmcblk1p1
-sh: cd: mmcblk1p1: Not a directory
root@am335x-evm:/dev# cd
root@am335x-evm:~# cd /home/root/Images/kernal/
root@am335x-evm:~/Images/kernal# cp am335x-boneblack.dtb /dev/mmcblk1p2/boot
cp: can't stat '/dev/mmcblk1p2/boot': Not a directory
root@am335x-evm:~/Images/kernal# cp am335x-boneblack.dtb /dev/mmcblk1p2     
root@am335x-evm:~/Images/kernal# cp am335x-boneblack.dtb /dev/mmcblk1p2/boot
cp: can't stat '/dev/mmcblk1p2/boot': Not a directory
root@am335x-evm:~/Images/kernal# cp am335x-boneblack.dtb /dev/mmcblk1p2     
am335x-boneblack.dtb  zImage                
root@am335x-evm:~/Images/kernal# cp am335x-boneblack.dtb /dev/mmcblk1p2
am335x-boneblack.dtb  zImage                
root@am335x-evm:~/Images/kernal# cp am335x-boneblack.dtb /dev/mmcblk1p2
am335x-boneblack.dtb  zImage                
root@am335x-evm:~/Images/kernal# cd /dev/mmcblk1p2                                                                                          
cd
root@am335x-evm:~/Images/kernal# cd /dev/mmcblk1p2
cd
root@am335x-evm:~/Images/kernal# cd /dev/mmcblk1p2
-sh: cd: /dev/mmcblk1p2: Not a directory
root@am335x-evm:~/Images/kernal# mkdir /dev/mmcblk1p2/boot                                                                                  
mkdir: can't create directory '/dev/mmcblk1p2/boot': Not a directory
root@am335x-evm:~/Images/kernal# cp zImage /dev/mmcblk1p2/boot/                                                                             
cp: can't stat '/dev/mmcblk1p2/boot/': Not a directory
root@am335x-evm:~/Images/kernal# cp zImage /dev/mmcblk1p2/     
cp: can't stat '/dev/mmcblk1p2/': Not a directory
root@am335x-evm:~/Images/kernal# cp zImage /dev/mmcblk1p2
root@am335x-evm:~/Images/kernal# sync
root@am335x-evm:~/Images/kernal# cd ..
root@am335x-evm:~/Images# cp pssplash-default /dev/mmcblk1
mmcblk1       mmcblk1boot0  mmcblk1boot1  mmcblk1p1     mmcblk1p2     mmcblk1rpmb   
root@am335x-evm:~/Images# cp pssplash-default /dev/mmcblk1p2/etc
cp: can't stat '/dev/mmcblk1p2/etc': Not a directory
root@am335x-evm:~/Images# cp pssplash-default /dev/mmcblk1p2/cd /
cp: can't stat 'pssplash-default': No such file or directory
cp: can't stat '/dev/mmcblk1p2/cd': Not a directory
root@am335x-evm:~/Images# mount /run/media/mmcblk1p1
mount: /run/media/mmcblk1p1: can't find in /etc/fstab.
root@am335x-evm:~/Images# cd /
root@am335x-evm:/# mount /run/media/mmcblk1p1
mount: /run/media/mmcblk1p1: can't find in /etc/fstab.
root@am335x-evm:/# cd
root@am335x-evm:~# mkfs.ext4 /dev/mmcblk1p2
mke2fs 1.43.5 (04-Aug-2017)
Discarding device blocks: done                            
Creating filesystem with 3768 1k blocks and 944 inodes

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

root@am335x-evm:~# mkdir boot
mkdir: can't create directory 'boot': File exists
root@am335x-evm:~# mount /run/media/mmcblk1p1 boot                                                                                          
mount: /home/root/boot: special device /run/media/mmcblk1p1 does not exist.
root@am335x-evm:~# mount /dev/mmcblk1p1 boot
mount: /home/root/boot: /dev/mmcblk1p1 is not a block device; try "-o loop".
root@am335x-evm:~# cp /m/mmcblk0p1/{MLO,u-boot.img,uImage} boot
media/ mnt/   
root@am335x-evm:~# cp /media/mmcblk0p1/{MLO,u-boot.img,uImage} boot                                                                      
cp: can't stat '/media/mmcblk0p1/MLO': No such file or directory
cp: can't stat '/media/mmcblk0p1/u-boot.img': No such file or directory
cp: can't stat '/media/mmcblk0p1/uImage': No such file or directory
root@am335x-evm:~# cp /media/mmcblk0p1/{MLO,u-boot.img} boot
cp: can't stat '/media/mmcblk0p1/MLO': No such file or directory
cp: can't stat '/media/mmcblk0p1/u-boot.img': No such file or directory

 


Viewing all articles
Browse latest Browse all 262198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>