Programming the FSBL to eMMC Flash

Forums Devices OSD32MP15x Programming the FSBL to eMMC Flash

Viewing 3 reply threads
  • Author
    Posts
    • #12905
      Gil Hershmangil_he
      Participant

        hello,

        We have developed a custom board using the Octavo OSD32MP153C-512M-BAA.

        For board debugging purposes we would like to program only the TF-A image (FSBL) to the eMMC Flash.

        Can that be done without including the u-boot and the linux image ?? (meaning, without using the .tsv file)

        If that is possible, please, let’s us know how to do it.

        Thank you,

        Gil

        • This topic was modified 2 years ago by Gil Hershmangil_he.
      • #12907
        Michal Wolowikmwlinux
        Participant

          Hi gil_he

          first what You need to do is unlock the partitions

          echo 0 > /sys/class/block/mmcblk1boot0/force_ro

          echo 0 > /sys/class/block/mmcblk1boot1/force_ro

          and then type

          dd if=USB/tf-a-stm32mp157f-ev1-emmc.stm32 of=/dev/mmcblk1boot0 conv=fdatasync

          dd if=USB/tf-a-stm32mp157f-ev1-emmc.stm32 of=/dev/mmcblk1boot1 conv=fdatasync

          If You want to do this from U-Boot it is necessary to use STM32 Cube Programmer to write the first and second-stage USB U-Boot and via debug UART stop U-Boot execution. Next in the stopped U-Boot console ums 0 mmc 0 or ums 0 mmc 1 and the memory will be visible from Your host computer.

          So You can from the host do the same as above

          dd if=USB/tf-a-stm32mp157f-ev1-emmc.stm32 of=/dev/mmcblk1boot0 conv=fdatasync

          Of course, remember to align memory id ‘/dev/mmcblk1boot0

          I hope to help You a little bit.

          BR Michal

        • #12908
          Gil Hershmangil_he
          Participant

            hello Michal,

            Thank you for a detailed reply.

            We still don’t have Linux and UBOOT.

            We want to know if there is a way to program the FSBL only to the eMMC given we don’t have the SSBL and Linux.

            Our board is in bring-up stage.

            thanks

            Gil

          • #12958
            Neeraj Dantu
            Moderator

              Thanks Michal for a great reply.

              Gil,

              If you have an eMMC on board, you will need a way to program it. Michal described 2 ways to do it and both of them require different interfaces to be active:

              1. You can program the eMMC by booting from a secondary source like an SD card interface(this would also require you to change boot mode). From the Linux image booted from the SD card, you can program the eMMC by using “dd”

              2. You can also program the eMMC via USB device port(like in OSD32MP1-BRK or OSD32MP1-RED). You will need to use Cube Programmer to USB boot

              There is a 3rd way to boot which also involves using Cube Programmer, but only requires a UART via Serial boot. You can send FSBL(TF-A) and SSBL(U-Boot) via serial using Cube Programmer while you set the boot mode to serial. Then you can program the eMMC via a communication interface enabled by the SSBL, generally this is Ethernet, because you do not have USB/SD card interfaces as described in #1 or #2.

              Please take a look at https://www.st.com/resource/en/application_note/an5275-usb-dfuusart-protocols-used-in-stm32mp1-series-bootloaders-stmicroelectronics.pdf and https://wiki.stmicroelectronics.cn/stm32mpu/wiki/How_to_use_UART_as_serial_boot_device_with_STM32CubeProgrammer for more info.

              Best,

              Neeraj

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