SPIFI ROM API without In-Build Liabrary

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by stanley76726 on Fri Nov 02 02:31:42 MST 2012
Hi, all!

Now I'm trying to use the SPIFI ROM API with Keil MCB4300 (NXP 4357).

I have downloaded the 'SPIFI_Test' sample code from http://www.lpcware.com/content/nxpfile/lpc4350apdlzip, and it works fine.

However, it must use the 'spifi_drv_M4.lib' whose size is 38KB and turn on the 'USE_SPIFI_LIB' compiler option. The library is too big for me.

Here comes a revised version of spifi_rom_api.h:

#define  SPIFI_ROM_PTR    (0x10400118)
#define define_spifi_romPtr(name) const SPIFI_RTNS *name=*((SPIFI_RTNS **)SPIFI_ROM_PTR)
#endif /* OMIT_ROM_TABLE */

extern SPIFI_RTNS spifi_table;
#endif/* USE_SPIFI_LIB */

I turned off the 'USE_SPIFI_LIB' option without using 'spifi_table' which seems to be defined in 'spifi_drv_M4.lib', and directly assigned the

address of the SPIFI ROM dispatch table (SPIFI_ROM_PTR), but it never returned while calling 'spifi_init()' function.

Can I turn off the 'USE_SPIFI_LIB' option so that I can reduce the whole code size? Thank you!