Boot from an eMMC memory device

You can prepare a bootable eMMC memory device to use to boot your board.

Note:
Before you can perform the steps to prepare a bootable eMMC, you must first boot your board using a bootable microSD card . For more information, see Flash U-boot to SD card and Boot the board.
After you have QNX OS running on your target board, complete the following steps to prepare a bootable eMMC and copy the U-Boot and QNX IFS to it:
  1. Copy the QNX IFS file (ifs-imx93-phyboard-nash.raw), phyBOARD-NASH DTB (imx93-phyboard-nash.dtb) and U-Boot binary (imx-boot) to the /tmp directory on your target board.
  2. Delete all existing partitions on the eMMC using the following commands and continue with the proceeding steps:
    # fdisk /dev/emmc0 show -l
    
    _____OS_____     Start       End       ______Number______   Size    Boot
    name    type     Block       Block     Cylinders   Blocks
    
    FAT32     12        2048     2099199      1024     2097152   1024 MB
    QNX6     179     2099200    61079551     28799    58980352  28799 MB
    ------   ---   ---------   ---------   -------   ---------  -----
    ------   ---   ---------   ---------   -------   ---------  -----
    
    # fdisk /dev/emmc0 delete -a
    #
    # fdisk /dev/emmc0 show -l
    
      _____OS_____     Start       End       ______Number______   Size    Boot
        16      name    type     Block       Block     Cylinders   Blocks
    
    ------   ---   ---------   ---------   -------   ---------  -----
    ------   ---   ---------   ---------   -------   ---------  -----
    ------   ---   ---------   ---------   -------   ---------  -----
    ------   ---   ---------   ---------   -------   ---------  -----
    
    #
  3. Create a 4092 MB partition starting from block 8192 using the following command:
    # fdisk /dev/emmc0 add -t 12 -l -c8192,8388609
    #
    # fdisk /dev/emmc0 show -l
    
    _____OS_____     Start       End       ______Number______   Size    Boot
    name    type     Block       Block     Cylinders   Blocks
    
    FAT32     12        8192     8388609      4093     8380418   4092 MB
    ------   ---   ---------   ---------   -------   ---------  -----
    ------   ---   ---------   ---------   -------   ---------  -----
    ------   ---   ---------   ---------   -------   ---------  -----
    
    #
    
  4. Mount and format the eMMC device using these commands:
    # mount -e /dev/emmc0
    # mkdosfs /dev/emmc0t12
    
  5. Mount the FAT32 partition of the eMMC using the following command:
    # mount -t dos /dev/emmc0t12 /fs/emmc
  6. Copy the QNX IFS file (ifs-imx93-phyboard-nash.raw) from the /tmp directory to the fs/emmc directory. You can also use the QNX Momentics IDE to copy the file or one of the following commands:

    For the phyBOARD-NASH:

    cp /tmp/ifs-imx93-phyboard-nash.raw  /fs/emmc/ifs-imx93-phyboard-nash.raw
  7. Copy the phyBOARD-NASH DTB (imx93-phyboard-nash.dtb) from the /tmp directory to the fs/emmc directory as imx93-phyboard-nash.dtb. You can also use the QNX Momentics IDE to copy the file or one of the following commands:

    For the phyBOARD-NASH:

    cp /tmp/imx93-phyboard-nash.dtb /fs/emmc/imx93-phyboard-nash.dtb
  8. Copy the U-boot onto the eMMC memory device raw partition using following command based on the Silicon variant on your board:
    # dd if=/tmp/imx-boot  of=/dev/emmc0 bs=1024 seek=32
  9. Set the boot switches for the phyBOARD-NASH to boot from the eMMC instead of the microSD card on your board as shown in the following image:
    Figure 1DIP switch configuration for the phyBOARD-NASH to boot from eMMC


    For more information about configuring the DIP switches, see Set up the hardware in this chapter.
  10. After use sync to update filesystems to match cached data. Restart the board after removing the SD card from the board. Now the board will Boot from emmc where images are copied. For example:
    
    $ sync
    
    $ shutdown
    
    U-Boot SPL 2023.04 (Apr 23 2024 - 06:55:08 +0000)
    SOC: 0xa1009300
    LC: 0x2040010
    PMIC: Over Drive Voltage Mode
    SoM: PCL-077-23231211I000.A1 PCB rev: 1
    M33 prepare ok
    Normal Boot
    WDT:   Started wdog@42490000 with servicing every 1000ms (40s timeout)
    Trying to boot from BOOTROM
    Boot Stage: Primary boot
    image offset 0x8000, pagesize 0x200, ivt offset 0x0
    Load image from 0x55800 by ROM_API
    NOTICE:  BL31: v2.8(release):lf-6.1.55-2.2.0-0-g08e9d4eef
    NOTICE:  BL31: Built : 06:43:30, Nov 21 2023
    
    
    U-Boot 2023.04 (Apr 23 2024 - 06:55:08 +0000)
    
    CPU:   i.MX93(52) rev1.1 1700 MHz (running at 1692 MHz)
    CPU:   Industrial temperature grade (-40C to 105C) at 33C
    Reset cause: POR (0x1)
    Model: PHYTEC phyBOARD-Nash-i.MX93
    DRAM:  2 GiB
    Core:  215 devices, 28 uclasses, devicetree: separate
    WDT:   Started wdog@42490000 with servicing every 1000ms (40s timeout)
    MMC:   FSL_SDHC: 0, FSL_SDHC: 1
    Loading Environment from MMC... OK
    In:    serial
    Out:   serial
    Err:   serial
    
    BuildInfo:
      - ELE firmware version 0.1.0-44880904
    
    flash target is MMC:0
    Net:   eth0: ethernet@42890000
    Fastboot: Normal
    Normal Boot
    Hit any key to stop autoboot:  0
                    
  11. Press any key on your keyboard to cancel the auto-boot command.
    Hit any key to stop autoboot:  0
    uboot=>
                    
  12. Run the U-Boot commands to load QNX IFS and board device tree from the mmc i.e. the emmc then use go command to boot to QNX OS. For example:
    u-boot=> load mmc 0:1 0x80800000  ifs-imx93-phyboard-nash.raw
    12942236 bytes read in 143 ms (86.3 MiB/s)
    u-boot=> load mmc 0:1 0x80600000  imx93-phyboard-nash.dtb
    50254 bytes read in 4 ms (12 MiB/s)
    u-boot=> go 80800000 80600000
    ## Starting application at 0x80800000 ...
    board_smp_num_cpu: 2 cores
    board_smp_num_cpu: 2 cores
    board_smp_num_cpu: 2 cores
    
    Welcome to QNX 8.0.0 on PHYTEC-phyBOARD-Nash-i.MX93 !
    
    Starting Watchdog driver...
    Starting I2C driver ...
    Setting OS clock from RTC ...
    Starting CAN driver (/dev/can1/*)...
    Starting Serial driver (/dev/ser1)...
    Starting Serial driver (/dev/ser7)...
    Starting SPI master driver ...
    Starting eMMC driver (/dev/emmc0)...
    Starting SD2 memory card driver (/dev/sd0)...
    Path=0 - imx
     target=0 lun=0     Direct-Access(0) - SDMMC: DA6032 Rev: 0.1
     target=1 lun=0     Direct-Access(0) - SDMMC: DA6032 Rev: 0.1
     target=2 lun=0     Direct-Access(0) - SDMMC: DA6032 Rev: 0.1
     target=3 lun=0     Direct-Access(0) - SDMMC: DA6032 Rev: 0.1
     target=4 lun=0     Direct-Access(0) - SDMMC: DA6032 Rev: 0.1
     target=5 lun=0     Direct-Access(0) - SDMMC: DA6032 Rev: 0.1
     target=6 lun=0     Direct-Access(0) - SDMMC: DA6032 Rev: 0.1
     target=7 lun=0     Direct-Access(0) - SDMMC: DA6032 Rev: 0.1
    Unable to access "/dev/sd0" (2)
    Starting OTG1 and OTG2 controllers in host mode ....
    Starting devb-umass ...
    Starting devf-ram filesystem ...
    Starting networking ...
    Starting DHCP client ...
    Starting SSH daemon ...
    Starting devc-pty manager ...
    Starting qconn daemon ...
    Starting shell ...
    #
    
  13. From the U-Boot, saveenv can be used to set environment variables so that the board will be booted automatically. To do this, restart the board and stop at U-Boot. For example:
    
    U-Boot SPL 2023.04 (Apr 23 2024 - 06:55:08 +0000)
    SOC: 0xa1009300
    LC: 0x2040010
    PMIC: Over Drive Voltage Mode
    SoM: PCL-077-23231211I000.A1 PCB rev: 1
    M33 prepare ok
    Normal Boot
    WDT:   Started wdog@42490000 with servicing every 1000ms (40s timeout)
    Trying to boot from BOOTROM
    Boot Stage: Primary boot
    image offset 0x8000, pagesize 0x200, ivt offset 0x0
    Load image from 0x55800 by ROM_API
    NOTICE:  BL31: v2.8(release):lf-6.1.55-2.2.0-0-g08e9d4eef
    NOTICE:  BL31: Built : 06:43:30, Nov 21 2023
    
    
    U-Boot 2023.04 (Apr 23 2024 - 06:55:08 +0000)
    
    CPU:   i.MX93(52) rev1.1 1700 MHz (running at 1692 MHz)
    CPU:   Industrial temperature grade (-40C to 105C) at 33C
    Reset cause: POR (0x1)
    Model: PHYTEC phyBOARD-Nash-i.MX93
    DRAM:  2 GiB
    Core:  215 devices, 28 uclasses, devicetree: separate
    WDT:   Started wdog@42490000 with servicing every 1000ms (40s timeout)
    MMC:   FSL_SDHC: 0, FSL_SDHC: 1
    Loading Environment from MMC... OK
    In:    serial
    Out:   serial
    Err:   serial
    
    BuildInfo:
      - ELE firmware version 0.1.0-44880904
    
    flash target is MMC:0
    Net:   eth0: ethernet@42890000
    Fastboot: Normal
    Normal Boot
    Hit any key to stop autoboot:  0
                    
  14. Press any key on your keyboard to cancel the auto-boot command.
    Hit any key to stop autoboot:  0
    uboot=>
                    
    Note:
    saveenv will overwrite default environment variables. Make sure to create a backup or reflash U-boot to revert back.
  15. Run the following commands to save the environment variables to load qnx and DTB from mmc and use boot command to to boot to QNX OS. For example:
    u-boot=> setenv qnx_ifs_name ifs-imx93-phyboard-nash
    u-boot=> setenv fdt_name imx93-phyboard-nash.dtb
    u-boot=> setenv qnx_loadaddr 0x80800000
    u-boot=> setenv fdt_loadaddr 0x80600000
    u-boot=> setenv load_image "fatload mmc ${mmcdev}:${mmcpart} ${qnx_loadaddr}  ${qnx_ifs_name}.raw"
    u-boot=> setenv load_fdt "fatload mmc ${mmcdev}:${mmcpart} ${fdt_loadaddr}  ${fdt_name}"
    
    Note:
    If you want to automatically boot QNX OS from microSD card, set mmcdev as 1 and for emmc set it as 0.
    u-boot=> setenv mmcdev 0
    u-boot=> setenv jumpto_image "go ${qnx_loadaddr} ${fdt_loadaddr}"
    u-boot=> setenv qnx_mmc_boot "run load_image && run load_fdt && run jumpto_image"
    u-boot=> setenv bootcmd "run qnx_mmc_boot"
    u-boot=> saveenv
    Saving Environment to MMC... Writing to MMC(0)... OK
    u-boot=> boot
    50254 bytes read in 9 ms (5.3 MiB/s)
    12944004 bytes read in 63 ms (195.9 MiB/s)
    ## Starting application at 0x80800000 ...
    board_smp_num_cpu: 2 cores
    board_smp_num_cpu: 2 cores
    board_smp_num_cpu: 2 cores
    
    Welcome to QNX 8.0.0 on PHYTEC-phyBOARD-Nash-i.MX93 !
    
    Starting Watchdog driver...
    Starting I2C driver ...
    Setting OS clock from RTC ...
    Starting CAN driver (/dev/can1/*)...
    Starting Serial driver (/dev/ser1)...
    Starting Serial driver (/dev/ser7)...
    Starting SPI master driver ...
    Starting eMMC driver (/dev/emmc0)...
    Starting SD2 memory card driver (/dev/sd0)...
    Path=0 - imx
     target=0 lun=0     Direct-Access(0) - SDMMC: DA6032 Rev: 0.1
     target=1 lun=0     Direct-Access(0) - SDMMC: DA6032 Rev: 0.1
     target=2 lun=0     Direct-Access(0) - SDMMC: DA6032 Rev: 0.1
     target=3 lun=0     Direct-Access(0) - SDMMC: DA6032 Rev: 0.1
     target=4 lun=0     Direct-Access(0) - SDMMC: DA6032 Rev: 0.1
     target=5 lun=0     Direct-Access(0) - SDMMC: DA6032 Rev: 0.1
     target=6 lun=0     Direct-Access(0) - SDMMC: DA6032 Rev: 0.1
     target=7 lun=0     Direct-Access(0) - SDMMC: DA6032 Rev: 0.1
    Unable to access "/dev/sd0" (2)
    Starting OTG1 and OTG2 controllers in host mode ....
    Starting devb-umass ...
    Starting devf-ram filesystem ...
    Starting networking ...
    Starting DHCP client ...
    Starting SSH daemon ...
    Starting devc-pty manager ...
    Starting qconn daemon ...
    Starting shell ...
    #
    
Page updated: