Content originally posted in LPCWare by PhilYoung on Tue Mar 27 06:34:04 MST 2012
I've got a custom board with 16 bit external flash, written a flash loader and created an application image to run from it.
If I reset the board with boot pins all pulled low, then connect with the debugger and set PC = 0x1c000000, SP = 0x20090000 then run the app it runs fine, so my startup code etc works fine.
I then changed jumpers and tested the boot pins as IO using the debugger to ensure they are set to boot from external 16 bit flash, all ok.
If I try to boot from external flash nothing happens.
then using the debugger to access the target the external flash is not visible, but making it visible using the debugger and setting PC / SP as before it crashes.
If I then reset the CPU using the debugger and try again the app runs perfectly.
The startup code begins by setting BASE_M4_CLK to IRC before doing anything else, so it should not be timing related.
I even tried putting a boot code which simply loops to itself at 0x1c000000 until I get in with the debugger and set R0 = 1, but when I connect with the debugger it is not executing at 0x1c000000.
so it appears that the boot rom is not setting up the memory controller since the flash is not visible when trying to boot from 16 bit nor flash.
Anybody got any suggestions?.
regards
Phil.