Content originally posted in LPCWare by MX21 on Thu Oct 23 12:16:53 MST 2014
I haven't tried the newer version of LPCxpresso IDE yet, but it appears this problem has to do with resetting the LPC1857 rather than the tools. I can do the following outside of the debugger and get similar results:
I am running a loader program in bank B. I send a binary of an application to the loader, which erases and programs bank A. At the end, it calls Chip_IAP_SetBootFlashBank to validate bank A (and invalidate bank B), then calls NVIC_SystemReset. The chip does reset, but then runs from bank B. If I press the reset button (pull chip reset pin low), then it runs bank A (actually, it doesn't really run, probably due to not setting vectors correctly, but that's another story).
So it seems that reset through the debugger or reset via NVIC_SystemReset does not really go through the full boot process to check if the flash is valid. It looks as if it just jumps back to the start of code.