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.

TMDS64EVM: SBL writing fails in UART Mode

Part Number: TMDS64EVM
Other Parts Discussed in Thread: UNIFLASH, AM6422, AM6442, , SYSCONFIG

Hello TI support team.

I am writing SBL in UART Mode.

However, it stops with the following error.
I've tried several times, but I can't write successfully.

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
C:\ti\mcu_plus_sdk_am64x_08_06_00_45\tools\boot>python uart_uniflash.py -p COM3 --cfg=sbl_prebuilt\am64x-evm\default_sbl_ospi.cfg
Parsing config file ...
Parsing config file ... SUCCESS. Found 3 command(s) !!!
Executing command 1 of 3 ...
Found flash writer ... sending sbl_prebuilt/am64x-evm/sbl_uart_uniflash.release.tiimage
Sending sbl_prebuilt/am64x-evm/sbl_uart_uniflash.release.tiimage: 29%|▊ | 85407/295727 [00:10<00:19, 11032.83bytes/s]send error: expected ACK; got b'\xf0' for block 83
Sending sbl_prebuilt/am64x-evm/sbl_uart_uniflash.release.tiimage: 53%|█ | 156408/295727 [00:16<00:12, 11197.85bytes/s]send error: expected ACK; got b'\x86' for block 151
Sending sbl_prebuilt/am64x-evm/sbl_uart_uniflash.release.tiimage: 94%|█▉| 277830/295727 [00:27<00:01, 11030.89bytes/s]send error: expected ACK; got b'&' for block 12
Sent flashwriter sbl_prebuilt/am64x-evm/sbl_uart_uniflash.release.tiimage of size 295727 bytes in 29.93s.
Executing command 2 of 3 ...
Command arguments : --operation=flash-phy-tuning-data
Sending flash-phy-tuning-data_command: 0%| | 0/32 [00:00<?, ?bytes/s]send error: expected NAK, CRC, EOT or CAN; got b'\x82'
send error: expected NAK, CRC, EOT or CAN; got b'\x82'
send error: expected NAK, CRC, EOT or CAN; got b'\x82'
send error: expected NAK, CRC, EOT or CAN; got b'\x82'
send error: expected NAK, CRC, EOT or CAN; got b'\x82'
send error: expected NAK, CRC, EOT or CAN; got b'\x82'
send error: expected NAK, CRC, EOT or CAN; got b'\x82'
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

