Content originally posted in LPCWare by nils28 on Tue Oct 22 08:49:50 MST 2013Hi !Until today, I worked on LPC4330 with a SPIFI. I was able to load with red suite some code into SPIFI and at startup, paste code into internal RAM to run software. I used SPIFI driver LPC18_43_SPIFI_8MB_64KB.cfx in MCU settings.Now I use LPC4337 and I want to keep my SPIFI to store some big data (like pictures for an OLED…). Then I added the following memory configuration (MCU Settings) : MEMORY
{
/* Define each memory region */
MFlashA512 (rx) : ORIGIN = 0x1a000000, LENGTH = 0x80000 /* 512k */
MFlashB512 (rx) : ORIGIN = 0x1b000000, LENGTH = 0x80000 /* 512k */
SPIFI_16MB (rx) : ORIGIN = 0x14000000, LENGTH = 0x1000000 /* 16384k */
RamLoc32 (rwx) : ORIGIN = 0x10000000, LENGTH = 0x8000 /* 32k */
RamLoc40 (rwx) : ORIGIN = 0x10080000, LENGTH = 0xa000 /* 40k */
RamAHB32 (rwx) : ORIGIN = 0x20000000, LENGTH = 0x8000 /* 32k */
RamAHB16 (rwx) : ORIGIN = 0x20008000, LENGTH = 0x4000 /* 16k */
RamAHB_ETB16 (rwx) : ORIGIN = 0x2000c000, LENGTH = 0x4000 /* 16k */
} |
With the linker I added the lines: .spifi_data 0x14000000 :
{
__spifi_data_SA0 = .;
*(.spifi_data.SA0)
. = ALIGN(4);
__spifi_data_SA0_end = .;
} > SPIFI_16MB |
And the definition of a variable as global variable in main.c __attribute__ ((section(".spifi_data.SA0")))
uint32_t SpifiData[5]; |
The results in map file is OK as you can see here : .spifi_data 0x14000000 0x14
0x14000000 __spifi_data_SA0 = .
*(.spifi_data.SA0)
.spifi_data.SA0
0x14000000 0x14 ./src/main.o
0x14000000 SpifiData
0x14000014 . = ALIGN (0x4)
0x14000014 __spifi_data_SA0_end = . |
My problem is how to load this data in SPIFI with RedSuite when launching the LPC4337 debug? As all my software is running in LPC4337 internal flash bank A, I need LPC18x7_43x7_2x512_BootA.cfx flash driver which don’t know how to load a data in SPIFI and I can’t use both flash driver in a same time.I can’t use Flash Bank B because it is too small for my pictures.Thanks for your answer.Best RegardsOriginal Attachment has been moved to: main_2.c.zip