lpcware

SPIFI change memory mode to command mode

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by cojanprins on Wed Feb 25 07:07:53 MST 2015
Hello,

I'm using the keil MCB1800 demoboard with LPC1857. I have made a special bootloader, it copies the userimage from SPIFI to SDRAM and execution works fine.

Now I want to use a part of the SPIFI to read/write some datablocks. How can I get the SPIFI flash out of memory mode? I tried it by doing:

  if (LPC_SPIFI->STAT & 0x01)
  {
    printf("SPIFI in memory mode!\n\r");
    LPC_SPIFI->STAT = 0x10;
    while(LPC_SPIFI->STAT & 0x01);
  }

but the program freezes completely.

but also a direct "reset" :

  LPC_SPIFI->STAT = SPIFI_STAT_RESET;
  for(t0 = TimerMsCnt; TimerMsCnt - t0 < 128; )
  {
    stat = LPC_SPIFI->STAT;
    if ((stat & SPIFI_STAT_RESET) == 0)
      return 1;
  }

it completely freezes.

What am I doing wrong?

Thanks in advance.

Outcomes