AnsweredAssumed Answered


Question asked by Kai Becker on Dec 12, 2016
Latest reply on Dec 14, 2016 by Kai Becker




we are using an LPC1850 flashless CortexM3 in our new design. We want to use a SPIFI Flash to store the

application. We already have prototypes boards.

We use IAR Embedded Workbench V7.8 and a Segger J-Link debugger for development.

Firstly we assembled an Cypress/Spansion S25FL164K0XMFI00 SPIFI flash, but we could not load the application into that flash. The IAR Flashloader always reported an error. Also the direct download with J-Link without IAR FlashLoader did not work.

Then I assembled an Cypress/Spansion S25FL129P0XMFI010 SPIFI flash. That worked! It downloads not so fast, but I works.

I´m in contact with IAR to find the reason why the S25FL164 does not work with their FlashLoader.

Unfortunately the working SPIFI Flash S25FL129P is not recommended for new designs, so for the start of the production we need a solution with another flash.


For the prototypes I have a working solution, BUT I have a problem with the speed respectively with the SPIFI Clock.


The SPIFI Clock is only running at ~18MHz.

My application with resistitve touch and 480x272 display is running a bit slow

(Main Clock is at 168MHz, external crystal with 12MHz, PLL1 is set to 16)) and I think the reason is that the SPIFI Clock is to slow.

As mentioned in the User Manual of the LPC1850 (page 51/52), the SPIFI Clock starts at boot time with 32MHz for a quad SPI Flash. The clock is reduced to 18MHz if the flash isn´t recognized. That is exactly what I see on the oscilloscope.


So my question is:

How can I increase the SPIFI Clock? What is the correct way to do that?


We are using the CMSIS drivers, also the "lpc18xx_cgu.c (V1.0)" to setup the system clocks.

I tried the following to increase the SPIFI Clock using the CMSIS driver, but the clock stays at 18MHz.




freq = CGU_GetPCLKFrequency(CGU_PERIPHERAL_SPIFI);  // -> result 18MHz
freq = CGU_GetPCLKFrequency(CGU_PERIPHERAL_SPIFI); // -> result 18MHz


I also tried to use the NXP SPIFI lib (V1.03.68)


spifiInit(LPC_SPIFI_BASE, false);
handleSize = spifiGetHandleMemSize(LPC_SPIFI_BASE);


but the call of the third line (spifiGetHandleMemSize) stalls the debugger.


The IAR FlashLoader also uses the NXP SPIFI lib and I copied that three calls from the source code of that FlashLoader.

When I ran the FlashLoader project, which executes in RAM(!), the call of spifiGetHandleMemSize works and returns 64.


Here is my question again:

How can I increase the SPIFI Clock? What is the correct way to do that?


I hope I explained my problem comprehensible. I have attached a schematic of the LPC1850 and SPIFI Flash connection.


Many thanks for any help in advantage.


Kind regards