changing SPIFI clock

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

changing SPIFI clock

381 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mhamm on Mon Jul 09 06:50:57 MST 2012
Hi

I am having trouble with the configuration the SPIFI interface. I have created an application which increases the SPIFI clock to 80MHz while running from the flash. This works while debugging when the flash has previously been programmed by the debugger. But when I reset the board, the code hangs when setting the SPIFI clock to 80MHz. The code runs as long as I do not increase the clock to more than 70MHz.

I have also found out that it is possible to switch the clock to 80MHz if I previously use spifi_init() from the spifi lib, but unfortunately I can not call this function when it resides in SPIFI memory itself. I suppose that I have to do some changes in configuration of the SPIFI driver, but there is no documentation about this driver, and I can't find the source code of the spifi driver library anywhere.

Does anybody know if there is documentation of the SPIFI configuration, source code of the driver library, or any other possibility to increase the SPIFI clock while running from flash memory?
Labels (1)
0 Kudos
2 Replies

309 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mhamm on Fri Aug 03 05:44:59 MST 2012
Thanks for your answer.

But I still have the problem that I do not find any source code of the SPIFI lib. It is only provided as a precompiled library, and when I link my code against that library, the library code ends up in flash again. I do not know how to advice the linker to move the SPIFI lib code to RAM. If I had the source code, I could put this code in a special section and then link it to RAM.

I have solved the problem by creating a new project which provides only a single function to configure the SPIFI and have set up the extra project to create RAM code. Then I include the binary image of this project in my main project, copy the image to its RAM address, and then jump to the configuration function. This works, but I think there must be a better solution than that.
0 Kudos

309 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by drs on Tue Jul 24 11:55:30 MST 2012
You can change the SPIFI clock while running from SPIFI as long as the change is within the range that the clock mode, the layout of your board, the device you are using, etc, is able to support.

What you cannot do is change the clock mode while running from SPIFI. This will definitely not work.

It is possible that the bootloader is configuring the SPIFI in SAFE mode and that the combination of this mode and your hardware can only support up to 70MHz. The spifi_init() routine sets the mode based on the clock rate you request and it was probably setting the mode to something other than SAFE which can support 80MHz on your hardware and with the flash part you are using.

I think the best solution for your situation is to jump to SRAM and change the SPIFI clock rate there, then jump back and continue on your way.
0 Kudos