Accessing external SPIFI flash data working when starting debug through JTAG, but not when booting directly

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

Accessing external SPIFI flash data working when starting debug through JTAG, but not when booting directly

Jump to solution
1,179 Views
thomasnielsen
Contributor II

Hi all.

I got a problem with accessing the external SPIFI flash on a custom board when booting directly, but everything works nicely when starting by running a JTAG debug session.

The system has its code in the internal flash (LPC4367s not yet encrypted) and uses an external SPIFI flash for reading a lot of configuration data.

Setup is pretty standard LPCOpen, with external flash setup in the memory editor, with the generic driver selected.

The place I experience the error is when trying to read data in the external flash through the memery mappong, doing something like this:

#define NEURAL_FLASH 0x14000000
int *numbers = (int *)NEURAL_FLASH;
int ap = numbers[0];

The code will when running from a direct boot (no JTAG attached, restarting board) fail at the last line, while when JTAG debugging, it will read the data correctly.

It is almost like the memory mapping of the external flash to 0x14000000 does not happen when booting directly.

So what am I missing?

Any help with this one will be greatly appreciated.

Labels (1)
0 Kudos
Reply
1 Solution
1,016 Views
converse
Senior Contributor V

Have you set up the EMC correctly (or at all?) for your external flash device? I imagine it is working during debug because the debugger has done this for you

View solution in original post

0 Kudos
Reply
2 Replies
1,017 Views
converse
Senior Contributor V

Have you set up the EMC correctly (or at all?) for your external flash device? I imagine it is working during debug because the debugger has done this for you

0 Kudos
Reply
1,016 Views
thomasnielsen
Contributor II

Hi Con Verse.

You were totally right. Thanks a lot.

I was under the asumption that setting up the driver in the memory editor would work outside dubugging too, which is not the case.

Thanks again.

0 Kudos
Reply