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.

TMDXIDK5718: QSPI NOR Flash booting

Part Number: TMDXIDK5718
Other Parts Discussed in Thread: AM5748, AM5718

Hi,

I am using board : TMDXIDKAM5718 ,

        SDK version: ti-processor-sdk-linux-am57xx-evm-06.03.00.106 and

        linux version: linux-4.19.94

 I am worked on SD card booting its is working fine.

now i want work on qspi nor flash boot. i am not getting how to load(write) the code to NOR Flash(S25FL256).

could you please any one share me the procedure of NOR FLASH booting.

Thanks and Regards 

Chandana

  • Hi Chandana,

    HW modification needed for AM5718-IDK to enable QSPI booting & the flashing instructions:

    SPI Enablement in SDK 6.03:

    in the link: https://e2e.ti.com/support/processors/f/processors-forum/959283/faq-ccs-am5728-am57xx-boot-modes-supported

    Please resolve if the above has all the information you needed.

    - Keerthy

  • Hi keerthy

    thanks for the response.

    HW modification is not required for TMDXIDKAM5718 board right.  

    The AM571x IDK EVM is configured by default to 0x8106 to enable UBOOT/Linux boot from the SDCARD.
    The secondary boot device selected by this boot mode is QSPI1.

    I tried below commands to burn the MLO/U-boot.img to QSPI

    U-Boot # mmc rescan
    U-Boot # fatload mmc 0 ${loadaddr} u-boot.bin
    U-Boot # sf probe 0
    U-Boot # sf erase 0x0 0x100000
    U-Boot # sf write ${loadaddr} 0x0 ${filesize}

    i got error based as below

    1. /ti/sdk/board-support/u-boot-2019.01+gitAUTOINC+333c3e72d3-g333c3e72d3# mmc rescan
    ERROR: unknown command 'rescan'

    2. /ti/sdk/board-support/u-boot-2019.01+gitAUTOINC+333c3e72d3-g333c3e72d3# fatload mmc 0.1 0x80008000 u-boot.bin
    fatload: command not found

    could you please help me to fix this issue.

    thanks and regards

    Chandana

  • Chandana,

    You need to try those commands on target & not on PC :-).

    Boot to u-boot prompt on AM5718-IDK & try the above commands.
    You cannot use PC to flash using the above commands.

    Best Regards,
    Keerthy

  • Hi keerthy,

    thanks for response.

    i tried in target

    but i have same issue 

    root@am57xx-evm:~# fatload mmc 0.1 0x80008000 MLO
    -sh: fatload: command not found

    thanks and regards

    chandana

  • Chandana,

    In the Target please halt at the 'u-boot' prompt. You can not execute the commands at the kernel prompt.

    - Keerthy

  • Hi keerthy

    thank you for response.

    it's working.

    i have some question as below. 

    1. how to load code kernel image (rootfs) and .dtb file ?

    2. how load the code to NOR flash through Ethernet cable? 

    thanks and regards 

    Chandana

  • Hi Chandana,

    Please look at: software-dl.ti.com/.../Foundational_Components_U-Boot.html

    Section:

    Booting from QSPI from u-boot

    The default environment does not contain a QSPI boot command. The following example uses the partition table found in the kernel.

    U-Boot # sf probe 0
    U-Boot # sf read ${loadaddr} 0x1e0000 0x800000
    U-Boot # sf read ${fdtaddr} 0x140000 0x80000
    U-Boot # setenv bootargs console=${console} root=/dev/mtdblock19 rootfstype=jffs2
    U-Boot # bootz ${loadaddr} - ${fdtaddr}

    You can write to QSPI from u-boot itself.

    Best Regards,
    Keerthy

  • hi keerthy,

    thank for the information.

    i tried this u boot image is booting but kernel image is not booting 

    i got this error 

    Wrong Image Format for bootm command
    ERROR: can't get kernel image!  

    thanks and regards

    Chandana

  • Chandana,

    Flashing kernel(zImage) to QSPI from u-boot prompt:

    sf probe 0
    fatload mmc 0 0x82000000 zImage

    sf erase 1e0000 800000;
    sf write 82000000 1e0000 800000;

    Flashing dtb file to QSPI


    fatload mmc 0 0x83000000 am571x-idk.dtb
    sf erase 140000 80000;

    sf write 0x83000000 0x140000 0x80000

    setenv bootargs console=${console} root=/dev/mtdblock19 rootfstype=jffs2
    bootz ${loadaddr} - ${fdtaddr}


    Question from my side: Where do you want to host your file system? QSPI memory will not fit the entire file system.
    Are you keeping it SD Card?

    Best Regards,
    Keerthy

  • Hi keerthy 

    sorry for the late response.

    thank you for the information.

    at present in SD card only. but in custom boot SD card is not there where we host the file system?

    thanks and regards

    chandana

  • Hi Chandana,

    Do you have eMMC on your custom board?

    - Keerthy

  • Hi keerthy 

    yes , eMMC is there. but how to communicate between nor and emmc.

    one more qn: how to enable qspi flash in u-boot-2019.01+gitAUTOINC+333c3e72d3-g333c3e72d3.

    thanks and regards 

    chandana

  • one more qn: how to enable qspi flash in u-boot-2019.01+gitAUTOINC+333c3e72d3-g333c3e72d3.

    I do not understand this question. You already have u-boot booting from the QSPI flash so it is already enabled?

    yes , eMMC is there. but how to communicate between nor and emmc.

    What do you mean by communicating between NOR and eMMC?

    - Keerthy

  • Hi keerthy,

    thank you for reply 

    1.I flash uboot image and MLO but its still waiting for SD card so i am asked where to enable to cross check its enabled or not 

    issue is as below

    U-Boot SPL 2019.01-g323d51410c-dirty (Apr 22 2021 - 11:04:24 +0530)
    DRA722-GP ES2.0
    no pinctrl state for default mode
    ** Unable to read file dra7-ipu1-fw.xem4 **
    Firmware loading failed
    Trying to boot from MMC1
    no pinctrl state for default mode
    Loading Environment from FAT... *** Warning - bad CRC, using default environment

    Loading Environment from MMC... *** Warning - bad CRC, using default environment

    2. If i load the file system in emmc then how it will work in booting process.

    3. Can i get uboot ccs debug procedure? 

    thanks & regards

    Chandana

  • Can i get uboot ccs debug procedure? 

    Chandana,

    So QSPI boot is not working.

    http://software-dl.ti.com/processor-sdk-linux/esd/docs/06_03_00_106/linux/How_to_Guides/Hardware_Setup_with_CCS/TMDXIDK5728_Hardware_Setup.html

    Check the section: 

    Connecting IDK EVM to Code Composer Studio

    AM572x and AM571x should be similar.

    - Keerthy

  • Hi Keerthy, 

    Thanks for your information 

    Yes QSPI booting is not work.

    In menuconfig I tried enabling QSP flash but it's not working.

    Where to enable  QSPI in uboot?  

    Thanks and regards 

    Chandana

  • Hi Chandana,

    I believe you have not flashed the images correctly on to your IDK.
    Here is what i tried on my am574x-idk. The same should work dor am571x-idk:

    => mmc rescan
    => fatload mmc 0 ${loadaddr} MLO
    157799 bytes read in 16 ms (9.4 MiB/s)
    => sf probe 0
    > : Detected s25fl256s1 with page size 256 Bytes, erase size 64 KiB, total 32 MiB
    =>
    => sf erase 0x00000 0x200000
    SF: 2097152 bytes @ 0x0 Erased: OK
    => sf write ${loadaddr} 0x00000 ${filesize}
    device 0 offset 0x0, size 0x26867
    SF: 157799 bytes @ 0x0 Written: OK
    => fatload mmc 0 ${loadaddr} u-boot.img
    1445892 bytes read in 131 ms (10.5 MiB/s)
    => sf write ${loadaddr} 0x40000 ${filesize}
    device 0 offset 0x40000, size 0x161004
    SF: 1445892 bytes @ 0x40000 Written: OK
    
    

    After that i removed the SD card from my board. Below is the bootlog from QSPI

    U-Boot SPL 2019.01-g333c3e72d3 (Apr 20 2020 - 04:15:00 +0000
                                                                DRA762-GP ES1.0 ABZ package
    no pinctrl state for default mod
                                    Card did not respond to voltage select!
    Firmware loading fail
    Trying to boot from SPI
    Loading Environment from FAT... no pinctrl sta for default mode
    Card did not respond to voltage select!
    Loading Environment fm MMC... *** Warning - bad CRC, using default environment



    U-Boot 2019.01-g333c3e72d3 (Apr 20 2020 - 04:15:00 +0000)
    CPU  : DRA762-GP ES1.0 ABZ package
    Model: TI AM5748 IDK
    Boa: AM574x IDK REV 1.0C
    DRAM:  2 GiB
    MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
    Loading Environment from FAT... MMC: no card present
    Loading Enviroent from MMC... *** Warning - bad CRC, using default environment

    am57x_idk_lcd_detect: Failed to get I2C device 0/56 (ret 1)
    N:   
    Warning: ethernet@48484000 using MAC address from ROM
    eth0:thernet@48484000
    Hit any key to stop autoboot:  0

    Please try and let me know. No need to enable anything additional for QSPI boot on u-boot.
    Release binaries already have everything needed for QSPI boot.

    Regards,
    Keerthy

  • Hi keerthy,

    thank yo so much for reply,

    i have flash as below

    ******************************************************************************************

    => mmc rescan
    => fatload mmc 0 ${loadaddr} MLO
    157415 bytes read in 11 ms (13.6 MiB/s)
    => sf probe 0
    SF: Detected s25fl256s1 with page size 256 Bytes, erase size 64 KiB, total 32 MiB
    => sf erase 0x00000 0x200000
    SF: 2097152 bytes @ 0x0 Erased: OK
    => sf write ${loadaddr} 0x00000 ${filesize}
    device 0 offset 0x0, size 0x266e7
    SF: 157415 bytes @ 0x0 Written: OK
    => fatload mmc 0 ${loadaddr} u-boot.img
    1445844 bytes read in 95 ms (14.5 MiB/s)
    => sf write ${loadaddr} 0x40000 ${filesize}
    device 0 offset 0x40000, size 0x160fd4
    SF: 1445844 bytes @ 0x40000 Written: OK

    **********************************************************************************************

    i removed my sd card then boot log is as below .

    same bootlog i got before flashing kernal and dtb file  

    ********************************************************************************

    U-Boot 2019.01-g323d51410c-dirty (Apr 26 2021 - 15:48:14 +0530)

    CPU : DRA722-GP ES2.0
    Model: TI AM5718 IDK
    Board: AM571x IDK REV 1.CA
    DRAM: 1 GiB
    MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
    Loading Environment from FAT... MMC: no card present
    Loading Environment from MMC... *** Warning - bad CRC, using default environment

    Net:
    Warning: ethernet@48484000 using MAC address from ROM
    eth0: ethernet@48484000
    Hit any key to stop autoboot: 0
    MMC: no card present
    MMC: no card present
    MMC: no card present
    MMC: no card present
    Trying to boot Linux from eMMC ...
    switch to partitions #0, OK
    mmc1(part 0) is current device
    SD/MMC found on device 1
    ** No partition table - mmc 1 **
    ** No partition table - mmc 1 **
    Trying to boot Android from eMMC ...
    switch to partitions #0, OK
    mmc1(part 0) is current device
    mmc - MMC sub system

    Usage:
    mmc info - display info of the current MMC device
    mmc read addr blk# cnt
    mmc write addr blk# cnt
    mmc erase blk# cnt
    mmc rescan
    mmc part - lists available partition on current mmc device
    mmc dev [dev] [part] - show or set current mmc device [partition]
    mmc list - lists available devices
    mmc hwpartition [args...] - does hardware partitioning
    arguments (sizes in 512-byte blocks):
    [user [enh start cnt] [wrrel {on|off}]] - sets user data area attributes
    [gp1|gp2|gp3|gp4 cnt [enh] [wrrel {on|off}]] - general purpose partition
    [check|set|complete] - mode, complete set partitioning completed
    WARNING: Partitioning is a write-once setting once it is set to complete.
    Power cycling is required to initialize partitions after set to complete.
    mmc bootbus dev boot_bus_width reset_boot_bus_width boot_mode
    - Set the BOOT_BUS_WIDTH field of the specified device
    mmc bootpart-resize <dev> <boot part size MB> <RPMB part size MB>
    - Change sizes of boot and RPMB partitions of specified device
    mmc partconf dev [boot_ack boot_partition partition_access]
    - Show or change the bits of the PARTITION_CONFIG field of the specified device
    mmc rst-function dev value
    - Change the RST_n_FUNCTION field of the specified device
    WARNING: This is a write-once field and 0 / 1 / 2 are the only valid values.
    mmc setdsr <value> - set DSR register value

    Wrong Image Format for bootm command
    ERROR: can't get kernel image!

    **************************************************************************************

    after this i tried Flashing kernel(zImage) to QSPI from u-boot prompt:

    **********************************************************************************

    sf probe 0
    fatload mmc 0 0x82000000 zImage

    sf erase 1e0000 800000;
    sf write 82000000 1e0000 800000;
    fatload mmc 0 0x83000000 am571x-idk.dtb
    sf erase 140000 80000;

    sf write 0x83000000 0x140000 0x80000

    setenv bootargs console=${console} root=/dev/mtdblock19 rootfstype=jffs2
    bootz ${loadaddr} - ${fdtaddr}

    *************************************************************************
    after loading Zimage(kernel) and .dtb file
    i got boot log as below
    **************************************************
    U-Boot SPL 2019.01-g323d51410c-dirty (Apr 22 2021 - 11:04:24 +0530)
    DRA722-GP ES2.0
    no pinctrl state for default mode
    ** Unable to read file dra7-ipu1-fw.xem4 **
    Firmware loading failed
    Trying to boot from MMC1
    no pinctrl state for default mode
    Loading Environment from FAT... *** Warning - bad CRC, using default environment

    Loading Environment from MMC... *** Warning - bad CRC, using default environment

    **************************************************************************************

    thanks and regards
    chandana


  • Chandana,

    Once you remove SD card, you are able to boot from QSPI? Can you confirm that? Let us get to u-boot prompt first on QSPI
    & then look at the next stage.

    - Keerthy

  • Hi keerthy,

    after removing SD card boot log is as below

    U-Boot 2019.01-g323d51410c-dirty (Apr 26 2021 - 15:48:14 +0530)

    CPU : DRA722-GP ES2.0
    Model: TI AM5718 IDK
    Board: AM571x IDK REV 1.CA
    DRAM: 1 GiB
    MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
    Loading Environment from FAT... MMC: no card present
    Loading Environment from MMC... *** Warning - bad CRC, using default environment

    Net:
    Warning: ethernet@48484000 using MAC address from ROM
    eth0: ethernet@48484000
    Hit any key to stop autoboot: 0
    MMC: no card present
    MMC: no card present
    MMC: no card present
    MMC: no card present
    Trying to boot Linux from eMMC ...
    switch to partitions #0, OK
    mmc1(part 0) is current device
    SD/MMC found on device 1
    ** No partition table - mmc 1 **
    ** No partition table - mmc 1 **
    Trying to boot Android from eMMC ...
    switch to partitions #0, OK
    mmc1(part 0) is current device
    mmc - MMC sub system

    Usage:
    mmc info - display info of the current MMC device
    mmc read addr blk# cnt
    mmc write addr blk# cnt
    mmc erase blk# cnt
    mmc rescan
    mmc part - lists available partition on current mmc device
    mmc dev [dev] [part] - show or set current mmc device [partition]
    mmc list - lists available devices
    mmc hwpartition [args...] - does hardware partitioning
    arguments (sizes in 512-byte blocks):
    [user [enh start cnt] [wrrel {on|off}]] - sets user data area attributes
    [gp1|gp2|gp3|gp4 cnt [enh] [wrrel {on|off}]] - general purpose partition
    [check|set|complete] - mode, complete set partitioning completed
    WARNING: Partitioning is a write-once setting once it is set to complete.
    Power cycling is required to initialize partitions after set to complete.
    mmc bootbus dev boot_bus_width reset_boot_bus_width boot_mode
    - Set the BOOT_BUS_WIDTH field of the specified device
    mmc bootpart-resize <dev> <boot part size MB> <RPMB part size MB>
    - Change sizes of boot and RPMB partitions of specified device
    mmc partconf dev [boot_ack boot_partition partition_access]
    - Show or change the bits of the PARTITION_CONFIG field of the specified device
    mmc rst-function dev value
    - Change the RST_n_FUNCTION field of the specified device
    WARNING: This is a write-once field and 0 / 1 / 2 are the only valid values.
    mmc setdsr <value> - set DSR register value

    Wrong Image Format for bootm command
    ERROR: can't get kernel image!

    but i am not sure that qspi is enabled because MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1 .

    thanks & regards 

    chandana

  • but i am not sure that qspi is enabled because MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1 .

    If you have removed SD card and its booting to u-boot it has to be some flash :-)!


    In you bootlog try to check if SPL has some prints like:

    U-Boot SPL 2019.01-g333c3e72d3 (Apr 20 2020 - 04:15:00 +0000
                                                                DRA762-GP ES1.0 ABZ package
    no pinctrl state for default mod
                                    Card did not respond to voltage select!
    Firmware loading fail
    Trying to boot from SPI

    Let me know.

    - Keerthy

  • Hi keerthy,

    thank you for reply.

    bootlog as below :

    U-Boot SPL 2019.01-g323d51410c-dirty (Apr 29 2021 - 10:43:34 +0530)
    DRA722-GP ES2.0
    no pinctrl state for default mode
    Card did not respond to voltage select!
    Firmware loading failed
    Trying to boot from SPI
    Loading Environment from FAT... no pinctrl state for default mode
    Card did not respond to voltage select!
    Loading Environment from MMC... *** Warning - bad CRC, using default environment 

    Regards

    chandana

  • Chandana,

    We have QSPI booting to u-boot prompt from your log. I believe the above log is with SD card removed.
    Are you able press enter and get to u-boot prompt?

    - Keerthy

  • Hi keerthy,

    yes,above log is witn SD card removed.

    no, i am not able to press enter and get to u-boot prompt.

    thanks and regards

    Chandana

  • i removed my sd card then boot log is as below .

    same bootlog i got before flashing kernal and dtb file  

    ********************************************************************************

    U-Boot 2019.01-g323d51410c-dirty (Apr 26 2021 - 15:48:14 +0530)

    CPU : DRA722-GP ES2.0
    Model: TI AM5718 IDK
    Board: AM571x IDK REV 1.CA
    DRAM: 1 GiB
    MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
    Loading Environment from FAT... MMC: no card present
    Loading Environment from MMC... *** Warning - bad CRC, using default environment

    Net:
    Warning: ethernet@48484000 using MAC address from ROM
    eth0: ethernet@48484000
    Hit any key to stop autoboot: 0

    You need press enter at that point. I believe that is the log you got from QSPI boot.

    - Keerthy

  • Hi keerthy,

    thanks for reply.

    yes , i got above boot log.

    You need press enter at that point. I believe that is the log you got from QSPI boot.

    1.According to this u-boot is booting from qspi?

    2. how to boot kernel image and how to load the rootfs?

    thanks & Regards

    chandana

  • 1.According to this u-boot is booting from qspi?

    Chandana,

    First can you confirm that after removing SD card and once you get :

    Trying to boot from SPI

    Can you get to u-boot prompt:

    You need to press enter after you get this message:


    eth0: ethernet@48484000
    Hit any key to stop autoboot: 0

    Please confirm that and then for kernel. Please let me know where you intend to keep you file system. QSPI is small to host the
    full fledged file system.

    - Keerthy

  • hi keerthy,

    thanks for response.

    First can you confirm that after removing SD card and once you get :

    i am conforming that after removing SD card i  got below boot log .

    U-Boot 2019.01-g323d51410c-dirty (Apr 29 2021 - 10:43:34 +0530)

    CPU : DRA722-GP ES2.0
    Model: TI AM5718 IDK
    Board: AM571x IDK REV 1.CA
    DRAM: 1 GiB
    MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
    Loading Environment from FAT... MMC: no card present
    Loading Environment from MMC... *** Warning - bad CRC, using default environment

    Net:
    Warning: ethernet@48484000 using MAC address from ROM
    eth0: ethernet@48484000
    Hit any key to stop autoboot: 0
    =>

    Can you get to u-boot prompt:

    when i booted SPL code only that time i got below log. 

    i con't enter to boot prompt

    U-Boot SPL 2019.01-g323d51410c-dirty (Apr 29 2021 - 10:43:34 +0530)
    DRA722-GP ES2.0
    no pinctrl state for default mode
    Card did not respond to voltage select!
    Firmware loading failed
    Trying to boot from SPI
    Loading Environment from FAT... no pinctrl state for default mode
    Card did not respond to voltage select!
    Loading Environment from MMC... *** Warning - bad CRC, using default environment

    You need to press enter after you get this message:

    according to SPL booting 

    i tried to enter but it is not enter boot prompt. 

    eth0: ethernet@48484000
    Hit any key to stop autoboot: 0

    yes when i booted u-boot that time i will get autoboot and i can get in to u-boot prompt successfully.

    Please let me know where you intend to keep you file system. QSPI is small to host the
    full fledged file system.

    at present i intend to keep file system in SD card. but in custom board i have to keep in NAND flash.

    thanks & regards 

    Chandana 

  • yes when i booted u-boot that time i will get autoboot and i can get in to u-boot prompt successfully.

    This is with SD Card inserted? If not then you are able to boot to u-boot prompt(Not Kernel Prompt) with QSPI.

    Can you confirm the same?

    - Keerthy

  • Hi keerthy,

    This is with SD Card inserted? If not then you are able to boot to u-boot prompt(Not Kernel Prompt) with QSPI.

    this is not with SD card inserted. 

    thank you for conforming U-BOOT is working.

     How to boot kernel image?

    in evm board sd card is there, but in custom SD Card is not there to store file system.

    could you please tell me the procedure to boot kernel image(zimage and .dtb) files .

    thanks and regards
    Chandana

  • Chandana,

    On EVM board you can quickly try one experiment. With SD Card removed boot to u-boot prompt by pressing enter.
    So you boot using OSPI. Then insert SD card which has the file system & then use that to boot to kernel.

    See if that is working.

    - Keerthy

  • Hi keerthy,

    thanks for information.

    On EVM board you can quickly try one experiment. With SD Card removed boot to u-boot prompt by pressing enter.
    So you boot using OSPI. Then insert SD card which has the file system & then use that to boot to kernel.

    I tried this it is working . but  in custom board SD Card is not there to store file system. 

    NAND flash is there in custom board.

    could you please share the procedure for kernel image booting from NAND flash and store file system in NAND flash.

    thanks and regards

    Chandana.

  • Chandana,

    I request you to close this thread. As QSPI boot is functional on your side.
    Please click on Verify answer. Request you to open a new thread for having file system
    in eMMC as your custom board does not have MMC-SD.

    Best Regards,
    Keerthy

  • Hi keerthy,

    thanks for yours support.

    i will open new thread.

    thanks & regards 

    Chandana