Hi:
I'm using following code to confirm write data in QFlash in AWR1642 EVM, the flash part number is MX25V1635F:
QSPIFlash_writeEnable(hQspiFlash); QSPIFlash_singleWrite(hQspiFlash, (uint32_t)uFlashAddr, 8, (uint8_t *)&sBootLoaderRecvObj.aMsgData[0]); QSPIFlash_singleRead(hQspiFlash, (uint32_t)uFlashAddr, 8, (uint8_t *)&gReadDataArray[0]); QSPIFlash_writeDisable(hQspiFlash); uRetVal = memcmp(&sBootLoaderRecvObj.aMsgData[0],&gReadDataArray[0],8);
The memcmp function always return false, meanning what I'v written to flash and what I read back from flash does not match. The QSPIFlash_singleRead() function always ignore the first byte.
I've rebuilt the qspiflash driver lib by using gmake drv, replace the default qspiflash_device_spansion.c file with qspiflash_device_macronix.c in building.
I go into ti\drivers\qspiflash\src\qspiflash_device_macronix.c, and find the driver use single read mode to read data. The MX25V1635F requires the logic as follows:
There is an additional dummy read in QSPIFlash_singleRead() function at line 776:
QSPIFlashWriteByte(QSPIHandle, 0U, dataLen + 1U);
If I annotate this line and build again, the Qspi flash works well.
I think this is a bug. Thank you!