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.

SK-AM62P-LP: Writing and reading from OSPI fails

Part Number: SK-AM62P-LP
Other Parts Discussed in Thread: DRA829,

Tool/software:

Hello experts,

I am evaluating an SK-AM62P-LP evm board for our next gen device. We want to boot from OSPI as on the DRA829 SoC.

When I try to write and read from the OSPI I get failed results:

=> sf probe
SF: Detected s28hs512t with page size 256 Bytes, erase size 4 KiB, total 64 MiB


=> mtd list
List of MTD devices:
* nor0
  - device: flash@0
  - parent: spi@fc40000
  - driver: jedec_spi_nor
  - path: /bus@f0000/bus@fc00000/spi@fc40000/flash@0
  - type: NOR flash
  - block size: 0x1000 bytes
  - min I/O: 0x1 bytes
  - 0x000000000000-0x000004000000 : "nor0"
          - 0x000000000000-0x000000080000 : "ospi.tiboot3"
          - 0x000000080000-0x000000280000 : "ospi.tispl"
          - 0x000000280000-0x000000680000 : "ospi.u-boot"
          - 0x000000680000-0x0000006c0000 : "ospi.env"
          - 0x0000006c0000-0x000000700000 : "ospi.env.backup"
          - 0x000000800000-0x000003fc0000 : "ospi.rootfs"
          - 0x000003fc0000-0x000004000000 : "ospi.phypattern"


=> setenv dfu_alt_info ${dfu_alt_info_ospi_asb3}
=> pri dfu_alt_info
dfu_alt_info=tiboot3 raw 0x0 0x80000; tispl raw 0x80000 0x200000; u-boot raw 0x280000 0x400000; env raw 0x680000 0x40000; env.backup raw 0x6c0000 0x40000; manufacture raw 0x700000 0x40000; knut-settings raw 0x740000 0x40000; pmem raw 0x780000 0x40000; misc raw 0x7c0000 0x40000; secret raw 0x800000 0x40000; dfubootflag raw 0x3f80000 0x40000; phypattern raw 0x3fc0000 0x40000



=> dfu 0 sf 0:0


(sending files from host computer)


###############################################################################DOWNLOAD ... OK
Ctrl+C to exit ...
##################################################################################################################################################################################################################################################################################################################DOWNLOAD ... OK
Ctrl+C to exit ...
##################################################################################################################################################################################################################################################################################################################################################DOWNLOAD ... OK
Ctrl+C to exit ...
=> sf read 0x82000000 0 100
device 0 offset 0x0, size 0x100
SF: 256 bytes @ 0x0 Read: OK
=> md.b 82000000 100
82000000: 00 00 00 00 00 f0 ff ff ff ff ff ff ff ff ff ff  ................
82000010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff  ................
82000020: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff  ................
82000030: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff  ................
82000040: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff  ................
82000050: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff  ................
82000060: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff  ................
82000070: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff  ................
82000080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff  ................
82000090: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff  ................
820000a0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff  ................
820000b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff  ................
820000c0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff  ................
820000d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff  ................
820000e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff  ................
820000f0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff  ................


SDK version 10. (U-Boot 2024.04). I notice a difference from running the pre-built binaries from the SD-card:

=> sf probe
SF: Detected s28hs512t with page size 256 Bytes, erase size 256 KiB, total 64 MiB

The erase size is 256 KiB. On my (non working) build it is 4 KiB. This is U-Boot 2025.01

Best regards,

