LPC4330 SPIFI lib

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC4330 SPIFI lib

1,329 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by cto4260 on Tue May 10 12:29:04 MST 2016
Hey guys,

i want to use the LPC 4330 NGX Xplorer board with the onboard SPIFI in quad mode.

I am using the spifilib example from the 4330 LPCOpen, but after executing the line:

/* Initialize LPCSPIFILIB library, reset the interface */
spifiInit(LPC_SPIFI_BASE, true);


the LPC does not execute code any more.

The 2nd argument (true) means, that the spifilib will reset the SPIFI interface. I think it's not possible, when we execute code from SPIFI while resetting the interface, right?

Can someone help me?

Kind regards,
Marvin
Labels (1)
0 Kudos
Reply
4 Replies

1,209 Views
lpcware
NXP Employee
NXP Employee
bump
0 Kudos
Reply

1,209 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mc on Mon May 16 09:04:44 MST 2016
Hi Marvin/Martin,
Please look into example at below page. As mentioned above you need to relocate portion of the code in the RAM

https://www.lpcware.com/content/project/nxp-peripherals/spifi-nxp-microcontrollers
0 Kudos
Reply

1,209 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Sun May 15 09:22:10 MST 2016
So if you are trying to manipulate, the code you are using to do this should not be running from SPIFI - i.e. you need to be running that portion of your codebase from RAM. There are several previous threads in the forums about how to approach doing this.

Regards,
LPCXpresso Support
0 Kudos
Reply

1,209 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by inspire on Thu May 12 10:44:52 MST 2016
Please let me further explain Marvin's problem. (We are working together on this.)

In fact, the software is already placed in the SPIFi with the LPC18_43_SPIFI_16MB_64KB.cfx flash driver. The program can be executed properly from here. We now want to enable the quad mode (the SPIFI doesn't run at maximum speed by default, right?).

Marvin tried to use the spifiInit command with the reset-flag enabled. Instead, if the spifiInit command is used without the reset-flag, the program continues but later it hangs at
memSize = spifiGetHandleMemSize(LPC_SPIFI_BASE);


I had a closer look at the exact line where the program hangs and I figured out that always when there is a write to e.g. the pSpifi->CMD register, the LPC stops.
(In fact, the function steps are:
spifiGetHandleMemSize(...) -> spifiPrvPartDetect(...) -> spifiPrvDevDetect(...) -> pPrvspifiPrvDevGetID which is the same as spifiPrvDevGetID(...) -> spifi_HW_SetCmd(...) -> pSpifi->CMD = cmd;)
If the debugger is paused, the following error is thrown:

Quote:
(crt_emu_cm_redlink) terminating due to loss of debug control




What exactly causes the program to hang here? Is it caused because the program is already executed from the SPIFI and it is not possible to change the SPIFI settings afterwards? What could we do instead?

Thanks in advance!
Martin

p.s. hi, Marvin
0 Kudos
Reply