Flash N25Q03. on xmc4500 relax kit

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User22217
Level 1
Level 1
First reply posted First question asked
Hi,
Flash N25Q03.
I need to save and read an struct to the flash.

example of the struct:

typedef struct TparDiv
{
uint32_t SsTime; //minutos
double SsTmax;
double SsPot;
double StByTemp;
uint32_t zCF;
uint32_t SisOp;
} TparDiv_t;


Declaration of the struct
TparDiv_t TparDiv;

code
if(DIGITAL_IO_GetInput(&BT_1))
{
N25Q03_WriteEnable();
st=N25Q03_StatusRead();
N25Q03_SectorErase( 0x00000000);
do
{
st = N25Q03_StatusRead();
} while (st & 0x0001); /* wait until busy=0 */



TparDiv.SsPot=40.0;
TparDiv.SisOp=2;

N25Q03_ProgrammPage( 0x00000000,(uint8_t *)&TparDiv,sizeof(TparDiv));

N25Q03_ReadPage(0,(uint8_t *)&readval,sizeof(readval));

Can any one help me with that?

i am trying using the N25Q03_ProgrammPage and the read page as well fuction but it´s not working

thanks in advance
0 Likes
0 Replies