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.

TM4C129ENCPDT: TM4C129ENCPDT

Part Number: TM4C129ENCPDT


Tool/software: CCS

HI,i am suing quad spi to write to and read from flash .reading data from flash uing qspi is working but not able to write in qspi mode.if i am using the above function for flash write which is in legacy mode it writes data correctly.what could be the issue?

bool flashWrite(uint32_t ui32Base, uint32_t address, uint8_t *data,
uint32_t length)
{

flashWriteEnable(SSIBase);
SSIAdvModeSet(ui32Base, SSI_ADV_MODE_WRITE);
SSIDataPut(ui32Base, FLASH_COMMAND_PAGE_PROGRAM);

SSIDataPut(ui32Base, (address >> 16) & 0xff);
SSIDataPut(ui32Base, (address >> 8) & 0xff);
SSIDataPut(ui32Base, address & 0xff);

while (length-- != 1)
{
SSIDataPut(ui32Base, *data++);
}

SSIAdvDataPutFrameEnd(ui32Base, *data);
waitFlashReady();
return 1;
}

void flashQuadRead(uint32_t ui32Base, uint32_t ui32Addr, uint8_t *pui8Data,
uint32_t ui32Count)
{
uint32_t ui32Trash;

while (SSIDataGetNonBlocking(ui32Base, &ui32Trash) != 0)
{
}

SSIAdvModeSet(ui32Base, SSI_ADV_MODE_WRITE);

SSIDataPut(ui32Base, FLASH_COMMAND_QREAD);

SSIDataPut(ui32Base, (ui32Addr >> 16) & 0xff);
SSIDataPut(ui32Base, (ui32Addr >> 8) & 0xff);
SSIDataPut(ui32Base, ui32Addr & 0xff);

SSIDataPut(ui32Base, 0);

SSIAdvModeSet(ui32Base, SSI_ADV_MODE_QUAD_READ);

if (ui32Count == 1)
{

SSIAdvDataPutFrameEnd(ui32Base, 0);
}
else
{

SSIDataPut(ui32Base, 0);

while (--ui32Count != 1)
{

SSIDataPut(ui32Base, 0);

SSIDataGet(ui32Base, &ui32Addr);
*pui8Data++ = ui32Addr & 0xff;
}

SSIAdvDataPutFrameEnd(ui32Base, 0);

SSIDataGet(ui32Base, &ui32Addr);
*pui8Data++ = ui32Addr & 0xff;
}

//
// Read the final data byte from the receive FIFO and place it into the
// data buffer.
//
SSIDataGet(ui32Base, &ui32Addr);
*pui8Data++ = ui32Addr & 0xff;
}