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.

AM4376: Flashing EMMC from UART0 uboot??

Part Number: AM4376

Hello there,

Reading the following link:
https://software-dl.ti.com/processor-sdk-linux/esd/docs/06_03_00_106/linux/Foundational_Components_U-Boot.html 

It looks like there are a few ways to flash an EMMC using DFU and tFTP, but so far I have not been able to bring USB nor ethernet in my custom design.

Is there a way to pass the spl and uboot.img to the EMMC using UART0 boot?

Thank you in advance!

  • Hi Kamil,

    Kamil Muza1 said:
    It looks like there are a few ways to flash an EMMC using DFU and tFTP, but so far I have not been able to bring USB nor ethernet in my custom design.

    Is there a way to pass the spl and uboot.img to the EMMC using UART0 boot?

    Once you successfully booted to u-boot prompt from UART boot mode, if you're able to get access to eMMC as shown below, it is possible to flash eMMC.

    => mmc list
    OMAP SD/MMC: 0 (SD)
    OMAP SD/MMC: 1 (eMMC)

    But when the files to be flashed are kernel, FS, you'll need to work out how to pull these files from. Reading these files over UART link would be very slow. 

    Some of better options would be as you wrote - using USB client or Network boot modes to transfer files from host to target. Another option is using USB host boot mode as currently being discussed in another e2e thread.

    Best,

    -Hong

  • Hong Guan64 said:

    Once you successfully booted to u-boot prompt from UART boot mode, if you're able to get access to eMMC as shown below, it is possible to flash eMMC.

    1
    2
    3
    => mmc list
    OMAP SD/MMC: 0 (SD)
    OMAP SD/MMC: 1 (eMMC)

    But when the files to be flashed are kernel, FS, you'll need to work out how to pull these files from. Reading these files over UART link would be very slow. 


    Thanks for the reply!
    I can currently see the eMMC when I perform mmc list

    How can I copy the spl and uboot.img into the eMMC from the uboot command line if i'm booting from UART0. Is there a way to do this?

  • Kamil Muza1 said:
    How can I copy the spl and uboot.img into the eMMC from the uboot command line if i'm booting from UART0. Is there a way to do this?

    Once at u-boot prompt from UART boot, eMMC flashing instructions:
    software-dl.ti.com/.../Foundational_Components_U-Boot.html
    After eMMC partition step, it is bit tricky on how to get eMMC boot binary (MLO/u-boot.img).
    One option would be building your eMMC boot files (MLO/u-boot.img) into your UART boot u-boot.img.
    From UART boot u-boot.img map file, work out DDR addresses of eMMC boot file (MLO/u-boot.img), i.e. noted as MLO_ADDR_IN_DDR, & UBOOT_ADDR_IN_DDR

    Original eMMC flashing:
    U-Boot # fatload mmc 0 ${loadaddr} MLO
    U-Boot # mmc write ${loadaddr} 0x100 0x100
    U-Boot # mmc write ${loadaddr} 0x200 0x100
    U-Boot # fatload mmc 0 ${loadaddr} u-boot.img
    U-Boot # mmc write ${loadaddr} 0x300 0x400
    Modified one:
    U-Boot # mmc write ${loadaddr} 0x100 0x100 => mmc write MLO_ADDR_IN_DDR 0x100 0x100
    U-Boot # mmc write ${loadaddr} 0x300 0x400 => mmc write UBOOT_ADDR_IN_DDR 0x300 0x400
  • Hong Guan64 said:
    U-Boot # mmc write ${loadaddr} 0x100 0x100 => mmc write MLO_ADDR_IN_DDR 0x100 0x100
    U-Boot # mmc write ${loadaddr} 0x300 0x400 => mmc write UBOOT_ADDR_IN_DDR 0x300 0x400



    Can you expand a bit more on how to find these two addresses? When you say UART boot u-boot.img map file, are you referring to:
    u-boot-spl.map and u-boot.map?

  • Hi Kamil,

    As said in my first reply, recommended options would be using USB client or Network boot modes to transfer files from host to target, plus USB host mode.
    It is due to getting eMMC boot binary from UART boot mode needs further customizations, and UART download speed is slow...
    My original thought is "piggy-back" eMMC binary files onto UART u-boot.img, but given FIT is used for u-boot.img, it makes non-trivial work.

    For development or testing purpose, if JTAG is available on your board, another option would be using JTAG to download eMMC binary to DDR after u-boot prompt is reached from UART boot, and then use u-boot cmd "mmc write..." to write binary from DDR to eMMC.


    Best,
    -Hong