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-AM64X: PROCESSOR-SDK-AM64X : Flash Linux to eMMC

Part Number: PROCESSOR-SDK-AM64X

Hi,

I am having some issues with "Flashing Linux to eMMC"  Flash Linux to eMMC (ti.com)

I believe I am following the instructions correctly. The only minor issue is the renaming of the file u-boot-am64xx-evm.img to u-boot.img.

I have included most of the steps and their responses below.

I'm not sure what is wrong, but I don't even get bootloader when booting to eMMC.

I set the switches to 11010010  00000000 for eMMC boot. (As shown here:  AM64x MCU+ SDK: EVM Setup (ti.com))

I would imagine that I would at least get bootloader, by copying (tiboot3.bin, tispl.bin and u-boot.img) to /dev/mmcblk0boot0

I don't know how to trouble shoot the issue any further.

Thank you,

############################################################################################################################################################
# BOOT FROM eMMC
############################################################################################################################################################
root@am64xx-evm:~# ls -l /dev/mmcblk*
brw-rw---- 1 root disk 179, 32 Mar 1 20:26 /dev/mmcblk0
brw-rw---- 1 root disk 179, 64 Mar 1 20:26 /dev/mmcblk0boot0
brw-rw---- 1 root disk 179, 96 Mar 1 20:26 /dev/mmcblk0boot1
brw-rw---- 1 root disk 179, 33 Mar 1 20:26 /dev/mmcblk0p1
crw------- 1 root root 240, 0 Mar 1 20:26 /dev/mmcblk0rpmb
brw-rw---- 1 root disk 179, 0 Mar 1 20:26 /dev/mmcblk1
brw-rw---- 1 root disk 179, 1 Mar 1 20:26 /dev/mmcblk1p1
brw-rw---- 1 root disk 179, 2 Mar 1 20:26 /dev/mmcblk1p2

root@am64xx-evm:~# echo 0 > /sys/block/mmcblk0boot0/force_ro

root@am64xx-evm:~# mv u-boot-am64xx-evm.img u-boot.img

root@am64xx-evm:~# dd if=tiboot3.bin of=/dev/mmcblk0boot0 seek=0
763+1 records in
763+1 records out
390826 bytes (391 kB, 382 KiB) copied, 0.044665 s, 8.8 MB/s
root@am64xx-evm:~# dd if=tispl.bin of=/dev/mmcblk0boot0 seek=1024
1375+1 records in
1375+1 records out
704484 bytes (704 kB, 688 KiB) copied, 0.0758318 s, 9.3 MB/s
root@am64xx-evm:~# dd if=u-boot.img of=/dev/mmcblk0boot0 seek=5120
1610+1 records in
1610+1 records out
824412 bytes (824 kB, 805 KiB) copied, 0.0790146 s, 10.4 MB/s

root@am64xx-evm:~# fdisk /dev/mmcblk0

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

This disk is currently in use - repartitioning is probably a bad idea.
It's recommended to umount all file systems, and swapoff all swap
partitions on this disk.

Command (m for help): p

Disk /dev/mmcblk0: 14.82 GiB, 15913189376 bytes, 31080448 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x21e6df44

Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 2048 31080447 31078400 14.8G 83 Linux

Command (m for help): n
All space for primary partitions is in use.

Command (m for help): d
Selected partition 1
Partition 1 has been deleted.

Command (m for help): n
Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p):

Using default response p.
Partition number (1-4, default 1):
First sector (2048-31080447, default 2048):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-31080447, default 31080447):

Created a new partition 1 of type 'Linux' and of size 14.8 GiB.
Partition #1 contains a ext4 signature.

Do you want to remove the signature? [Y]es/[N]o: Y

The signature will be removed by a write command.

Command (m for help): w
The partition table has been altered.
Syncing disks.


root@am64xx-evm:/# ls -l /dev/mmcblk0*
brw-rw---- 1 root disk 179, 0 Apr 28 17:48 /dev/mmcblk0
brw-rw---- 1 root disk 179, 32 Apr 28 17:42 /dev/mmcblk0boot0
brw-rw---- 1 root disk 179, 96 Apr 28 17:42 /dev/mmcblk0boot1
brw-rw---- 1 root disk 179, 1 Apr 28 17:48 /dev/mmcblk0p1
crw------- 1 root root 240, 0 Apr 28 17:42 /dev/mmcblk0rpmb

root@am64xx-evm:/# mkfs.ext4 /dev/mmcblk0p1
mke2fs 1.46.5 (30-Dec-2021)
Discarding device blocks: done
Creating filesystem with 3884800 4k blocks and 972944 inodes
Filesystem UUID: bf704f5c-7e8c-4f3f-baa1-2e6b11a9aa32
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208

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

root@am64xx-evm:/home# mount /dev/mmcblk0p1 /mnt/mmcblk0p1/

root@am64xx-evm:/home# tar xf tisdk-default-image-am64xx-evm.tar.xz -C /mnt/mmcblk0p1/

root@am64xx-evm:/home# ls /mnt/mmcblk0p1/
bin boot dev etc home include init lib linuxrc lost+found media mnt opt proc run sbin sys tmp usr var www

root@am64xx-evm:/home# umount /mnt/mmcblk0p1/

