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.

AM625: How to run ospi_flash_diag on custom board without SBL flashed

Part Number: AM625
Other Parts Discussed in Thread: UNIFLASH

Tool/software:

AM62x MCU SDK11.0. 

AM6254 Q1 device

There is problem to flash SBL to custom board after the board back.

#1. Updated DDR configuration, rebuild all stage image of default_sbl_null_hs_fs.cfg file. the  command python.exe uart_uniflash.py ... can't go through stage 3.

#2. Connect CCS there, DDR can be modified, also can do Data_WrRd_test() from Scripts (gel menu) even with modified SIZE to 2K. refresh memory browser window, content is stable, DDR should be initialized successfully. 

DDR should work now after stage 2.

#3. Should migrate OSPI NOR flash for custom board, but the ospi_flash_diag run on DDR, as SBL is not flashed yet, it is not convenient to to that except download the diag after upper stage2, even download the diag to DDR in this way, it still can't run to main on custom board as below:

On my setup with SK-AM62B-LP, flashed NULL SBL, also can't run to main after download (reset CPU before download)

#4. Without SBL flashed which will init DDR and DM/TIFS, can't run ospi_flash_diag. Can't flash SBL if does not diagnose OSPI flash, If DDR is not right configured, can't run diag. How to do that with a empty hs-fs board. the procedure sounds conflicted. 

