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.

TMDS64GPEVM: [Yocto] How boot image from NOR Flash?

Part Number: TMDS64GPEVM

Hello

I'm using TMDS64GPEVM board. Revision PRC101B. I want to boot tiny image form builtin S28HS512TGABHM010 NOR Flash memory. Based on this tutorial:

https://software-dl.ti.com/processor-sdk-linux/esd/AM64X/08_05_00_21/exports/docs/linux/Foundational_Components/U-Boot/UG-QSPI.html

I successfully load tiboo3.bin, tispl.bin and u-boot.img to NOR flash and run u-boot. Now I want to create linux image and flash it on builtin memory. What steps I need to take to create such an Image using Yocto? What image format need to create? I assume that Yocto .wic image format will not work on NOR memory.

Thanks

BR

Jakub

  • Hi Jakub,

    there's a couple of ways to do that but I assume you'd want persistent storage, right? If so this usually involves the use of a flash file system like UBIFS or JFFS2. One existing resource that comes to mind is this, can you please have a look: https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1018036/am6442-how-to-create-ospi-rootfs-ubifs-and-boot-linux-from-ospi-without-sd

    Let us know if there are any questions/clarification we can provide.

    Thanks, Andreas

  • Hello Andreas

    Thanks for response. So I created .ubifs image using Yocto. As far I understand this image contains all necessary objects such as Image, device tree and file system. I created it by adding this line to my yocto image recipe:

    IMAGE_FSTYPES += " ubifs"

    Next in U-Boot prompt I executed those commands

    => sf probe
    => tftp ${loadaddr} tiboot3.bin
    => sf update $loadaddr 0x0 $filesize
    => tftp ${loadaddr} tispl.bin
    => sf update $loadaddr 0x100000 $filesize
    => tftp ${loadaddr} u-boot.img
    => sf update $loadaddr 0x300000 $filesize

    and finally load my image:

    tftp ${loadaddr} texas-image.rootfs.ubifs

    sf update $loadaddr 0x800000 $filesize

    Then run U-Boot from NOR memory and in command prompt set:

    setenv bootargs console=${console} ${optargs} root=ubi0:rootfs rw ubi.mtd=ospi.rootfs rootfstype=ubifs rootwait=1

    Now I belive that I need to load kernel and device tree to RAM but I don't know exact addresses of partitions in NOR memory where resides kernel code, device tree. I don't now how Yocto prepared this image. Do you know how can I extract those informations from generated ubifs image? Or maybe my approach is completely wrong?
    sf probe; sf read ${kernel_addr_r} 0x800000 <???>; sf read ${fdtaddr} <???> <???>; run run_kern

  • Hello Jakub,
    Referring to Andreas's reply, you may want to refer to the following portion of the referenced e2e post:
    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1018036/am6442-how-to-create-ospi-rootfs-ubifs-and-boot-linux-from-ospi-without-sd/3769546#3769546
    "I'm able to have full OSPI boot on AM64x EVM using SDK 7.3.1, and summarizing the steps for your reference:
    1. Re-partition OSPI MTD partitions
    There are 7 partitions in kernel in SDK 7.3.1 as listed below:
    ...
    I re-partition OSPI by modifying "mtdparts" bootargs as listed below:
    ...
    Where the two additional fixed partitions are added for "ospi.dtb" and "ospi.kernel". Refer to the attached log file "am6_mtdinfo_ospi.txt" for more details.
    By doing so, it is possible to load the kernel/dtb to DDR from OSPI using "sf..." cmd @u-boot instead of accessing them from "ospi.rootfs" under UBI.
    ...

    2. Generate UBIFS/UBI rootfs files......"

    Another e2e post may be helpful on customizing MTD partitions in the following e2e:
    - One option to load the boot environments from OSPI instead before loading/launching kernel/dtb from the selected boot media
    e2e.ti.com/.../3968228

    Best,
    -Hong