Because of the holidays, TI E2E™ design support forum responses will be delayed from Dec. 25 through Jan. 2. Thank you for your patience.

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.

Linux/AM5718: SPI boot

Part Number: AM5718

Tool/software: Linux

I am using AM5718 evm board and wanted to try out SPI Boot. The files ‘MLO.byteswap’ and  ‘u-boot.img’ was built after adding  DFU configuration in menuconfig .kernel image 'zImage-am57xx-evm.bin' was taken from the prebuilt  folder provide in SDK package ti-processor-sdk-linux-am57xx-evm-05.02.00.10.By booting from SD card I got the u-boot prompt.At the prompt I entered the following commands

U-Boot # mmc rescan
U-Boot # sf probe 0
U-Boot # sf erase 0 +80000
U-Boot # fatload mmc 0 ${loadaddr} MLO.byteswap
U-Boot # sf write ${loadaddr} 0 ${filesize}
U-Boot # fatload mmc 0 ${loadaddr} u-boot.img
U-Boot # sf write ${loadaddr} 0x20000 ${filesize}
U-Boot # sf erase 80000 +${spiimgsize}
U-Boot # fatload mmc 0 ${loadaddr} zImage
U-Boot # sf write ${loadaddr} ${spisrcaddr} ${filesize}

After finishing flashing to spi, I removed sd card and tried rebooting.but nothing is happening(neither spi boot nor sd card boot). Is there any specific SYSBOOT configuration for enabling SPI boot the current SYSBOOT configuration is SYSBOOT 5 R458 not populated and R439 Connected .Do i need to change Sys Boot Pin configuration for SPI booting .Also should any configuration be done in menuconfig  in u-boot, So as to enable SPI booting.Please advise on how to proceed further.

 



  • Hello Sree,

    Please refer to section "33.2.4.4 Booting Device Order Selection" in the TRM. For QSPI, we have the following two options: QSPI_1: 1-bit SPI flash memories or QSPI_4: 4-bit (Quad) SPI flash memories (Table 33-9 has the SYSBOOT configuration). Based on your test, please refer to the section "Writing to QSPI from U-Boot" in the following TI link.

    Regards,

    Krunal

  • Hi Thanks for your quick reply.  I followed the link you mentioned and was able to write  QSPI_1 but i am getting the following message on minicom

    U-Boot SPL 2018.01-00558-gca1e85ecb5-dirty (Mar 08 2019 - 11:22:33)
    DRA722-GP ES2.0
    Trying to boot from SPI
    Invalid bus 0 (err=-19)
    SPI probe failed.
    SPL: failed to boot from all boot devices
    ### ERROR ### Please RESET the board ###

    How to resolve this issue.

  • I got QSPI boot working in this post:

    e2e.ti.com/.../2839929

    Please try to replicate my steps, e.g. at least for starters flash from Linux rather than u-boot.
  • Hello Sree,

    I will be closing the ticket and if you are still experiencing issues, please feel free to open the ticket in the future.

    Regards,
    Krunal
  • Hi sorry for the delayed reply. I followed the link you mentioned and was able to boot QSPI_1, but only with the prebuilt MLO and u-boot.img, could u guide me on how to build MLO and u-boot.img for Qspi boot also how to boot Kernal and filesystem to MMC device.  Currently the QSPI_1 boot stops at  

    MMC: no card present                                                            

    MMC: no card present                                                            

    MMC: no card present                                                            

    MMC: no card present                                                            

    switch to partitions #0, OK                                                    

    mmc1(part 0) is current device                                                  

    SD/MMC found on device 1                                                        

    ** Invalid partition 2 **                    

    Please advise on how to proceed further, Thanking You

  • Sree Hari said:
    could u guide me on how to build MLO and u-boot.img for Qspi boot

    1. Go to the root directory of the Linux SDK.

    2. Type "make u-boot".

    That will build MLO and u-boot.img.  Make sure you add in the 6 additional config options that I mentioned in am57xx_evm_defconfig.

    Sree Hari said:
    also how to boot Kernal and filesystem to MMC device.

    Go to <sdk-root>/bin and you will see a script called create-sdcard.sh.  Run that script with "sudo" permissions.  You want to choose to create a card using prebuilt file system.  Choose the tisdk-rootfs-* image (not the tisdk-docker image).

  • Hi i have tried the make u-boot  command but the following error messages occurred

    Could u specify the changes in 'menuconfig' for Qspi also how to boot Kernel and filesystem to 'eMMC chip' in AM5718. While booting from Qspi using the prebuilt MLO and u-boot.img the following error occurs

    Please advise on how to proceed further, Thank You  

  • Hi Sree,

    Yes, the changes Brad mentioned could be added through menuconfig. If you are modifying the file am57xx_evm_defconfig, please run "make u-boot" from the ti-processor-sdk-linux-am57xx-evm-05.02.00.10 directory.

    Regards,
    Krunal

  • Hi Krunal,

    I was able to build the MLO and u-boot.img , and i followed these steps as Brad mentioned

      After removing the SD card from board and powering back up, My Output is

     So could you explain how to write the Kernel Image to eMMC Memory, Thank You

  • Hello,

    Please refer to the following thread as a reference.

    Regards,

    Krunal

  • Hi Krunal,
    Thanks for the reply,

    but i would like to know  how to write the kernel image in Qspi, what to do next after the Error: can't get kernel image, I have tried repeating Brads steps and writing   zImage-am57xx-evm.bin from the prebuilt folder (SDK) to mtd5 but still facing the same error mentioned above. My goal is to write the Kernel and Filesystem in Qspi,  Is zImage-am57xx-evm.bin the correct Kernel image and where is the Filesystem to write located in SDK , Thanks in Advance

  • Hi Krunal,
    Thanks for the reply

    but i would like to know  how to write the kernel image in Qspi, what to do next after the Error: can't get kernel image, I have tried repeating Brads steps and writing   zImage-am57xx-evm.bin from the prebuilt folder (SDK) to mtd5 but still facing the same error mentioned above. My goal is to write the Kernel and Filesystem in Qspi,  Is zImage-am57xx-evm.bin the correct Kernel image and where is the Filesystem to write located in SDK , Thanks in Advance

  • Sree,

    There are two independent pieces to what you're doing:

    1. Booting u-boot from SPI.
    2. Booting kernel.

    We have solved issue #1. For issue #2, I'm not entirely clear where you're trying to boot from. Are you trying to put the kernel into QSPI or eMMC? While the thread is focused on SPI, you keep including screenshots talking about MMC which is confusing me as to your intent.

    At this point your issue revolves around getting the correct bootcmd programmed into u-boot.

    Brad
  • Hi Brad,

    Sorry for the confusion my goal is  booting uboot  from SPI and booting the kernel from eMMC. Booting uboot from  SPI  is solved .Now the board is booting from SPI( a screenshot is attached below).

    So  could you explain how to write kernel image to eMMC and  proceed further, Thanking You  

  • Sree Hari said:
    So  could you explain how to write kernel image to eMMC and  proceed further, Thanking You  

    1. Use an SD card to boot to Linux.

    2. Use the script from this post to format the eMMC:

    https://e2e.ti.com/support/processors/f/791/p/715629/2640582#2640582

    3. Untar your root file system into the eMMC.

  • Hi Brad,
           The booting was successful now the board boots from SPI and starts the Kernel image from eMMC Thank you, But the requirement is to Boot U-boot from SPI and Kernel from eMMC without entering into Kernel from a bootable SD card.Could you guide me how to flash from U-boot rather than Linux using an SD card, Thanking You

  • Sree,

    Is this for your production line? Or is this some kind of field update procedure? Why is there a requirement that you cannot enter into a kernel from SD card? Can you enter into a kernel from tftpboot and NFS mount?

    Personally, it seems the cleanest and most robust to do this flashing from Linux. You will have no ability to create file systems with u-boot. It only can do raw writes to flash. Now that said, one possibility might be to create your file system in advance on your Linux PC along these lines:

    unix.stackexchange.com/.../create-file-image-container

    However, I would expect the file system to be large, so you might still have an issue with respect to where you get the file system, etc. Normally in u-boot you would first load a file into memory and then write it to memory, though it will get a lot more complicated if you cannot fit the entire *.img file into RAM in order to write it to the eMMC.

    Best regards,
    Brad
  • Dear Brad,
    We want to explore the method to be adopted for production line flashing of kernel into our system. We will not have an SD card interface for final version of our product. Our aim is to load kernal to a fresh board using following steps
    1. Load uBoot to QSPI memory via DFU boot
    2. Load kernel to eMMC (not using SD card)
    Similarly we would like to have infield update for Kernel using external interfaces (Ethernet /USB) . We plan to use a GPIO to indicate to uBOOt that a Kernel update is to be performed.

    Which technique to adopt you may suggest. Once uBoot is loaded to QSPI , which interface can be used to load kernel ??
    From uBoot using tftp or same USB (DFU) interface can i load kernel to eMMC??
    From your post above it looks like it may not be possible to load Kernel and file system due to file size. Can i load kernel first execute it and use it to burn the file system??
  • Sree,

    Sorry, I missed your response initially. 

    Sree Hari said:
    We will not have an SD card interface for final version of our product. Our aim is to load kernal to a fresh board using following steps
    1. Load uBoot to QSPI memory via DFU boot
    2. Load kernel to eMMC (not using SD card)

    I don't understand item #1.  What do you mean by "DFU" boot.  I only recognize "DFU boot" within the context of u-boot, but on a blank board DFU boot won't be available.  You need to use one of the ROM boot modes.  For example, you could do something like:

    • Temporarily override boot pins to force UART boot mode
    • Load MLO and subsequently u-boot via the UART

    At that point you'll be at a u-boot command prompt and it will be fully under your control how to proceed.  My suggestion would be to perform tftpboot of Linux kernel and NFS mount of file system.  Then from within Linux you would be able to write to QSPI and eMMC.

    Sree Hari said:
    From uBoot using tftp or same USB (DFU) interface can i load kernel to eMMC??

    It is easy to transfer the kernel via tftp since it fits easily into RAM.  It's a tougher question when it comes to the complete file system.  If you turn your file system into a binary image that u-boot can write to flash, will that image fit in RAM?  In my view, booting all the way to Linux and using NFS mount solves all these problems.  Even if your file system is huge (e.g. gigabytes), you can directly copy from NFS file system into eMMC over the network.