NOTICE: This website will be shut down in the near future. Product content has moved to Forum content and FAQs have been moved to We encourage you to create a user account on to use the new community forums and access NXP microcontroller content. We greatly appreciate your contributions and look forward to seeing you at our new web location.


LPC1800 / LPC4300 SPIFI Flash Drivers (v7.6.0 to v 7.8.0)

lpcxpresso-support's picture

This FAQ documents the SPIFI flash driver support provided in LPCXpresso IDE v7.6 to v7.8 inclusive. If you are using an earlier version of LPCXpresso IDE, then please refer to the FAQ "LPC18 / LPC43 External Flash Drivers" instead. If you are using LPCXpresso IDE v7.9.0 or later, then please refer to the FAQ "LPC1800 / LPC4300 SPIFI Flash Drivers".


The NXP LPC1800 and LPC4300 series of MCUs provide a mechanism to allow the connection of external SPIFI flash devices, which can be used for both data storage and also for code - with support for XIP (execute in place). For LPC18x0 and LPC43x0 parts (such as LPC1830 and LPC4370) there is actually no built in flash internal to the MCU, and thus SPIFI devices are typically used for the primary storage. For other "non-zero-ending" parts, such as LPC1857 and LPC4322, these parts have internal flash, but external SPIFI devices can still be used (for example for storing graphics data).

In order to allow the use of SPIFI flash devices, LPCXpresso IDE provides mechanisms to configure the memory layout of a project to include this external flash, and then configure the debugger to use a suitable SPIFI flash driver to program the generated image down into the external flash. This configuration is carried out using the "Memory Configuration Editor". For more details, please see chapter 6 "Memory Editor and User Loadable Flash Driver mechanism" in the LPCXpresso User Guide.

NOTE: SPIFI flash is located at 0x14000000 in the LPC1800/4300 memory map.

Supplied SPIFI flash drivers

LPCXpresso IDE ships with a number of prebuilt SPIFI flash drivers based on the new generation LPCOpen lpcspifilib. lpcspifilib has a number of advantages over the previous generation SPIFI library used by older LPCXpresso releases - in particular it supports programming newer flash devices, as well as being available in source form as well as in pre-built library form.

As of LPCXpresso 7.6, the following drivers are provided:

Flash driver Flash size Sector size Supported Parts Example board fitted with a supported part
LPC18_43_SPIFI_64MB_256KB.cfx 64MB (512Mb) 256KB Spansion S25FL512S  
LPC18_43_SPIFI_32MB_256KB.cfx 32MB (256Mb) 256KB Spansion S25FL256S 256k sector  
LPC18_43_SPIFI_32MB_64KB.cfx 32MB (256Mb) 64KB Spansion S25FL256S 64k sector  
LPC18_43_SPIFI_16MB_256KB.cfx 16MB (128Mb) 256KB Spansion S25FL129P 256k Sector {S25FL128S} Hitex LPC1850 and LPC4350 (rev A5)
LPC18_43_SPIFI_16MB_64KB.cfx 16MB (128Mb) 64KB Spansion S25FL129P 64k Sector   
LPC18_43_SPIFI_8MB_64KB.cfx 8MB (64Mb) 64KB Spansion S25FL064P
Spansion S25FL164K
Macronix MX25L6435E
Winbond W25Q64FV 
Hitex LPC1850 and LPC4350 (rev A4)
LPC18_43_SPIFI_4MB_64KB.cfx 4MB (32Mb) 64KB Spansion S25FL032
Macronix MX25L3235E
Winbond W25Q32FV 
NGX LPC4330-Xplorer and LPC1830-Xplorer
Keil MCB4357 and MCB1857 
LPC18_43_SPIFI_2MB_64KB.cfx 2MB (16Mb) 64KB

Spansion S25FL016K {W25Q16DV}
Macronix MX25L1635E 

LPC18_43_SPIFI_1MB_64KB.cfx  1MB (8Mb) 64KB Macronix MX25L8035E
Winbond W25Q80BV
LPCXpresso4337 / LPCXpresso43S37 / LPCXpresso18S37 

Note : Supported parts denoted in { } in the above table are 'clones' of the part they appear next to (they have the same ID).

Alias flash drivers

For compatibility with projects created with earlier LPCXpresso IDE releases, a number of other flash driver files are supplied which are just renamed versions of the standard drivers above. The use of these 'alias' drivers in not recommend, as they may not be shipped with future LPCXpresso IDE releases.
The following is a list of alias flash drivers, with the recommended replacement driver listed in each case.
  • LPC18_43_S25FL129P_256K.cfx -> LPC18_43_SPIFI_16MB_256KB.cfx
  • LPC18_43_S25FL129P_64K.cfx -> LPC18_43_SPIFI_16MB_64KB.cfx
  • LPC18_43_S25FL164K.cfx -> LPC18_43_SPIFI_8MB_64KB.cfx
  • LPC18_43_S25FL032P.cfx -> LPC18_43_SPIFI_4MB_64KB.cfx
  • LPC18_43_MX25L3235E.cfx -> LPC18_43_SPIFI_4MB_64KB.cfx
  • LPC18_43_W25Q32FV.cfx -> LPC18_43_SPIFI_4MB_64KB.cfx
  • LPC18_43_W25Q80BV.cfx -> LPC18_43_SPIFI_1MB_64KB.cfx
  • LPC18_43_SPIFI_1MB_4KB.cfx -> LPC18_43_SPIFI_1MB_64KB.cfx
Note that the aliased driver - LPC18_43_SPIFI_1MB_4KB.cfx - is provided specifically to allow some existing projects using the LPC-Link2 as an LPC4370 evaluation board to continue working. It is not a true 4KB sector driver, it is just that the original LPCXpresso SPIFI flash driver mechanism treated the W25Q80BV device as a 4KB sector device (whereas the current mechanism uses it as a 64KB sector device).

Flash driver compatibility

The API used by flash drivers in LPCXpresso 7.6 and later was rewritten compared to earlier releases, in order to provide enhanced flash programming speeds.

This means that flash drivers provided with LPCXpresso IDE v7.6 and later are not compatible with earlier releases of LPCXpresso IDE. Flash drivers provided with earier releases of LPCXpresso IDE (or written by users to work with earlier releases) should still function with LPCXpresso IDE v7.6 and later, but will not provide the enhanced flash programming speeds that LPCXpresso IDE v7.6 and later support.

Thus if you have your own SPIFI flash driver written for use with an earlier LPCXpresso release, you may wish to consider porting it into the latest SPIFI flash driver projects (as detailed below).

Adding support for other SPIFI devices

It is planned to provide prebuilt support for further SPIFI flash devices in LPCXpresso IDE, as support for further devices is added to the underlying LPCOpen lpcspifilib.

However the actual projects used for building the supplied SPIFI flash drivers can be found in the LPCXpresso IDE examples subdirectory - so that you can modify these yourself in order to produce drivers for other SPIFI flash devices.

You can import these into LPCXpresso from:


For details of how to add support for new flash devices to lpcspifilib, please consult its documentation.

Once you have created a new or modified SPIFI flash driver, then you will need to place it into the below directory in order for LPCXpresso IDE to find it:

Your rating: None