11.1. How To Use EMMC Based Filesystem

The PSDK QNX release focuses on filesystems on the SD card. How can an eMMC based filesystem be made accessible/used on a PSDK QNX release?

To make use of the eMMC filesystem on the J721E EVM with the PSDK QNX 10_00_00 release, the below steps can be followed.

Note

These steps were tested on the J721E EVM using the PSDK QNX 10_00_00 release, and may change with newer revisions of the TI PSDK QNX release.

  • Refer Getting Started and Release Notes to get the J721E EVM running with SD boot (either SBL or SPL).

  • From the above step, an SD card will be created with an etx4 file system (rootfs) which holds the remote core firmware used by the bootloader. Since QNX cannot read or format ext4 file systems, this firmware will have to be moved to the boot partition before copying the boot files to the SD card (our u-boot uEnv.txt file will look for firmware here if booting from eMMC). This way we can transfer the firmware to the eMMC inside QNX OS. If you don’t plan to load remote core firmware, you can skip this step.

# command ran on host machine with fully populated & working SD card
cp -rv <path_to_SD_card_mount_dir>/rootfs/lib/firmware/ <path_to_SD_card_mount_dir>/boot
  • After booting the J721E EVM to the QNX prompt run the below commands to format and create an eMMC partition. For further information on usage of eMMC filesystems in the QNX environment please reference QNX’s Online User Guide.

# Check the partition information:
fdisk /dev/emmc0 info
# Delete all existing partitions:
fdisk /dev/emmc0 delete -a
fdisk /dev/emmc0 show
# Create a 256MB and a 8GB FAT32 partition from the beginning of the eMMC device:
fdisk /dev/emmc0 add -t 12 -c 0,255
fdisk /dev/emmc0 add -t 12 -c 256,8256
fdisk /dev/emmc0 show
#Enumerate the partitions:
mount -e /dev/emmc0
ls /dev/emmc0*
# Format the FAT32 partition and mount it:
mkdosfs /dev/emmc0t12
mkdosfs /dev/emmc0t12.1
# Mount
mount -t dos /dev/emmc0t12 /emmc_boot
mount -t dos /dev/emmc0t12.1 /emmc_ti_fs
# Copy the filesystem contents from the SD card to the newly created eMMC partition
ls /emmc_boot
cp -Rvf /boot/* /emmc_boot
cp -Rvf /ti_fs/* /emmc_ti_fs
sync
  • If using a J721E EVM, power down and reconfigure your bootmode switches to choose eMMC boot. Remove your sd card and power on your EVM. If using SPL (U-Boot) You will need to interrupt the U-Boot prompt and enter the following commands:

setenv mmcdev 0
run envboot

To automatically boot without the need to interrupt the u-boot prompt, you will need to rebuild u-boot. Change the default value of mmcdev in /board/ti/J721E/J721E.env to 0, and rebuild.