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.

RTOS/TDA2P-ACD: QSPI Memory Mapped Port Setting

Part Number: TDA2P-ACD


Tool/software: TI-RTOS

In TDA2P Ref Manual,The QSPI module of the TDA2P has a memory mapped register interface, which provides a direct interface for accessing data from external SPI devices and thus simplifying Software requirements.

For this purpose, as I understand, we should configure the register QSPI_SPI_SETUP0_REG since we use CS0 and then switch to SFI_MM_IF block. In the QSPI_SPI_SETUP0_REG, we can set one read command, one write command and other needed settings. In our case, we have a QSPI NAND Flash from Winbond on our custom board. For reading and writing the flash, we should use two commands.

In our case, is there any possibility for a direct access to external QSPI Flash over memory region that is associated with the memory mapped port?

if yes, how can we do it?

If no, I have an idea, maybe I can manually read our tiimage and Appimage from QSPI flash then copy it to the memory region for the memory mapped port. Do you think, that it is possible? Although, we don’t prefer this solution, because maybe it will add more boot time.

For Information, we use SDK 3.03

BR,

Andi

 

  • Hi Andi,

    Can you refer to TDA2Px SBL? While initializing the QSPI you need to set flash type as Winbond.
    You can see API SBLUtilsQspiBootRprc in <pdk>\packages\ti\boot\sbl_auto\sbl_utils\src\tda2xx\sbl_utils_tda2xx.c.

    Regards,
    Rishabh

  • I refered already to TDA2PX SBL. The flash type is correct detected during initializing. But in <pdk>\packages\ti\boot\sbl_auto\sbl_utils\src\tda2xx, we realize that our winbond Flash is a new chip, and different with Standard winbond in the source Code. So we should make some modification in source code, to make it work.

    My Question above is related to QSPI_ConfigFlashDevInfo inside QSPI_Initialize. There the QSPI_SPI_SETUP0_REG should be configured.

    So can you please give me hint how to use the feature of QSPI modul from TDA 2P to get a direct interface for accessing data from external SPI devices, in our case with two commands for reading and writing the QSPI flash?
  • Andi,

    You need to refer to the datasheet of the new QSPI flash for the read and write commands, num of address bits, etc.
    Then you need to modify the QSPI_GetDefaultFlashDevInfo API.
    My suggestion would be to reuse the winbond flash branch and modify it accordingly instead of adding a new flash to qspi library.
    Hope this helps.

    Regards,
    Rishabh
  • Hi Rishabh,

    I did modify the winbond Flash branch, and didn't add a new Flash to qspi library. With the modification, I can read, erase and write the QSPI NAND Flash directly.

    But my Question is about the feature that TDA2P offer. In TDA2P Ref Manual 26.4.1 Quad Serial Peripheral Interface Overview, The QSPI module of the TDA2P has a memory mapped register interface, which provides a direct interface for accessing data from external SPI devices and thus simplifying Software requirements. How to modify the source Code for our QSPI Nand FLash?

    Regards,
    Andi
  • Andi,

    I am unable to understand the issue you are facing.
    QSPISetMAddrSpace and QSPI_ConfMAddrSpace calls set the QSPI in memory mapped mode.
    If you have set the commands correctly then SBL should be able to read in memory mapped mode.
    Do you mean that you are able to flash in CFG mode but not able to read in Memory mapped mode?

    Regards,
    Rishabh
  • Hi Rishabh,

    Sorry to make you confuse.

    Exactly, my issue is, I don't know how to set the commands correctly, so that I am not able to read in Memory mapped mode.

    For reading in Memory mapped mode, I should send two commands, but there is only one space for read command in QSPI_SPI_SETUP0_REG. does it mean, that it is not possible for me to read in Memory mapped mode?

    Regards,
    Andi
  • Hi Andi,

    There is only one read command. You need to set dummy address bits, address bits, etc. correctly.
    Can you specify the two read commands that you are talking about?
    Is it something specific to the flash you are using?

    Regards,
    Rishabh
  • Hi Rishabh,

    From datasheet of QSPI Flash, I get this Statement:
    The Read Page Data instruction will transfer the data of the specified memory page into the Data Buffer.
    The Read Data instruction allows data bytes to be sequentially read from the Data Buffer after executing the Read Page Data instruction.

    In source Code, I can read directly from Flash, only if I send the read page data instruction first, then send read data instruction.

    If you have any solution, please let me know.

    Regards,
    Andi
  • Hi Andi,

    What is the flash part you are using?
    Can you share the data sheet of that.

    If the flash requires that 2 separate commands to be sent to read the data then it cant be done from the memory mapped mode.

    Regards,
    Prasad

  • Hi Prasad,

    we are using W25N01JWTB

    the datasheet is attached here.

    W25N01JW AG preliminary Rev A 041119.pdf

    Since read the Flash data from the memory mapped mode cant be done, is it possible to write manually the Flash data to the Memory Region for Memory mapped port (QSPI_ADDRSP1)? If possible, Maybe you have some hints for us, how to do it? Because it seems, we cant directly write into the Memory Region.

    if you have better solution, please let me know.

    Regards, 

    Andi

  • Hi Andi,

    The flash you are using requires you to read the data in buffer first and then read from there.
    This cant be supported by the memory mapped mode.
    With mem mapped mode, max you might be able to read 2k byte page buffer only which is already fetched.

    It is better to use the cfg port mode, which supports all type of SPI transactions.
    You might have to modify the read and write functions.

    Also for the write operation mem mapped mode is not recommended.

    Regards,
    Prasad
  • Hi Andi,

    Is there an update on this?

    Regards,
    Rishabh