/Bo

  • Bo,

    The erase size is 256 KiB. On my (non working) build it is 4 KiB. This is U-Boot 2025.01

    Sounds like you have a working-good setup, based on SDK v10, correct?

    If you want to use U-Boot 2025.01, which version did you use? Are you using the `ti-u-boot-2025.01` branch of the TI U-Boot repo at https://git.ti.com/cgit/ti-u-boot/ti-u-boot/log/?h=ti-u-boot-2025.01 ?  This U-Boot branch is also what's used for the SDK v11.x series, and it should work. If you haven't tried it you should also try the latest  SDK v11.x image available for download at https://www.ti.com/tool/download/PROCESSOR-SDK-LINUX-AM62X/ for reference.

    Regards, Andreas

  • Hi Andreas,

    Sorry, I was not perfectly clear. I was on U-Boot 2024.04, which doesn't work to my satisfaction
    when building via Yocto. As I add our own functionality in U-Boot, the sNOR stops working. It
    responds fast as if it works, but nothing is ever written or read.

    Also, without adding any of our custom stuff, in U-Boot 2024.04 if I try to probe the sNOR flash several times
    I get this behaviour:

    Hit any key to stop autoboot:  0
    => sf probe
    SF: Detected s28hs512t with page size 256 Bytes, erase size 256 KiB, total 64 MiB
    => sf probe
    jedec_spi_nor flash@0: unrecognized JEDEC id bytes: ff, ff, ff
    Failed to initialize SPI flash at 0:0 (error 0)
    

    Whereas with the prebuild binaries, I can probe several times. My guess is that this is because
    of a soft reset issue that seems to be solved in 2025.01:

    => sf probe
    SF: Detected s28hs512t with page size 256 Bytes, erase size 256 KiB, total 64 MiB
    => sf probe
    SF: Detected s28hs512t with page size 256 Bytes, erase size 256 KiB, total 64 MiB
    => sf probe
    SF: Detected s28hs512t with page size 256 Bytes, erase size 256 KiB, total 64 MiB
    

    I will move to 2025.01 and see if that fixes my issues.

    Thanks,

    /Bo

  • Moving to 2025.01 was not an option so I worked a bit more on the 2024.04 and managed to get the
    reading and writing to the sNOR working.

    One issue for us is having to build different boot images for different boot scenarios. Adding the
    "am62x_a53_usbdfu.config" and the r5 counterpart makes dfu work, but the images are not suitable
    to flash to the serial NOR.

    Is there a way to build only one set of bootables (mainly tiboot3.bin) that would work for both usbdfu
    and xSPI boot modes? I don't mind removing other functionalty from the r5 SPI image since we do all
    of the heavy lifting in the main U-Boot image later on.

    Regards,

    /Bo

  • Is there a way to build only one set of bootables (mainly tiboot3.bin) that would work for both usbdfu
    and xSPI boot modes? I don't mind removing other functionalty from the r5 SPI image since we do all
    of the heavy lifting in the main U-Boot image later on.

    I'd recommend just trying it out. Space is very tight in tiboot3.bin due to device-internal SRAM size limitations so that will be your main/only real obstacle. Try removing all the the MMC stuff from the U-Boot SPL R5 config, this will usually free up a bunch of space.

    Regards, Andreas

  • Hi Andreas,

    Try removing all the the MMC stuff from the U-Boot SPL R5 config, this will usually free up a bunch of space.

    Most MMC stuff was already removed. I made this change:

    # CONFIG_SPL_MMC is not set
    # CONFIG_SPL_FS_FAT is not set
    # CONFIG_SPL_LIBDISK_SUPPORT is not set
    # CONFIG_SPL_MTD is not set
    - # CONFIG_SPL_SPI is not set
    # CONFIG_SPL_SYS_MALLOC is not set
    # CONFIG_CMD_GPT is not set
    # CONFIG_CMD_MMC is not set
    # CONFIG_CMD_FAT is not set
    # CONFIG_MMC_SDHCI is not set
    # CONFIG_DMA_CHANNELS is not set
    # CONFIG_TI_K3_NAVSS_UDMA is not set
    + # CONFIG_SPL_THERMAL is not set
    + # CONFIG_SPL_YMODEM_SUPPORT is not set
    

    This way I got a tiboot3.bin that works both for usb dfu and xSPI boot.

    If it looks ok to you this thread can be closed.

    Regards,

    /Bo