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.

OSPI DDR Read Data



Hi,TI team

I am using SDK1.0 sample code to debug 8D8D8D mode of CYPRESS S28HS512T Flash chip, that is, OCTAL DDR mode:

When I set the value of an 8-bit flash register to 03, I went to read the value of this register. Since I did not get the correct value after reading 1 byte, I read back three bytes and the value is 00 03 03, and the correct value of my register is 03; when I set the register value to 08, the value read back is 000808; when I set the register value to C0, the value read back is 00C0C0;
When I read the flash ID, I have set a dummy cycle that matches the clock in advance. The correct value of the ID should be 34 5B 1A 0F 03, and the value I read back is 00 34 5B 1A 0F.

From the above phenomenon, every time I read the value, there is an additional clock edge which causes my data to be wrong.I have the following two questions:

1.In DDR mode, both rising and falling edges capture data. How can I configure it to

read odd-numbered data?

2.In addition, when the SDK package I am using to read the flash ID, no matter which mode is used, the number of bytes for reading the ID cannot be even. What is the reason?

Look forward to your reply.

  • Hello Yajuan,

    Please indicate what PROCESSOR you are using.

    Thank you,

    ~Leonard 

  • Hi Leonard 

    I am using DRA828.

    Thanks.

  • 1) In DDR mode, you must read back an even number of bytes.  If you only want one byte, as is the case with a single byte register, read two bytes, and disregard the upper byte.

    2)  What frequency are you using, and is PHY enabled?

  • 1.Why does the MIRON flash DDR mode of the development board read two bytes without ignoring the high byte operation? Can you point me to the operation?

    2.I used the 133MHZ clock frequency and turned on the PHY, so after reading the flash ID 128 times through the PHY, the delay parameters in the PHY will be continuously adjusted to read the correct flash ID. However, because CYPRESS's volatile register and memory arry need to set different dummy cycles, and the delay parameter adjustment of phy is adjusted according to the flash ID, which is equivalent to adjusting the dummy clcle of accessing the volatile register, without adjusting the memory's dummy cycle. So now even if I read the correct flash ID, I cannot read the correct memory data.

  • Hi, Zack,

    I have gone through the OSPI_Flash_TestApp demo in SDK, and found that no matter ospi_cfg.dtrEnable = true or false, Nor_ospiReadId() is call to read 3 bytes of OSPI chip ID. There is no difference for DDR and SDR.

    I think this causes customer engineer's confusing.

    Please help to explain in more details and point out the process for odd byte data process in SDK.

    Thanks.

  • Hi, Zack,

    I did some more test with Micron OSPI on J7 EVM, and got below result. Please help to analysis and share your comments. Thanks.

    I did some modification in Nor_ospiOpen() and CSL_ospuConfigPhy() to disable data training and set to a fixed TX/RX values found in table 5-111 in DM. Then tried to read ID of Micron OSPI chip. Below is data gotten from OSPI_FLASH_RD_DATA_LOWER_REG  and OSPI_FLASH_RD_DATA_UPPER_REG with different rxLen set in NOR_ospiCmdRead().

    This test is based on OSPI_Flash_TestApp, other settings were not modified.

    Why the lower 2 bytes gotten in OSPI_FLASH_RD_DATA_LOWER_REG were always 0x0000?

    rxLen in NOR_ospiCmdRead() value of OSPI_FLASH_RD_DATA_LOWER_REG value of OSPI_FLASH_RD_DATA_UPPER_REG
    1 00000000 00000000
    2 002C0000 00000000
    3 5B2C0000 00000000
    4 5B2C0000 0000001A
    5 5B2C0000 0000101A
    6 5B2C0000 0041101A

    Thanks.

  • DDR mode without data training is limited to very low speeds.  It is possible you are operating at too high of a speed.  But Yajuan is using data training.

    I can't comment on what the SDK does, only that the controller needs an even number of samples in DDR mode.

    " However, because CYPRESS's volatile register and memory arry need to set different dummy cycles, and the delay parameter adjustment of phy is adjusted according to the flash ID, which is equivalent to adjusting the dummy clcle of accessing the volatile register, without adjusting the memory's dummy cycle."

    I don't really understand this statement from Yajuan, especially the bold part.

  • Hi, Zack,

    Thanks for the response.

    I redo the test with data training enabled. HW: J7 EVM. SW: psdk_rtos_auto_j7_07_00_00_11. Just add Nor_ospiReadId() after calibrating PHY.

    During the test, I found that when read odd number of byte, the data gotten from OSPI_FLASH_RD_DATA register is correct. But when read even number of byte, the data gotten from OSPI_FLASH_RD_DATA register is different on each read. Please help to check if anything wrong in my test, Thanks.

    rxLen in NOR_ospiCmdRead() value of OSPI_FLASH_RD_DATA_LOWER_REG value of OSPI_FLASH_RD_DATA_UPPER_REG
    1 00 00 5B 2C 00 00 00 00
    2

    10 1A 5B 2C

    5B 2C 5B 2C

    00 5B 2C 10

    00 5B 2C 5B

    3 10 1A 5B 2C 00 00 00 00
    4

    10 1A 5B 2C

    1A 5B 2C 10

    00 00 00 41

    00 00 00 10

    5 10 1A 5B 2C 00 00 00 41
    6
    7 10 1A 5B 2C 52 1C 00 41
  • Hi, Zack,

    From above test, I got the result that

    1. If try to read odd number(n) of byte in DDR mode, n+1 bytes were read back into OSPI_FLASH_RD_DATA register, the lower n bytes from these n+1 bytes are the correct content expected.

    2. If try to read even number of byte in DDR mode, the contents gotten in OSPI_FLASH_RD_DATA register differed in each read.

    Would you please help to check whether you can reproduce the same issue with J7 EVM and psdk_rtos_auto_j7_07_00_00_11, and help to check if anything wrong in my test, and guide the way to read even number of byte in DDR mode.

    Thanks.

  • Hi Fan,

    The PDK OSPI driver API expects the caller to follow the requirement for odd/even number of bytes based SDR or DDR mode.

    The driver does NOT take care of this requirement for the application.

    Regards,
    Stanley

  • Hi, Stanley

    Thanks for your reply.

    Based on my understanding, even number of bytes is transferred in DDR mode. If odd number(n) of bytes is expected, (n+1) bytes is read out and caller can just ignore the highest bytes to get the expected odd number of bytes. And my test result above is consistent with my understanding.

    For even number of bytes read operation, it should be more simple because the ignoring is unnecessary. But the readout content in OSPI_FLASH_RD_DATA register differed in each read.

    Would you help to guide the way to read even number of ID using NOR_ospiCmdRead() API.

    Thanks.

  • Hi, Stanley,

    Would you help to check if anything wrong in my operation while reading 2/4 bytes of OSPI chip ID?

    Thanks.

  • Hi Fan,

    Fan_Zhang said:

    Would you help to check if anything wrong in my operation while reading 2/4 bytes of OSPI chip ID?

    Does this problem still need attention? Can you please post back on this thread with what actions are needed?

    Regards

    Karthik

  • Hi, Karthik,

    Yes, this issue is still open.

    Please help to check if anything wrong in the operations to read 2/4 bytes of OSPI chip ID. If the same phenomenon in your side with J7 EVM.

    Thanks.