How to update the system image (sysimg) in bootloader u-boot via networt by tftp?

  • By adopting the new picocore platform we need to update the system image created by buildroot or yocto via network by tftp. Because on your current platform we use a nand flash as memory, the way to update the newly mmc memory the update process is different.



    How to update the system image (sysimg) in bootloader u-boot via networt by tftp?

  • Hi,


    after some research unter [1] and [2] with the documentation under [3] I was able to successfully update the mmc memroy via tftp (see [4]).


    Thanks. Case closed.


    [1]:

    https://gist.github.com/pirate…6a7303404a0793533de38672f


    [2]:

    https://e2e.ti.com/support/pro…ot-0-partition-using-tftp


    [3]:

    https://docs.u-boot.org/en/latest/usage/cmd/mmc.html


    [4]:

  • Hello,


    it basically works like descried for USB Stick in Chapter 7.2 Installation to eMMC in
    https://www.fs-net.de/assets/d…n/LinuxOnFSBoards_eng.pdf


    The main difference is, that you can't split the sysimg into smaller parts with the tftp command.


    If your sysimg fits in your DRAM at once you can simply run

    Code
    1. tftp emmc-fsimx8mp.sysimg
    2. # Round up. eMMC Blocksize is 512
    3. setexpr filesize_blk ${filesize} + 1ff
    4. setexpr filesize_blk ${filesize_blk } / 200
    5. # Select user partition
    6. mmc dev 2 0
    7. # Write from the beginning if the user partition
    8. # size is given in blocks
    9. mmc write ${loadaddr} 0 ${filesize_blk}


    If your sysimg is bigger than your DRAM, you will have to split it into smaller parts on your PC (e.g. using dd) and write the latter image-part to the respective offset (also given in blocksize).


    Your F&S Support Team

  • Hi.


    Thanks. Indeed, the documentation of F+S describes the TFTP option unter 7.2 Installation to eMMC:


    "Of course downloading these system images to the board using tftp like in the NAND case
    would theoretically also work. But unfortunately these system images are rather big and do
    not fit into RAM. And because tftp does not support downloading arbitrary parts of a file,
    this approach is typically not a valid option. In the following sections we will use an SD card
    or a USB pendrive to install these system images."



    What is the DRAM limit of the PicoCore™MX8MPr2?

  • Hello,


    that depends on your Variant

    The U-Boot allocate some memory at the end of the DRAM.

    You can check the memory address by running

    Code
    1. bdinfo

    in U-Boot and look for sp start.

    For i.MX8MP U-Boot allocates round about 38MB so the maximum sysimg size should be not more than YOUR_DRAM_SIZE - 38MB


    Your F&S Support Team

  • Hi.


    Unter [1] you can find the system variant.


    So I updated the following file. Does this mean the file did not fit into DRAM before I wrote it to eMMC?


    $ du -h emmc-fsimx8mp.sysimg

    68M emmc-fsimx8mp.sysimg

    $ ll emmc-fsimx8mp.sysimg -h

    -rw-r--r-- 1 brenkem domain_users 233M Apr 29 14:09 emmc-fsimx8mp.sysimg


    For every one who noticed a file size difference between du and ls, see [2].





    [1]:

    U-Boot 2021.04-F+S-fsimx8mp-Y2023.09 (Aug 31 2023 - 12:56:23 +0000) for F&S


    CPU: i.MX8MP[8] rev1.1, 1600 MHz (running at 1200 MHz)

    CPU: Industrial temperature grade (-40C to 105C)

    Reset: POR

    Model: PicoCoreMX8MPr2

    Board: PicoCoreMX8MPr2 Rev 1.10 (2x LAN, WLAN, eMMC, 1x DRAM)

    DRAM: 2 GiB

    TCPC: Vendor ID [0x1fc9], Product ID [0x5110], Addr [I2C2 0x52]

    MMC: FSL_SDHC: 0, FSL_SDHC: 2

    Env: Loading from MMC... OK

    In: serial

    Out: serial

    Err: serial

    SEC0: RNG instantiated

    ATF: fa25831

    CFG: Found at 0x918000

    NBoot: 2023.09

    Fastb: flash target is MMC:2

    Net: eth1: ethernet@30be0000, eth0: ethernet@30bf0000 [PRIME]

    Fastb: Normal fastboot

    Normal Boot

    Hit any key to stop autoboot: 0


    PicoCoreMX8MPr2 # printenv platform

    platform=picocoremx8mpr2

    PicoCoreMX8MPr2 # bdinfo

    boot_params = 0x0000000000000000

    DRAM bank = 0x0000000000000000

    -> start = 0x0000000040000000

    -> size = 0x0000000080000000

    flashstart = 0x0000000000000000

    flashsize = 0x0000000000000000

    flashoffset = 0x0000000000000000

    baudrate = 115200 bps

    relocaddr = 0x00000000bff15000

    reloc off = 0x000000007fd15000

    Build = 64-bit

    current eth = ethernet@30bf0000

    ethaddr = 00:05:51:07:55:83

    IP addr = 169.254.255.44

    fdt_blob = 0x00000000bdbf32b0

    new_fdt = 0x00000000bdbf32b0

    fdt_size = 0x000000000000cb00

    lmb_dump_all:

    memory.cnt = 0x1

    memory.size = 0x0

    memory.reg[0x0].base = 0x40000000

    .size = 0x80000000


    reserved.cnt = 0x1

    reserved.size = 0x0

    reserved.reg[0x0].base = 0xbdbf1eb0

    .size = 0x240e150

    arch_number = 0x00000000ffffffff

    TLB addr = 0x00000000bfff0000

    irq_sp = 0x00000000bdbf32a0

    sp start = 0x00000000bdbf32a0

    BOARD-CFG = 0x0000000000918000

    Early malloc usage: a448 / 15000


    [2]:

    https://askubuntu.com/question…nt-size-for-the-same-file