SPIFI rewriting problem.

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by lintovincent88 on Thu Mar 26 01:54:24 MST 2015
    There is small problem in my spifi flash program. i can write and read the data into flash one time, when am write again int that address again i am getting 0.writing into same address results zero.and not the updated value. iam using LPC xpresso and processor is LPC 4088.
flash = S25FL127SABMFI101. am using prebuilt library for spifi. Below is the program part am used for spifi read/write. please tell me if there is anything i have to do in this code.

spifi_io_clk_init();                                   //pin initialisn
LPC_SC->SPIFICLKSEL |= 0x00000102;       //clock selection

errCode = spifiInit(LPC_SPIFI_BASE, true);         //LPC_spifi base is =0x20094000UL
memSize = spifiGetHandleMemSize(LPC_SPIFI_BASE);
if (memSize == 0)
/* No device detected, error */
return (SPIFI_ERR_GEN);

pSpifiHandle = spifiInitDevice(&lmem, sizeof(lmem), LPC_SPIFI_BASE,SPIFLASH_BASE_ADDRESS); 
if (pSpifiHandle == NULL)
return (SPIFI_ERR_GEN);
/* Get some info needed for the application */
maxSpifiClock = spifiDevGetInfo(pSpifiHandle, SPIFI_INFO_MAXCLOCK);
/* turn on memmode on for default */
spifiDevSetMemMode(pSpifiHandle, true);
errCode = spifiProgram(pSpifiHandle,SPIFLASH_BASE_ADDRESS1,data_X,sizeof data_X);
errCode = spifiRead(pSpifiHandle,SPIFLASH_BASE_ADDRESS1,data_R,sizeof data_R);

thanks and regards