I tried to run the ""spifi_polling_transfer"" code on EVK 540s0xx board and it works perfect.
Not sure why it does work on my custom board with controller LPC54016 and the winbond I am using is W25Q80DV.
I am able to read the memory and erase it successfully but when I try to write it, it writes from 0x10000000 to 0x17FFFFFF location.

I tried to check the frequency of SPIFI, by
spifiFreq = CLOCK_GetSpifiClkFreq();
and it is 96Mhz. Not sure if it is the configuration?
#ifdef W25Q128JVFM
/* SPIFI Descriptor - W25Q128JVFM */
(void (*)(void))0x00000000, // 0xFFFFFFFF to default 1-bit SPI mode ;DevStrAdr
(void (*)(void))0x001870EF, // mfgId + extCount
(void (*)(void))0x00000000, // extid 0-3
(void (*)(void))0x00000000, // reserved
(void (*)(void))0x1301001D, // caps
(void (*)(void))0x00000100, // Blks + RESV1
(void (*)(void))0x00010000, // blkSize
(void (*)(void))0x00000000, // reserved
(void (*)(void))0x00000100, // pageSize + RESV2
(void (*)(void))0x00003F00, // maxReadSize
(void (*)(void))0x68506850, // maxClkRate,maxReadRate,maxHSReadRate,maxProgramRate
(void (*)(void))0x04030050, // maxHSProgramRate,initDeInitFxId,clearStatusFxId,getStatusFxId,
(void (*)(void))0x14110D09, // setStatusFxId,setOptionsFxId,getReadCmdFxId,getWriteCmdFxId
#endif
Do I need to change anything here?
If I am able to erase and read then I think the configuration is correct. Not sure what's going wrong with the write operation.
Also I changed the Program page command from 31H to 01H according to the W25Q80 datasheet
//{1, false, kSPIFI_DataOutput, 0, kSPIFI_CommandAllSerial, kSPIFI_CommandOpcodeOnly, 0x31}};
{1, false, kSPIFI_DataOutput, 0, kSPIFI_CommandAllSerial, kSPIFI_CommandOpcodeOnly, 0x01}};
Any help will be appreciated.