Executing code from SPIFI while also using serial flash for data storage?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Executing code from SPIFI while also using serial flash for data storage?

1,695 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mirfan on Fri Feb 01 00:49:16 MST 2013
Hi,
I am using LPC4350's SPIFI interface for executing code from serial flash. What i need to know is that is it possible that the serial flash connected to SPIFI (from which code is being executed) be also used as a normal flash memory for general purpose data storage. Can I write data to the serial flash using SPIFI interface and run code from it simultaneously?

Thanks
Irfan
标签 (1)
0 项奖励
回复
5 回复数

1,641 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by noahk on Fri Feb 15 12:04:28 MST 2013
Hi Irfan,

Can you post a sample project that demonstrates the issue? What SPI Flash are you using?

Noah
0 项奖励
回复

1,641 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mirfan on Thu Feb 14 23:55:24 MST 2013
Hi Noah,

I have started working on to customize my code to use SPIFI interface directly to work with my SPI Flash. But, it is surely going to take some time to get in some sort of shape. In the meanwhile, does NXP provide any example where code is executed from SPI Flash while also using it as a storage media? May be I can get some help from that reference source or its custom liker script? Can I get the source to the SPIFI library itself? :) I do not intend to redistribute it, but only to dig into it to find the point of exception? (The call stack that I shared earlier actually tells us that an exception is being thrown from inside the spifi library).

I have already tried moving the memcpy from SPIFI to external SDRAM, but the issue still remained the same.

Thanks
Irfan
0 项奖励
回复

1,641 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by noahk on Tue Feb 05 00:52:41 MST 2013
Hi mirfan,

First of all, the LPC43xx documentation has been updated to include a full description of the SPIFI module. This allows you to customize your code to work with your SPI FLASH device.
http://www.nxp.com/documents/user_manual/UM10503.pdf (Chapter 22)

Can you try putting Safe_EraseFlash in SDRAM as opposed to in SPIFI.

It would be good if you could step through the assembly and see where it goes into the weeds. Put a breakpoint at pSpifi->spifi_erase, and then a breakpoint after it returns.

Some of the forums talk about a memcpy routine being called from the SPIFI library. Is it possible that memcpy is still in SPIFI?

Noah
0 项奖励
回复

1,641 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mirfan on Mon Feb 04 03:05:03 MST 2013
Thanks noahk.

This was my first guess. I have linked the spifi library to the SDRAM so that the SPIFI library calls get executed from SDRAM. But, I always find my system hung up inside the SPIFI library call and if I pause I get this system call stack every time:

Thread [1] <main> (Suspended : Signal : SIGINT:Interrupt)
0xfffffffe
<signal handler called>() at 0xfffffff9
0x28000460
0x2800142a
Safe_EraseFlash() at safe_tgt.c:319 0x1400d932

Safe_EraseFlash() calls pSpifi->spifi_erase, and as you can see, the link register switches from SPIFI memory space to SDRAM's space as it calls spifi_erase. Any ideas to why this is happening? I do not have any source code for SPIFI, neither could I find it anywhere. Is it available anywhere?

Also, this code works just fine when executed entirely from SDRAM (i.e. SPIFI is only used for memory storage).
0 项奖励
回复

1,641 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by noahk on Fri Feb 01 07:06:24 MST 2013
Hi Irfan,

You can jump to an SRAM routine to do the writing, and then jump back to SPIFI. But simultaneous execution from SPIFI and writing is not supported as the as command and memory mode are not able to operate at the same time.

You can see the SPIFI description in:
www.nxp.com/documents/user_manual/UM10503.pdf
Chapter 22

Noah
0 项奖励
回复