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.

AM4372: about the source code of "QSPI_v1.c"

Part Number: AM4372

Hi everyone,

I have a question about the source code of "QSPI_v1.c".

My software:
- processor_sdk_rtos_am437x_5_01_00_11
- C:\ti\pdk_am437x_1_0_12\packages\ti\drv\spi\src\v1\QSPI_v1.c

The following code is around line 877 of this source code.

if(wordLenBytes <= 4U)
{
/* Formulate the 32 bit word to write to data register */
for(idx = 0U; idx < wordLenBytes; idx++)
{
dataVal[0] |= (((uint32_t)(*srcAddr) << (8u - (8u * (idx + 1u)))));
srcAddr++;
}

numWords = 1U;
}

In this source code, I think that it does not work if wordLenBytes is not 0.
Because (8u - (8u * (idx + 1u) is negative.

Is this source code incorrect?
Please let me know if you have the correct code.

Best regards,
Sasaki

  • Sasaki,

    your evaluation of the code seems to be correct. I have consulted with the driver developer and the for loop does seems like an implementation issue but it seems to be working as most of the command write protocols have a 1 byte of command to be sent which seems to be placed in the right dataVal location in the driver when communicating with the flash.

    We will try to fix the implementation so that the loop can be eliminated. Can you confirm that you are not seeing any functional issues with the driver due to this implementation.

    Regards,
    Rahul
  • Hi Rahul-san,

    Rahul Prabhu said:


    We will try to fix the implementation so that the loop can be eliminated. 

    Thank you for your support. We will wait for it.

    Rahul Prabhu said:


    Can you confirm that you are not seeing any functional issues with the driver due to this implementation.

    Yes, we can.

    Best regards,

    Sasaki