I would like to know what is wrong.
Best regards,
Kiyomasa Imaizumi.

  • Hello Prashant Shivhare.

    Thank you for your reply.

    When I tried to check the device type, I got the following message.

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    C:\ti\test_code>python 7080.uart_boot_socid.py data3.txt
    -----------------------
    SoC ID Header Info:
    -----------------------
    NumBlocks : [2]
    -----------------------
    SoC ID Public ROM Info:
    -----------------------
    SubBlockId :
    SubBlockSize :
    DeviceName : am64x
    DeviceType : HSFS
    DMSC ROM Version : [0, 2, 0, 0]
    R5 ROM Version : [0, 2, 0, 0]
    -----------------------
    SoC ID Secure ROM Info:
    -----------------------
    Sec SubBlockId : 2
    Sec SubBlockSize : 166
    Sec Prime : 0
    Sec Key Revision : 0
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


    It is HS_FS type.

    Best regards,
    Kiyomasa Imaizumi.

  • Hello Kiyomasa,

    This explains why the procedure fails.

    Since you are using HSFS device, please make sure you are using HSFS images only (.hs_fs.tiimage/.appimage.hs_fs). There is a hsfs configuration file (default_sbl_ospi_hsfs.cfg) available as well which by default uses hsfs images

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    ~/ti/mcu_plus_sdk/am64x/08_06_00_45/tools/boot
    ❯ /usr/bin/cat sbl_prebuilt/am64x-evm/default_sbl_ospi_hsfs.cfg
    #-----------------------------------------------------------------------------#
    # #
    # DEFAULT CONFIGURATION FILE TO BE USED WITH THE FLASHWRITER SCRIPT #
    # #
    #-----------------------------------------------------------------------------#
    #
    # By default this config file,
    # - points to pre-built flash writer, bootloader for this EVM
    # - The application image points to relative path of the ipc echo application image for this EVM
    # - Make sure this application is built before running this script
    # - You can customized this config file to point to your own bootloader and/or application images
    # - You can use --operation=flashverify if you just want to verify the flash contents and not flash the file.
    #
    # First point to sbl_uart_uniflash binary, which function's as a server to flash one or more files
    --flash-writer=sbl_prebuilt/am64x-evm/sbl_uart_uniflash.release.hs_fs.tiimage
    # Now send one or more files to flash or flashverify as needed. The order of sending files does not matter
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Regards,

    Prashant

  • Hello Prashant Shivhare.

    Thank you for the fast reply.

    The CPU on the board was AM6422.
    It is not the TMDS64EVM CPU (AM6442).

    I am using sbl_null.debug.hs_fs.tiimage located in the following directory.
    C:\ti\mcu_plus_sdk_am64x_09_01_00_41\tools\boot\sbl_prebuilt\am64x-evm


    Can this file be used with AM6422?

    Best regards,
    Kiyomasa Imaizumi.

  • Hello Prashant Shivhare.

    I added hs_fs because the file name listed in the default_sbl_null.cfg file was missing.
    However, the process stops at the following.

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    C:\ti\mcu_plus_sdk_am64x_08_06_00_45\tools\boot>python uart_uniflash.py -p COM3 --cfg=sbl_prebuilt/am64x-evm/default_sbl_null.cfg
    Parsing config file ...
    Parsing config file ... SUCCESS. Found 2 command(s) !!!
    Executing command 1 of 2 ...
    Found flash writer ... sending sbl_prebuilt/am64x-evm/sbl_uart_uniflash.release.hs_fs.tiimage
    Sent flashwriter sbl_prebuilt/am64x-evm/sbl_uart_uniflash.release.hs_fs.tiimage of size 297541 bytes in 26.77s.
    Executing command 2 of 2 ...
    Command arguments : --file=sbl_prebuilt/am64x-evm/sbl_null.release.hs_fs.tiimage --operation=flash --flash-offset=0x0
    Sending sbl_prebuilt/am64x-evm/sbl_null.release.hs_fs.tiimage: 0%| | 0/273693 [00:00<?, ?bytes/s]
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Can this sbl_null.release.hs_fs.tiimage file be used with AM6422?

    Best regards,
    Kiyomasa Imaizumi.

  • Hello Kiyomasa,

    The only diference between AM6422 and AM6442 is the number of R5F cores. The AM6422 has two R5F cores while AM6442 has four R5F cores. All the SBLs are coded to identify the number or cores at run time and accordingly initialize the SoC.

    Also, the part numbers AM6422 and AM6442 alone do not identify whether the SoC is GP or HSFS. If the SoC ID parser python script tells it's HSFS device, you must use the HSFS images only.

    So, you are using the right images but still the UART Uniflash procedure fails. I am guessing you are working with a custom board. Is that right?

    Regards,

    Prashant

  • Hello Prashant Shivhare.

    Thank you for your reply.

    I am working with custom board with AM6422.

    Please tell me how to resulve this problem.

    Best regards,

    Kiyomasa Imaizumi..

  • Hello Kiyomasa,

    The default `sbl_uart_uniflash` is supposed to work only on TI EVMs. Since you are using custom board, you would need to modify DDR, eMMC and OSPI settings in the `sbl_uart_uniflash` according to your board and use the modified image for flashing.

    DDR

    Change the default path to your DDR configuration file for your custom DDR

    eMMC

    In case your board doesn't have an eMMC, change the Card Type to NO_DEVICE

    Flash

    If you are using custom flash then please refer to the following documentation

    AM64x MCU+ SDK: Adding Support For a Custom Flash Device (ti.com)

    Regards,

    Prashant

  • Hello Prashant Shivhare.

    Thank you for your reply.

    Regarding the custom board, the DDR is the same but the FLASH is different.
    FLASH has been changed from S28HS512T to IS25LX256.
    I configured FLASH using CCS's sysconfig.

    I am creating a new *.hs_fs.tiimage for sbl_uart_uniflash and sbl_null.
    However, when I run uart_uniflash.py, it stops at the following.

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    C:\ti\mcu_plus_sdk_am64x_09_01_00_41\tools\boot>python uart_uniflash.py -p COM3 --cfg=sbl_prebuilt/am64x-evm/default_sbl_null.cfg
    Parsing config file ...
    Parsing config file ... SUCCESS. Found 2 command(s) !!!
    Executing command 1 of 2 ...
    Found flash writer ... sending ../../for_am6422/sbl_uart_uniflash.Debug.hs_fs.tiimage
    Sending ../../for_am6422/sbl_uart_uniflash.Debug.hs_fs.tiimage: 73%|██▉ | 278859/381813 [00:25<00:09, 11258.62bytes/s]send error: expected ACK; got b'\x04' for block 15
    Sent flashwriter ../../for_am6422/sbl_uart_uniflash.Debug.hs_fs.tiimage of size 381813 bytes in 35.0s.
    Executing command 2 of 2 ...
    Command arguments : --file=../../for_am6422/sbl_null.Debug.hs_fs.tiimage --operation=flash --flash-offset=0x0
    Sending ../../for_am6422/sbl_null.Debug.hs_fs.tiimage: 0%| | 0/342029 [00:00<?, ?bytes/s]
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    What's wrong?
    Are the FLASH settings incorrect?
    Please tell me how to debug it.

    Best regards,

    Kiyomasa Imaizumi.

  • Hello Kiyomasa,

    Please tell me how to debug it.

    After the flashing procedure ends even if failed, can you please connect to the R5F core via CCS and see the address at which the core is suspended at?

    Regards,

    Prashant

  • Hello Prashant Shivhare.

    Thank you for your reply.

    When I executed the following and stopped, I connected target R5_0_0.

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    C:\ti\mcu_plus_sdk_am64x_09_01_00_41\tools\boot> python uart_uniflash.py -p COM3 --cfg=sbl_prebuilt/am64x-evm/default_sbl_null.cfg
    Parsing config file ...
    Parsing config file ... SUCCESS. Found 2 command(s) !!!
    Executing command 1 of 2 ...
    Found flash writer ... sending ../../for_am6422/sbl_uart_uniflash.Debug.hs_fs.tiimage
    Sending ../../for_am6422/sbl_uart_uniflash.Debug.hs_fs.tiimage: 16%|▊ | 62769/381813 [00:07<00:28, 11380.55bytes/s]send error: expected ACK; got b'\x07' for block 61
    Sending ../../for_am6422/sbl_uart_uniflash.Debug.hs_fs.tiimage: 23%|█▏ | 89523/381813 [00:09<00:25, 11277.57bytes/s]send error: expected ACK; got b'\x86' for block 86
    Sending ../../for_am6422/sbl_uart_uniflash.Debug.hs_fs.tiimage: 26%|█ | 100842/381813 [00:10<00:24, 11344.61bytes/s]send error: expected ACK; got b'\x04' for block 96
    Sending ../../for_am6422/sbl_uart_uniflash.Debug.hs_fs.tiimage: 98%|███▉| 375585/381813 [00:34<00:00, 11354.57bytes/s]send error: expected ACK; got b'\x0e' for block 106
    Sent flashwriter ../../for_am6422/sbl_uart_uniflash.Debug.hs_fs.tiimage of size 381813 bytes in 36.08s.
    Executing command 2 of 2 ...
    Command arguments : --file=../../for_am6422/sbl_null.Debug.hs_fs.tiimage --operation=flash --flash-offset=0x0
    Sending ../../for_am6422/sbl_null.Debug.hs_fs.tiimage: 0%| | 0/342029 [00:00<?, ?bytes/s]
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    R5_0_0 seems to be suspended at address 0x7001F19E.

    Best regards,

    Kiyomasa Imaizumi.

  • Hello Kiyomasa,

    From the address 0x7001F19E, it looks like the `sbl_uart_uniflash` images boots but gets stuck somewhere.

    The next step would be to load the symbols of sbl_uart_uniflash using:

    Run -> Load -> Load Symbols... -> Browse -> <MCU_PLUS_SDK_PATH>/examples/drivers/boot/sbl_uart_uniflash/am64x-evm/r5fss0-0_nortos/ti-arm-clang/sbl_uart_uniflash.debug.out

    This should tell you where the control is stuck in the code.

    Regards,

    Prashan

  • Hello Prashant Shivhare.

    Thank you for your reply.

    It looks like below.

    Best regards,
    Kiyomasa Imaizumi.

  • Hello Prashant Shivhare.

    When I step through with F5, it looks like below.

    Best regards,
    Kiyomasa Imaizumi.

  • Hello Kiyomasa,

    It looks like the flash configurations may not be correct.

    If you continue the Step Through, does the control move forward in the code or just stuck there?

    Regards,

    Prashant

  • Hello Prashant Shivhare.

    I did a step through.
    The program seems to loop until timeOut reaches 0 using the code below for Flash_norOspiWaitReady.

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    while((status != SystemP_SUCCESS) || (timeOut > 0))
    {
    status = Flash_norOspiCmdRead(config, cmd, cmdAddr, numAddrBytes, dummyBits, readStatus, numBytesToRead);
    if((status == SystemP_SUCCESS) && ((readStatus[0] & bitMask) == 0))
    {
    break;
    }
    timeOut--;
    }
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Best regards,
    Kiyomasa Imaizumi.

  • Hello Kiyomasa,

    If the timeout reaches 0 then the status will become SystemP_FAILURE. Have you confirmed this?

    Can you please share the ospi_flash_diag output for your custom board?

    Regards,

    Prashant

  • Hello Prashant Shivhare.


    "timeOut" has not reached 0.
    First, the following will appear on the command prompt and the transfer will stop.

    Fullscreen
    1
    2
    [ERROR] XMODEM send failed, no response OR incorrect response from EVM OR cancelled by user,
    Power cycle EVM and run this script again !!!
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    I tried ospi_flash_diag.

    When uart_unifhasl failed, I connected Target to CR5 and applied Reset.
    And I loaded ospi_flash_diag_am64x-evm_r5fss0-0_nortos_ti-arm-clang.

    It came out as below.

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    [OSPI Flash Diagnostic Test] Starting ...
    [OSPI Flash Diagnostic Test] Flash Manufacturer ID : 0xFF
    [OSPI Flash Diagnostic Test] Flash Device ID : 0xFFFF
    [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_flash_diag_test_compare_buffers:181: OSPI read data mismatch !!!
    Some tests have failed!!
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    I haven't changed ospi_flash_diag_am64x-evm_r5fss0-0_nortos_ti-arm-clang.

    Best regards,
    Kiyomasa Imaizumi.

  • Hello Prashant Shivhare.

    There was a hardware error in the FLASH reset.
    So when I fixed it, the diagnostic program started working.

    It appeared as below.

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    [OSPI Flash Diagnostic Test] Starting ...
    [OSPI Flash Diagnostic Test] Flash Manufacturer ID : 0x9D
    [OSPI Flash Diagnostic Test] Flash Device ID : 0x5A19
    [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!
    [QSPI Flash Diagnostic Test] SFDP Information :
    ================================================
    SFDP
    ================================================
    SFDP Major Revision : 0x1
    SFDP Minor Revision : 0x9
    Number of Parameter Headers in this Table : 3
    Types of Additional Parameter Tables in this flash
    ---------------------------------------------------
    4 BYTE ADDRESSING MODE INSTRUCTIONS TABLE
    NOR SPI PROFILE TABLE
    JSON Data for the flash :
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    I think I will configure FLASH in sysconfig based on these, but which items correspond to where in sysconfig?

    Best regards,

    Kiyomasa Imaizumi.

  • Hello Prashant Shivhare.

    I made the diag output result into a json file and read it from sysconfig.
    The following error occurred.

    However,I made the FLASH settings one by one and created uart_uniflash.
    I ran sbl_uart_uniflash.py from the command prompt.
    When debugging with symbol loading, Board_driversOpen() returns -1.
    I think Flash_open is failing.


    Best regards,
    Kiyomasa Imaizumi.

  • Hello Prashant Shivhare.

    I stopped just before Boad_driversOpen and debugged with symbol loading.

    I confirmed that the status becomes -1 in Flash_norOspiReadId(config) in the Flash_norOspiOpen function.


    Best regards,
    Kiyomasa Imaizumi.

  • Hello Prashant Shivhare.

    additional information. I am debugging with symbol loading.
    The status will be -1 below.
    (flash_nor_ospi.c)

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    if (!((manfID == config->attrs->manufacturerId) && (devID == config->attrs->deviceId)))
    {
    /* Try the other 3 bytes */
    manfID = (uint32_t)idCode[3];
    devID = ((uint32_t)idCode[4] << 8) | ((uint32_t)idCode[5]);
    if (!((manfID == config->attrs->manufacturerId) && (devID == config->attrs->deviceId)))
    {
    status = SystemP_FAILURE;
    }
    }
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


    When I checked the parameters, manufacturingId was 52 and deviceId was 23322, but manfId was 0 and devID was 0.
    As a result, the status is SystemP_FAILURE.

    Maybe Flash_norOspiCmdRead is failing?
    But the function is returning 0.


    Best regards,
    Kiyomasa Imaizumi.

  • Hello Kiyomasa,

    From the shared logs of `ospi_flash_diag`, the Manufacturer ID is 0x9D and Device ID is 0x5A19. Have you checked these against the corresponding IDs mentioned in your flash datasheet?

    Regards,

    Prashant

  • Hello Prashant Shivhare.

    I made a mistake in the description.
    The following is correct.
    ---
    When I checked the parameters, manufacturingId was 0x9D and deviceId was 23065, but manfId was 0 and devID was 0.
    ---

    Best regards,
    Kiyomasa Imaizumi.

  • Hello Kiyomasa,

    My question is: Have you checked if the IDs reported by `ospi_flash_diag` matches with the IDs mentioned in your flash datasheet?

    Also, can you share correct JSON output of the `ospi_flash_diag`. The previous JSON output is not formatted correctly.

    Regards,

    Prashant

  • Hello Preshant Shivhare

    Thank you for youre reply.

    I checked Manufacturer ID and Device ID from data sheet.

    These are correct.

    I attach JSON file.

    Best regards,

    Kiyomasa Imaizumi.

    shisaku_flash.txt
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    {
    "flashSize": 33554432,
    "flashPageSize": 256,
    "flashManfId": "0x9D",
    "flashDeviceId": "0x5A19",
    "flashBlockSize": 131072,
    "flashSectorSize": 4096,
    "cmdBlockErase3B": "0xD8",
    "cmdBlockErase4B": "0xDC",
    "cmdSectorErase3B": "0x20",
    "cmdSectorErase4B": "0x21",�E
    "protos": {
    "p111": {
    "isDtr": false,
    "cmdRd": "0x03",
    "cmdWr": "0x02",
    "modeClksCmd": 0,
    "modeClksRd": 0,
    "dummyClksCmd": 0,
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Hello Kiyomasa,

    Thank you for confirming.

    I just realized that the SDK seems to already have the IS25LX256 flash configuration file at source/board/.meta/flash/IS25LX256.json

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    ~/ti/mcu_plus_sdk/am64x/09_01_00_41
    ❯ /usr/bin/cat source/board/.meta/flash/IS25LX256.json
    {
    "flashSize": 33554432,
    "flashPageSize": 256,
    "flashManfId": "0x9D",
    "flashDeviceId": "0x5A19",
    "flashBlockSize": 131072,
    "flashSectorSize": 4096,
    "cmdBlockErase3B": "0xD8",
    "cmdBlockErase4B": "0xDC",
    "cmdSectorErase3B": "0x20",
    "cmdSectorErase4B": "0x21",
    "protos": {
    "p111": {
    "isDtr": false,
    "cmdRd": "0x03",
    "cmdWr": "0x02",
    "modeClksCmd": 0,
    "modeClksRd": 0,
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Can you please do the following:

    - Revert all the changes in the Flash module of Sysconfig of `sbl_uart_uniflash`.

    - Replace the contents of the EVM flash configuration file (source/board/.meta/flash/S28HS512T.json) with the contents of IS25LX256.json.

    Fullscreen
    1
    2
    ~/ti/mcu_plus_sdk/am64x/09_01_00_41/source/board/.meta/flash
    ❯ cp IS25LX256.json S28HS512T.json
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    - The settings in the Flash module of the Sysconfig will be automatically changed to whatever there is in S28HS512T.json. So, you won't require any manual changes.

    - Rebuild the `sbl_uart_uniflash`.

    - Perform the flashing procedure.

    Let me know if this works.

    Regards,

    Prashant

  • Hello Prashant Shivhare.

    Thank you for your reply.
    I made the copy according to your instructions.
    I rebuild the "sbl_uart_uniflash" and run.

    It seems that the following retries are repeated.


    Best regards,
    Kiyomasa Imaizumi.

  • Hello Kiyomasa,

    Can you please share the `sbl_uart_uniflash` example you have modified till now?

    Regards,

    Prashant

  • Hello Prashant Shivhare.

    Thank you for your reply.
    I attach project file and S28HS512T.json file.

    4274.project.zip

    Best regards,
    Kiyomasa Imaizumi.

  • Hello Prashant Shivhare.

    When I tried it next, it seems to be looping as below.


    When I step with F5, readStatus[0] becomes 0x05 or 0xFF.

    Best regards,
    Kiyomasa Imaizumi.

  • Hello Kiyomasa,

    Can you please do the following:

    - Replace the contents of source/board/flash/ospi/flash_nor_ospi.c with the following

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    /*
    * Copyright (C) 2021-23 Texas Instruments Incorporated
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
    *
    * Redistributions of source code must retain the above copyright
    * notice, this list of conditions and the following disclaimer.
    *
    * Redistributions in binary form must reproduce the above copyright
    * notice, this list of conditions and the following disclaimer in the
    * documentation and/or other materials provided with the
    * distribution.
    *
    * Neither the name of Texas Instruments Incorporated nor the names of
    * its contributors may be used to endorse or promote products derived
    * from this software without specific prior written permission.
    *
    * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    - Rebuild the libs in the same PROFILE as the example is being built.

    - Rebuild the `sbl_uart_uniflash` example.

    - Perform the flashing procedure.

    Regards,

    Prashant

  • Hello Prashant Shivhare.

    Thank you for your reply.

    I changed flash_nor_ospi.c.
    And I rebuild the libs and sbl_uart_uniflash.

    The problem status is the same as before the change.

    The program has the following loop.


    Best regards,
    Kiyomasa Imaizumi.

  • Hello Kiyomasa,

    There is this change in the flash_nor_ospi.c for your flash part. Can you stop before Board_driversOpen and see if the control is executing the else part and the function Flash_norOspiSet8D_ISSI

    Regards,

    Prashant

  • Hello Prashant Shivhare.

    Thank you for your reply.

    I tried debugging as you suggested.
    Flash_norOspiSet8D_ISSI is called as follows.

    The status is 0 after the function is called.


    Best regards,
    Kiyomasa Imaizumi.

  • Hello Prashant Shivhare.

    Please let me know if there is any way to resolve this issue as soon as possible.

    Best regards,
    Kiyomasa Imaizumi.

  • Hello Kiyomasa,

    It looks like the driver is incompatible with your custom flash part. Before diving deep into the driver, I want to make sure the flash configurations we are working with are correct.

    In that regards, I notice that the shared JSON output of ospi_flash_diag is different from the JSON file present in the SDK. May I know the exact steps you are following to run the ospi_flash_diag example?

    Regards,

    Prashant

  • Hello Kiyomasa,

    I have one more updated flash configurations. Can you please try them?

    - Remove all the changes in the source/board/flash/ospi/flash_nor_ospi.c previously shared.

    - Replace the contents in source/board/.meta/flash/S28HS512T.json with the following:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    {
    "flashSize": 33554432,
    "flashPageSize": 256,
    "flashManfId": "0x9D",
    "flashDeviceId": "0x5A19",
    "flashBlockSize": 131072,
    "flashSectorSize": 4096,
    "cmdBlockErase3B": "0xD8",
    "cmdBlockErase4B": "0xDC",
    "cmdSectorErase3B": "0x20",
    "cmdSectorErase4B": "0x21",
    "protos": {
    "p111": {
    "isDtr": false,
    "cmdRd": "0x03",
    "cmdWr": "0x02",
    "modeClksCmd": 0,
    "modeClksRd": 0,
    "dummyClksCmd": 0,
    "dummyClksRd": 0,
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    - Rebuild the libs.

    - Rebuild the `sbl_uart_uniflash`.

    - Perform the flashing procedure.

    Regards,

    Prashant

  • Hello Prashant Shivhare.

    Thank you for your reply.
    Here are the steps to run the ospi_flash_diag example.

    1. Boot in UART BOOT MODE
    2. Run uart_uniflash.py at command prompt.
    3. The created sbl_uart_uniflash.Debug.hs_fs.tiimage program runs at EVM, but stops midway.
    4. Connect Target CR5 with CCS
    5. Reset CR5 from CCS
    6. Load and run ospi_flash_diag from CCS
    7. The diag result is output to Teraterm (Serial Port).

    Best regards,
    Kiyomasa Imaizumi.

  • Hello Kiyomasa,

    These are not the correct steps to run the ospi_flash_diag example.

    For now, can you try the updated flash configurations I shared in my previous reply. If that doesn't work, we will come back to running the ospi_flash_diag the correct way.

    Regards,

    Prashant

  • Hello Prashant Shivhare.

    Thank you for your quick reply.

    I rebuilt and ran sbl_uart_uniflash with the S28HS512T.json file you showed.
    Writing sbl_null was successful!
    thank you very much.

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    C:\ti\mcu_plus_sdk_am64x_09_01_00_41\tools\boot>python uart_uniflash.py -p COM3 --cfg=sbl_prebuilt/am64x-evm/default_sbl_null.cfg
    Parsing config file ...
    Parsing config file ... SUCCESS. Found 2 command(s) !!!
    Executing command 1 of 2 ...
    Found flash writer ... sending ../../for_am6422/sbl_uart_uniflash.Debug.hs_fs.tiimage
    Sent flashwriter ../../for_am6422/sbl_uart_uniflash.Debug.hs_fs.tiimage of size 382373 bytes in 35.26s.
    Executing command 2 of 2 ...
    Command arguments : --file=../../for_am6422/sbl_null.Debug.hs_fs.tiimage --operation=flash --flash-offset=0x0
    Sent ../../for_am6422/sbl_null.Debug.hs_fs.tiimage of size 341997 bytes in 101.47s.
    [STATUS] SUCCESS !!!
    All commands from config file are executed !!!
    C:\ti\mcu_plus_sdk_am64x_09_01_00_41\tools\boot>
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


    Below are the questions.
    1. What went wrong?

    2. Currently, the program is using a file with a different flash name, S28HS512T.json.
    The device name is IS25LX256, so please tell me the correct way to modify the project.


    3. Please tell me the correct procedure to run ospi_flash_diag.
    If the board does not have anything written in FLAHS, it can only be started in UART BOOT MODE.
    Can ospi_flash_diag be executed in other ways?


    Best regards,
    Kiyomasa Imaizumi.

  • Hello Kiyomasa,

    That's some good news.

    1. What went wrong?

    Actually, I also don't have a clear understanding at the moment.

    Fortunately, the AM263P-CC board is using the exact flash part IS25LX256. So, I evaluated the AM263P MCU+ SDK and noticed some manual changes in the Flash module of Sysconfig of `sbl_uart_uniflash` on top of the default flash configurations IS25LX256.json. So, I took chose changes and modified the flash configurations and shared with you. And IT DID WORK!!!

    The device name is IS25LX256, so please tell me the correct way to modify the project.

    The recommended way to modify the flash configurations is documented here:

    https://software-dl.ti.com/mcu-plus-sdk/esd/AM64X/08_06_00_45/exports/docs/api_guide_am64x/CUSTOM_FLASH_SUPPORT_GUIDE.html#autotoc_md444

    Please note you would need to do these steps in any example using the FLASH module of Sysconfig like `sbl_ospi` or `ospi_flash_io` examples.

    Can ospi_flash_diag be executed in other ways?

    Yes, we can initialize the SoC by booting SBL NULL over UART directly and then load/run any example via CCS.

    Regards,

    Prashant

  • Hello Prashant Shivhare.

    Thank you for your reply.


    I'm a little confused.
    I attach the latest data obtained with ospi_flash_diag.
    Does this mean that this is wrong data (json)?

    2630.flash.txt
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    {
    "flashSize": 33554432,
    "flashPageSize": 256,
    "flashManfId": "0x9D",
    "flashDeviceId": "0x5A19",
    "flashBlockSize": 131072,
    "flashSectorSize": 4096,
    "cmdBlockErase3B": "0xD8",
    "cmdBlockErase4B": "0xDC",
    "cmdSectorErase3B": "0x20",
    "cmdSectorErase4B": "0x21",
    "protos": {
    "p111": {
    "isDtr": false,
    "cmdRd": "0x03",
    "cmdWr": "0x02",
    "modeClksCmd": 0,
    "modeClksRd": 0,
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


    Moreover, if the flash configuration file you shared is correct,
    does that mean that the json file in the SDK is also incorrect?

    Best regards,
    Kiyomasa Imaizumi.

  • Hello Kiyomasa,

    I attach the latest data obtained with ospi_flash_diag.

    It seems like the ospi_flash_diag somehow is not working correctly for IS25LX256 flash.

    does that mean that the json file in the SDK is also incorrect?

    So, we have the following difference in the default configurations and the working modified configurations:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    ~/ti/mcu_plus_sdk/am64x/09_01_00_41/source/board/.meta/flash
    ❯ diff IS25LX256.json working-modified-IS25LX256.json
    90c90
    < "fourByteAddrEnSeq": "0xA1",
    ---
    > "fourByteAddrEnSeq": "0",
    106c106
    < "xspiWipRdCmd": "0x00",
    ---
    > "xspiWipRdCmd": "0x05",
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    xspiWipRdCmd => The Read Status Register (xspiWipRdCmd) for IS25LX256 flash is 0x05 (mentioned in the datasheet) so the value 0x0 present in the default configuration is incorrect.

    fourByteAddrEnSeq => The IS25LX256 flash only supports 4B addressing mode in Octal DDR (8D_8D_8D). So, the `fourByteAddrEnSeq` value must be set 0x0 to skip explicitly switching to 4B addressing since the flash will automatically be in 4B addressing mode for Octal DDR.

    For any other supported protocol, switching to 4B will require explicit 4B enable sequence. In that case, `fourByteAddrEnSeq` value must be non-zero and set accordingly to the enable sequence.

    Regards,

    Prashant

  • Hello Prashant Shivhare.


    For now, I think the problem is resolved.
    Next time we face any problem, please help us again.


    Best regards,
    Kiyomasa Imaizumi.