*** REBOOT ***

In: serial@2800000
Out: serial@2800000
Err: serial@2800000
Unidentified board claims AM64-EVM in eeprom header
Net: eth0: ethernet@8000000port@1
Hit any key to stop autoboot: 0
=> mmc partconf 0 1 1 1
=> mmc bootbus 0 2 0 0
Set to BOOT_BUS_WIDTH = 0x2, RESET = 0x0, BOOT_MODE = 0x0

*** POWER OFF ***

*** SET SWITCHES to eMMC Boot ***

*** POWER ON ***

Nothing.

  • Hi,

    was working on the same a couple days ago. One thing I can see is that your addresses for the seek may be wrong. I used 2048 instead of 1024 and 6144 instead of 5120.

    I mean these lines:

    root@am64xx-evm:~# dd if=tispl.bin of=/dev/mmcblk0boot0 seek=1024
    root@am64xx-evm:~# dd if=u-boot.img of=/dev/mmcblk0boot0 seek=5120

    The documentation is inconsistent, as far as I remember on the academy site they use older addresses, and somewhere in the Linux SDK are the newer ones (can't find the link right now though).

    You could also try to upload only the first tiboot3.bin for now and leave the others. Then you can be sure it isn't being overwritten.

    Edit: found the link (https://software-dl.ti.com/processor-sdk-linux/esd/AM64X/09_00_00_03/exports/docs/linux/Foundational_Components/U-Boot/UG-Memory.html#booting-tiboot3-bin-tispl-bin-and-u-boot-img-from-emmc-boot-partition-for-k3-class-of-socs)

    There are the commands for u-boot where they use address 0x800 which is 2048.

    Cheers

  • Hi Ergin,

    Thank you so very much for your input. It was a big help resolving the issue.

    I discovered that there are actually 2 issues. The one you pointed out about the memory locations and which files to use.

    I followed the directions and used the files from the SDK Location. 

    I think that is what the original memory locations were for. Needless to say it didn't boot in eMMC mode.

    I then switched over to using the boot files from the bootable SD card and that finally worked.

    Notice the differences in the number of records below.

    # Files from the C:\ti\processor_sdk_linux_am64x_07_03_01_006\board-support\prebuilt-images

    root@am64xx-evm:~# dd if=tiboot3.bin of=/dev/mmcblk0boot0 seek=0
    763+1 records in
    763+1 records out
    390826 bytes (391 kB, 382 KiB) copied, 0.044665 s, 8.8 MB/s
    root@am64xx-evm:~# dd if=tispl.bin of=/dev/mmcblk0boot0 seek=1024
    1375+1 records in
    1375+1 records out
    704484 bytes (704 kB, 688 KiB) copied, 0.0758318 s, 9.3 MB/s
    root@am64xx-evm:~# dd if=u-boot.img of=/dev/mmcblk0boot0 seek=5120
    1610+1 records in
    1610+1 records out
    824412 bytes (824 kB, 805 KiB) copied, 0.0790146 s, 10.4 MB/s

    # Files on the SD Card

    root@am64xx-evm:~# dd if=/mnt/mmcblk1p1/tiboot3.bin of=/dev/mmcblk0boot0 seek=0
    1041+1 records in
    1041+1 records out
    533426 bytes (533 kB, 521 KiB) copied, 0.0498353 s, 10.7 MB/s
    root@am64xx-evm:~# dd if=/mnt/mmcblk1p1/tispl.bin of=/dev/mmcblk0boot0 seek=2048
    1942+1 records in
    1942+1 records out
    994311 bytes (994 kB, 971 KiB) copied, 0.084395 s, 11.8 MB/s
    root@am64xx-evm:~# dd if=/mnt/mmcblk1p1/u-boot.img of=/dev/mmcblk0boot0 seek=6144
    2514+1 records in
    2514+1 records out
    1287535 bytes (1.3 MB, 1.2 MiB) copied, 0.10549 s, 12.2 MB/s

  • Hi Christopher,

    Glad it helped. I am not sure what hardware you are working on, but we are working on a custom board with custom DRAM and EMMC and we had to recompile the three binaries according to our hardware which will resulted in different sizes. I can see your processor SDK is quite old (v7...). In the newer one  (9...) the files are larger because they added a bunch on stuff I suppose.

    So you managed to completely boot into Linux/U-boot via EMMC now?

  • Hi Ergin,

    I'm sorry, I should have mentioned that I am using AM64x EVM. 

    I must have pasted the wrong SDK or something. I was looking for the file “tisdk-tiny-image-am64xx-evm.tar.xz", because for my next task, I would like to Flash to OSPI /MTD. I don't know, maybe I grabbed the files from that SDK.

    So, yes. I am able to completely boot in Linux via eMMC now.

    Thank you very much.

  • Hi Ergin,

    I misspoke. I was excited. I am 'partially' able to boot-up in eMMC mode.

    When I use the switches, it boots up in eMMC mode, using the bootloader, but I believe it is still using the SD card as the file system.

    The very last step 'saveenv' command doesn't work.

    I read something about the u-boot environment was not built with saveenv enabled, so I will probably have to rebuild u-boot and enable the saveenv.

    Thanks again,