Fellows,
there is a code snippet:

static int __attribute__((section(".infomemnobits"))) interf;

void critical flash_ww(int *data, int val)
{
  while(BUSY & FCTL3);
  FCTL3 = FWKEY;
  FCTL1 = FWKEY + WRT;
  *data = val;
  FCTL1 = FWKEY;
  FCTL3 = FWKEY + LOCK;
}

void write_value(int val)
{
        flash_ww(&interf, val);
}

int read_value()
{
        return interf;
}

So, any write to flash memory returns no errors,
however reading from information memory always returns zero.
Where am I wrong?

Thanks,
~d

Reply via email to