Content originally posted in LPCWare by bavarian on Thu Dec 26 13:20:42 MST 2013
Well, I think I know ;-)
The LPCOpen packages do not include examples for LPC4350 running from external flash. But of course this doesn't mean that it is not possible.
The older PDL libraries contain code for this configuration.
There is another non volatile memory on the board, a quadSPI flash which can be used as program memory. The LPC4300 has a so called SPIFI (SPI flash interface) which maps this serial memory into the memory map of the ARM core, so for the ARM it's simply an addressable memory. LPCOpen contains examples for the internal flash (LPC4357) and the SPIFI. The performance of the quadSPI is at least as good as the performance from the external NOR flash, that's why it moved a little bit into the background.
For the external flash you need to consider the following things:
1) When you start with the bootmode for the external flash, only a limited number of address pins are set up from the bootcode. It lasts for 16kbytes of code. So if you jump into a memory area > 16kbytes you need to set up more address pins before. I do this normally right in the startup.s file, then this is not longer a problem.
2) The bootcode sets the PLL to 96MHz, you need about 9 waitstates for this frequency. If you set the frequency to e.g. 204MHz you need to increase the waitstates before, otherwise you run immediately into a crash.
3) The code you use is from a Keil example, this works fine in principle, so if you take care that you port everything correctly, then it should work. Take care that the code in the array is in an area which is not cleared or reused by the linker, but I think this is easy to check with a debugger. Simply step into the code and look if there is something useful. And maybe you also see the point where it crashes.
Hope this helps a little bit.