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.

TDA3XEVM: CRC calculation on SBL after writing to QSPI

Part Number: TDA3XEVM

Hello,

I have a problem with CRC which occurs after writing to QSPI. I'm testing CRC like the following:

I have data written into QSPI on address 0xA80000. I calculate CRC with function SBLUtilsComputeCRC on this address and CRC value is correct. Then I read data from QSPI address 0xA80000, change the endianess in DDR and write it back to memory on address 0x1080000. When I calculate CRC on address 0x1080000 I get different value. I checked with memory browser and data on the address 0x1080000 are the same as on the address 0xA80000. To check it again I removed writing to QSPI and just calculated the CRC on address 0x1080000 (I assumed that memory on this location want be changed and I just burned new SBL in QSPI). In this case CRC is correct. I tried to invalidate cache using function UNICACHEWriteBackAndInvalidateAll(SOC_IPU1_UNICACHE_MMU_CONF_REGS_BASE, UNICACHE_WAIT_INFINITE); but it brings no difference. I tried with enabling and disabling cache but it didn't affect calculation.

Do I need to use EDMA for this? If so, how?

I'm working on VSDK 2.12.1.

Can you see something wrong done here?

Best regards,
Sasa Mihajlica

  • Hi Sasa,

    Can you sent me the data stored at 0xA80000 and 0x1080000 (stored after changing endianess)?

    Thanks & Regards,
    Vivek Dhande.
    Texas Instruments (India) Pvt Ltd
  • Hi Vivek,

    Here are to binary file containing data from mentioned addresses.

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/DataQSPI.7z

    Best regards,
    Sasa

  • Hi Mihai,

    For calculating the CRC on address 0x1080000 what API did you use?

    Regards,
    Rishabh
  • Hi Rishabh,
    I used function SBLUtilsComputeCRC.

    Best regards,
    Sasa
  • Hi Mihai,

    Can you share the code snippets for both working and non-working cases.

    Regards,
    Rishabh
  • Hi Rishabh,

    in following archive are two files. One with function for CRC calculation and the other with function calls and comments about behavior.

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/crc.7z

    Best regards,
    Sasa

  • Hi Mihai,

    The code looks fine. After rewriting the data to the qspi flash can you add prints so as to read the data at 0xA80000, 0xA80004, 0x1080000 and 0x1080004.

    void testFunction()
    {
        crcTest(0xA80000, 0x557000); 

        qspiReader(rprcAddress, 0xA80000, 0x557000);
        qspiFlashRewriter(rprcAddress, 0x1080000, 0x557000);

        // Add prints here
        crcTest(0x1080000, 0x557000);
    }

    Regards,

    Rishabh

  • Hi Rishabh,

    I tried your advise and it brings me some some conclusions.

    Because this addresses are offsets, I had pointer on addresses 0x5CA8000C, 0x5CA8000D, 0x5D08000C, 0x5D08000D. Because values on addresses which you mentioned should be zeros I changed the addresses to ones that should have non-zero values. When I printed values they were different than expected an all the addresses. Then I tried it with addresses 0x5C080000, 0x5C080001, 0x5C080002, 0x5C080003 which should be start of IPU1_0 RPRC and those R, P, R, C characters should be values on those addresses, but they weren't there. When I removed line qspiFlashRewriter(rprcAddress, 0x1080000, 0x557000); memory appeared to be correct on those positions ( I had R, P, R, C characters on mentioned addresses).
    As far as I know, those addresses are not real representations of QSPI, just images of it in memory, so changes in this memory does not affect QSPI memory. Am I right? Why this memory is changed during program execution(specifically during writing to QSPI)? Is there any possibility to access the real QSPI memory and read the values from there?

    Best regards,
    Sasa

  • Hi Mihai,

    I wanted to read word by word i.e. 32 bits in one read because I think the issue is with endianness swap.
    Can you please check that and get back.
    Thanks.

    Regards,
    Rishabh
  • Hi Rishabh,

    I'm providing you with code snippet which I used for printing values, as well as with output of executions.

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/log.7z

    I hope this will be helpful to you and this should explain better what I was writing before.

    Best regards,
    Sasa

  • Hi Mihai,

    I can now understand your previous comments related to QSPI memory contents and issues with regards to CRC.

    QSPI memory can be accessed via two modes: CFG mode and memory mapped mode.

    You can use either mode for read/write operations. But reads can be done more efficiently in memory mapped mode and writes are more efficient in CFG mode.

    When you are calling qspiFlashRewriter, you are not changing back to memory mapped mode and hence you can't see the actual memory contents.

    Modify your code as below:

    void testFunction()
    {
        crcTest(0xA80000, 0x557000);  

        qspiReader(rprcAddress, 0xA80000, 0x557000);  
        qspiFlashRewriter(rprcAddress, 0x1080000, 0x557000);
        
        QSPISetMAddrSpace(SOC_QSPI_ADDRSP0_BASE,
                          (uint8_t) QSPI_SPI_SWITCH_REG_MMPT_S_SEL_MM_PORT);
        QSPI_ConfMAddrSpace((uint8_t) QSPI_SPI_SWITCH_REG_MMPT_S_SEL_MM_PORT,
                            QSPI_CS0);
        crcTest(0x1080000, 0x557000);  
    }

    Regards,

    RIshabh