Won’t boot from eMMC

Forums Devices Won’t boot from eMMC

Tagged: 

Viewing 3 reply threads
  • Author
    Posts
    • #12036
      Bill RussellBillR
      Participant

        Our custom board is based off the Red board.
        eMMC works in general, but can’t boot off it, only SD card.
        Our TF-A device tree has the same definitions as Red Board’s device tree for sdmmc2.

        Using these trusted boot images which work fine when used for SD card boot:
        fsbl1 = tf-a.stm32
        fsbl2 = tf-a.stm32
        ssbl = u-boot.stm32

        I have followed the procedure from the relevant readme’s such as:
        https://github.com/ARM-software/u-boot/blob/master/board/st/stm32mp1/README,
        using Step 7 “Prepare SD card” but instead doing it to /dev/mmcblk2 for eMMC while running off SD card.

        Our chip is Rev Z, which I understand fixes a eMMC boot errata. Our eMMC is Micron 16GB.

      • #12037
        Bill RussellBillR
        Participant

          eMMC info from u-boot, in case its of use:

          OSD32MP> mmc dev 1
          switch to partitions #0, OK
          mmc1(part 0) is current device
          OSD32MP> mmc info
          Device: STM32 SD/MMC
          Manufacturer ID: 13
          OEM: 14e
          Name: S0J56
          Bus Speed: 52000000
          Mode: MMC High Speed (52MHz)
          Rd Block Len: 512
          MMC version 5.1
          High Capacity: Yes
          Capacity: 14.8 GiB
          Bus Width: 8-bit
          Erase Group Size: 512 KiB
          HC WP Group Size: 8 MiB
          User Capacity: 14.8 GiB WRREL
          Boot Capacity: 31.5 MiB ENH
          RPMB Capacity: 4 MiB ENH

        • #12038
          Bill RussellBillR
          Participant

            I followed directions to instead do it from u-boot and it will boot now.
            I was unaware that eMMC has some dedicated boot partitions.

            a) prepare GPT on eMMC,
            example with 2 partitions, bootfs and rootfs:

            # setenv emmc_part “name=ssbl,size=2MiB;name=bootfs,type=linux,bootable,size=64MiB;name=rootfs,type=linux,size=512”
            # gpt write mmc 1 ${emmc_part}

            b) copy SPL on eMMC on first boot partition
            (SPL max size is 256kB, with LBA 512, 0x200)

            # ext4load mmc 0:4 0xC0000000 tf-a.stm32
            # mmc dev 1
            # mmc partconf 1 1 1 1
            # mmc write ${fileaddr} 0 200
            # mmc partconf 1 1 1 0

            b) copy U-Boot in first GPT partition of eMMC

            # ext4load mmc 0:4 0xC0000000 u-boot.stm32
            # mmc dev 1
            # part start mmc 1 1 partstart
            # part size mmc 1 1 partsize
            # mmc write ${fileaddr} ${partstart} ${partsize}

            To boot from eMMC, select BootPinMode = 0 1 0 and reset.

          • #12043
            Neeraj Dantu
            Moderator

              BillR,

              Glad you are able to resolve your problem. As you indicated, eMMC and SD card have different partition layouts. Please see https://wiki.st.com/stm32mpu-ecosystem-v2/wiki/STM32CubeProgrammer_flashlayout for reference.

              Best,
              Neeraj

          Viewing 3 reply threads
          • You must be logged in to reply to this topic.