#5. Is there a ready jason file for customer's W25Q32JWSSAQ?

  • Hi Tony,

    They can use the SBL UART to load the OSPI Flash Diagnostic example: https://software-dl.ti.com/mcu-plus-sdk/esd/AM62X/11_00_00_16/exports/docs/api_guide_am62x/EXAMPLES_DRIVERS_SBL_UART.html

    Best Regards,

    Meet.

  • Hi Meet,

    Do you mean use this default_sbl_uart_hs_fs.cfg file? replace DM appimage with the OSPI Flash Diagnostic appimage in the file?

    Even though, the COM is occupied by the python tool, how to observe diagnostic result along with it?

  • Hi Tony,

    Do you mean use this default_sbl_uart_hs_fs.cfg file? replace DM appimage with the OSPI Flash Diagnostic appimage in the file?

    Yes, that's correct.

    Even though, the COM is occupied by the python tool, how to observe diagnostic result along with it?

    You can connect to UART terminal within 5 seconds to see the results: https://software-dl.ti.com/mcu-plus-sdk/esd/AM62X/11_00_00_16/exports/docs/api_guide_am62x/TOOLS_BOOT.html#UART_BOOTLOADER_PYTHON_SCRIPT

  • Made it worked, but OSPI diag failed. on AM62-sk-lp board, I got error as below:

    Sciserver Testapp Built On: Apr  3 2025 09:27:21
    Sciserver Version: v2025.04.0.0-REL.MCUSDK.K3.11.00.00.16+
    RM_PM_HAL Version: v11.00.07
    Starting Sciserver..... PASSED
    [OSPI Flash Diagnostic Test] Starting ...
    [OSPI Flash Diagnostic Test] Flash Manufacturer ID : 0xFF
    [OSPI Flash Diagnostic Test] Flash Device ID       : 0xEFDC
    [OSPI Flash Diagnostic Test] Executing Flash Erase on first block...
    [OSPI Flash Diagnostic Test] Erase Failed !!!
    [OSPI Flash Diagnostic Test] Performing Write-Read Test...
    [OSPI Flash Diagnostic Test] Wtite Failed !!!
    ERROR: ospi_flashDiagTestCompareBuffers:192: OSPI read data mismatch !!!
    Some tests have failed!!

    On AM62-SK-P1 board got right result, what is the problem.

    Sciserver Testapp Built On: Apr  3 2025 09:27:21
    Sciserver Version: v2025.04.0.0-REL.MCUSDK.K3.11.00.00.16+
    RM_PM_HAL Version: v11.00.07
    Starting Sciserver..... PASSED
    [OSPI Flash Diagnostic Test] Starting ...
    [OSPI Flash Diagnostic Test] Flash Manufacturer ID : 0x34
    [OSPI Flash Diagnostic Test] Flash Device ID       : 0x5B1A
    [OSPI Flash Diagnostic Test] Executing Flash Erase on first block...
    [OSPI Flash Diagnostic Test] Done !!!
    [OSPI Flash Diagnostic Test] Performing Write-Read Test...
    [OSPI Flash Diagnostic Test] Write-Read Test Passed!
    [OSPI Flash Diagnostic Test] SFDP Information :
    ================================================
                          SFDP
    ================================================
    SFDP Major Revision                       : 0x1
    SFDP Minor Revision                       : 0x8
    Number of Parameter Headers in this Table : 6
    
    Types of Additional Parameter Tables in this flash
    ---------------------------------------------------
    4 BYTE ADDRESSING MODE INSTRUCTIONS TABLE
    NOR SPI PROFILE TABLE
    STATUS CONTROL AND CONFIGURATION REGISTER MAP TABLE
    OCTAL DDR MODE COMMAND SEQUENCE TABLE
    SECTOR MAP TABLE
    
    Parsing of OCTAL DDR MODE COMMAND SEQUENCE TABLE table not yet supported.
    JSON Data for the flash :
    
    {
    
            "flashSize": 67108864,
            "flashPageSize": 256,
            "flashManfId": "0x34",
            "flashDeviceId": "0x5B1A",
            "flashBlockSize": 262144,
            "flashSectorSize": 4096,
            "cmdBlockErase3B": "0xDC",
            "cmdBlockErase4B": "0xDC",
            "cmdSectorErase3B": "0x21",
            "cmdSectorErase4B": "0x21",
            "protos": {
                    "p111": {
                            "isDtr": false,
                            "cmdRd": "0x03",
                            "cmdWr": "0x02",
                            "modeClksCmd": 0,
                            "modeClksRd": 0,
                            "dummyClksCmd": 0,
                            "dummyClksRd": 0,
                            "enableType": "0",
                            "enableSeq": "0x00",
                            "dummyCfg": null,
                            "protoCfg": null,
                            "strDtrCfg": null
                    },
                    "p112": null,
                    "p114": null,
                    "p118": null,
                    "p444s": null,
                    "p444d": null,
                    "p888s": null,
                    "p888d": {
                            "isDtr": true,
                            "cmdRd": "0xEE",
                            "cmdWr": "0x12",
                            "modeClksCmd": 0,
                            "modeClksRd": 0,
                            "dummyClksCmd": 4,
                            "dummyClksRd": 24,
                            "enableType": "0",
                            "enableSeq": "0x00",
                            "dummyCfg": {
                                    "isAddrReg": true,
                                    "cmdRegRd":"0x65",
                                    "cmdRegWr":"0x71",
                                    "cfgReg":"0x00800003",
                                    "shift":0,
                                    "mask":"0x03",
                                    "bitP":11
                            },
                            "protoCfg": {
                                    "isAddrReg": true,
                                    "cmdRegRd": "0x65",
                                    "cmdRegWr": "0x71",
                                    "cfgReg": "0x00800006",
                                    "shift": 0,
                                    "mask": "0x00",
                                    "bitP": 0
                            },
                            "strDtrCfg": {
                                    "isAddrReg": true,
                                    "cmdRegRd": "0x65",
                                    "cmdRegWr": "0x71",
                                    "cfgReg": "0x00800006",
                                    "shift": 1,
                                    "mask": "0x00",
                                    "bitP": 1
                            }
                    },
                    "pCustom": {
                            "fxn": null
                    }
            },
            "addrByteSupport": "1",
            "fourByteAddrEnSeq": "0xA0",
            "cmdExtType": "REPEAT",
            "resetType": "0x10",
            "deviceBusyType": "1",
            "cmdWren": "0x06",
            "cmdRdsr": "0x05",
            "srWip":  0,
            "srWel":  1,
            "cmdChipErase": "0xC7",
            "rdIdSettings": {
                    "cmd": "0x9F",
                    "numBytes": 5,
                    "dummy4": 0,
                    "dummy8": 0
            },
            "xspiWipRdCmd": "0x65",
            "xspiWipReg": "0x00800000",
            "xspiWipBit": 0,
            "flashDeviceBusyTimeout": 256000000,
            "flashPageProgTimeout": 512
    }
    
    All tests have passed!!

  • I am routing this thread to the concerned expert for this query, please wait for their response.

  • on AM62-sk-lp board,

    This board has NAND flash part so the "ospi_flash_diag" example won't work as it is applicable for NOR flashes only.