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.

[FAQ] How to flash serial OSPI-NAND with Lauterbach JTAG on AM62x

Other Parts Discussed in Thread: SK-AM62-LP

AM62x Boot ROM supports booting from serial (x)SPI-NAND. Please refer to AM62x TRM "Chapter 5 Initialization" for details.
The serial OSPI-NAND (Winbond W35N01JWTBAG) is on TI SK-AM62-LP board [1].
- The FAQ lists how to flash u-boot binary to serial OSPI-NAND with Lauterbach JTAG on AM62x HS-FS or GP, where JTAG is unlocked.
- The Lauterbach T32 JTAG scripts in the FAQ is verified on TI SK-AM62-LP board [1]
- The FAQ provides an alternative flashing option to the u-boot based approach [2], and is useful for initial SoC board bring-up…
[1]. SK-AM62-LP board https://www.ti.com/tool/SK-AM62-LP
[2]. https://e2e.ti.com/support/processors-group/processors/f/791/t/1288373

  • 1. BOOTMODE[15:0] configuration
    - DIP switch setting on SK-AM62-LP (W35N01JWTBAG)
    SW2{0,0,0,0,0,0,0,0} : SW1{1,1,0,0,0,0,0,0}
    => BOOTMODE[15:0]=0003 which configures OSPI-NAND boot mode such that
    - OSPI-NAND controller/pinmux etc... are pre-configured by AM62x bootrom
    - There's no need to touch/configure Cortex-M SMS core by JTAG debugger
    - Lauterbach T32 OSPI-NAND flashing binary runs on Cortex-R5 core from onchip SRAM only

    2. Lauterbach T32 scripts on flashing serial OSPI-NAND on AM62x
    - am62x_spinand_T32.zip: Lauterbach T32 scripts
    - am62x_spinand_flash.log: a sample T32 serial OSPI-NAND flashing log
    As shown in the T32 flashing log, it is possible to do flashing on a fresh/empty serial OSPI-NAND device, which is useful for initial board bring-up...

    3. A sample serial OSPI-NAND boot log on SK-AM62-LP board after flashing
    - am62-lpsk_10.0.7.4_spinand_boot.log

    am62x_spinand_T32.zip

    ======================================================
    10. Jun 2025
    OSPI-NAND flashing on TI SK-AM62-LP (W35N01JWTBAG)
    SW2{0,0,0,0,0,0,0,0} : SW1{1,1,0,0,0,0,0,0}
    BOOTMODE[15:0]=0003 for OSPI-NAND boot
    PINMUX etc... are pre-configured by AM62x bootrom
    ======================================================
    --------Flash Read ID Test---------
    1st 0x0FF (Dummy)
    2nd 0x0EF (Manufacture)
    3rd 0x0DC (Device ID)[15:8]
    4th 0x21 (Device ID)[7:0]
    Dual port programming mode enabled
    --------NAND FLASH---------
    Manufacturer = WINBOND(0xEF) , Device ID = 0xDC (0x21, 0x0, 0x0, 0x0)
    read 256. byte(s) to vm:0x0
    ---------NAND ONFI---------
    [0:3]Parameter page signature: ONFI
    [4:5]Revision number: 0x0 0x0
    [6:7]Features supported: 0x0 0x0
    [8:9]Optional commands support: 0x0 0x0
    [32:43]Device manufacturer: WINBOND     
    [42:63]Device model: W35N01JW            
    [64]Manufacturer ID: 0xEF
    [65:66]Date code: 0x0 0x0
    [80:83]Number of data bytes per page: 0x0 0x10 0x0 0x0
    [84:85]Number of spare bytes per page: 0x80 0x0
    [86:89]Number of data bytes per partial page: 0x0 0x0 0x0 0x0
    [90:91]Number of spare bytes per partial page: 0x0 0x0
    [92:95]Number of pages per block: 0x40 0x0 0x0 0x0
    [96:99]Number of blocks per unit: 0x0 0x2 0x0 0x0
    [100]Number of logical units: 0x1
    [101]Number of address cycles: 0x0
    [102]Number of bits per cell: 0x1
    [103:104]Bad blocks maximum per unit: 0xA 0x0
    [105:106]Block endurance: 0x1 0x5
    [107]Guaranteed valid blocks at beginning of target: 0x1
    [108:109]Block endurance for guaranteed valid blocks: 0x0 0x0
    [110]Number of programs per page: 0x1
    [111]Partial programming attributes: 0x0
    [112]Number of ECC bits: 0x0
    [113]Number of interleaved address bits: 0x0
    [114]Interleaved operation attributes: 0x0
    [128]I/O pin capacitance: 0x8
    [129:130]Timing mode support: 0x0 0x0
    [131:132]Program cache timing: 0x0 0x0
    [133:134]tPROG maximum page program time: 0xBC 0x2
    [135:136]tERS maximum block erase time: 0x10 0x27
    [137:138]tR maximum page read time: 0x3C 0x0
    [139:140]tCCS minimum: 0x0 0x0
    [164:165]Vendor-specific revision number: 0x0 0x0
    [166:179]Vendor-specific: 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0
    [248]ECC maximum correct ability: 0x0
    [249]Die select feature: 0x0
    [254:255]Integrity CRC: 0xBF 0x2F
    A page size: 4096./128.Bytes (main/spare)
    A block size: 0x40000 (64.Pages)
    A device size: 0x8000000 Bytes
    SPI write: 2. byte(s), 0x0f 0xb0
    FLASHFILE unlock done.
    --------Flash u-boot binary---------
    file 'C:\T32\DMxx\lauterbach\HG\am62x_burn_flash\spinand_r5\binary\tiboot3.bin' (Binary) loaded. 313410 bytes.
    file 'C:\T32\DMxx\lauterbach\HG\am62x_burn_flash\spinand_r5\binary\tispl.bin' (Binary) loaded. 1207371 bytes.
    file 'C:\T32\DMxx\lauterbach\HG\am62x_burn_flash\spinand_r5\binary\u-boot.img' (Binary) loaded. 1295899 bytes.
    

    U-Boot SPL 2024.04-ti-gfda88f8bcea3 (Jul 26 2024 - 11:00:12 +0000)
    SYSFW ABI: 4.0 (firmware rev 0x000a '10.0.8--v10.00.08 (Fiery Fox)')
    SPL initial stack usage: 13392 bytes
    Trying to boot from SPINAND
    Authentication passed
    Authentication passed
    Authentication passed
    Authentication passed
    Authentication passed
    Starting ATF on ARM64 core...
    
    NOTICE:  BL31: v2.10.0(release):v2.10.0-367-g00f1ec6b87-dirty
    NOTICE:  BL31: Built : 16:09:05, Feb  9 2024
    
    U-Boot SPL 2024.04-ti-gfda88f8bcea3 (Jul 26 2024 - 11:00:12 +0000)
    SYSFW ABI: 4.0 (firmware rev 0x000a '10.0.8--v10.00.08 (Fiery Fox)')
    SPL initial stack usage: 1904 bytes
    Trying to boot from SPINAND
    Authentication passed
    Authentication passed
    
    
    U-Boot 2024.04-ti-gfda88f8bcea3 (Jul 26 2024 - 11:00:12 +0000)
    
    SoC:   AM62X SR1.0 HS-FS
    Model: Texas Instruments AM62x LP SK
    EEPROM not available at 0x50, trying to read at 0x51
    Board: AM62-LP-SKEVM rev E2
    DRAM:  2 GiB
    Core:  83 devices, 32 uclasses, devicetree: separate
    NAND:  1024 MiB
    MMC:   mmc@fa10000: 0, mmc@fa00000: 1
    Loading Environment from nowhere... OK
    In:    serial
    Out:   serial
    Err:   serial
    Net:   eth0: ethernet@8000000port@1
    Hit any key to stop autoboot:  2  0 
    => md.l 0x43000030 1
    43000030: 00000003                             ....
    => mtd list
    List of MTD devices:
    * nand0
      - device: nand@0,0
      - parent: memory-controller@3b000000
      - driver: gpmc-nand
      - path: /bus@f0000/memory-controller@3b000000/nand@0,0
      - type: NAND flash
      - block size: 0x40000 bytes
      - min I/O: 0x1000 bytes
      - OOB size: 128 bytes
      - OOB available: 142 bytes
      - ECC strength: 8 bits
      - ECC step size: 512 bytes
      - bitflip threshold: 6 bits
      - 0x000000000000-0x000040000000 : "nand0"
    	  - 0x000000000000-0x000000200000 : "NAND.tiboot3"
    	  - 0x000000200000-0x000000400000 : "NAND.tispl"
    	  - 0x000000400000-0x000000600000 : "NAND.tiboot3.backup"
    	  - 0x000000600000-0x000000a00000 : "NAND.u-boot"
    	  - 0x000000a00000-0x000000a40000 : "NAND.u-boot-env"
    	  - 0x000000a40000-0x000000a80000 : "NAND.u-boot-env.backup"
    	  - 0x000000a80000-0x000040000000 : "NAND.file-system"
    * spi-nand0
      - device: flash@0
      - parent: spi@fc40000
      - driver: spi_nand
      - path: /bus@f0000/bus@fc00000/spi@fc40000/flash@0
      - type: NAND flash
      - block size: 0x40000 bytes
      - min I/O: 0x1000 bytes
      - OOB size: 128 bytes
      - OOB available: 80 bytes
      - 0x000000000000-0x000008000000 : "spi-nand0"
    	  - 0x000000000000-0x000000080000 : "ospi_nand.tiboot3"
    	  - 0x000000080000-0x000000280000 : "ospi_nand.tispl"
    	  - 0x000000280000-0x000000680000 : "ospi_nand.u-boot"
    	  - 0x000000680000-0x0000006c0000 : "ospi_nand.env"
    	  - 0x0000006c0000-0x000000700000 : "ospi_nand.env.backup"
    	  - 0x000002000000-0x000007fc0000 : "ospi_nand.rootfs"
    	  - 0x000007fc0000-0x000008000000 : "ospi_nand.phypattern"
    =>