I'm having a problem trying to implement a bootloader and application code in the same bank.
The scenario is that follows: A LPC1837 (micro controller from NXP) with a bootloader that occupies the first 64 kB of the FLASH A BANK (sectors 0 to 7). I want to write application image on the following sectors of the on-chip flash (sectors 8 to 14) at the same bank.
The problem is when I try to write the flash using the IAP calls (prepare, erase, prepare, write) the core raises a hardfault. but same code is working when i changing the "destination" to the on-chip flash BANK B, the whole procedure works fine. I've already checked the content of the FLASH B after running the application image, and it's fine.
I want to know the reasons for this problem.
ans also Is there any ways to write a image in the same bank ?
So maybe try to locate the flash code into RAM? Note that it's a common problem for processors running from flash to have the same flash reprogrammed while the processor tries to fetch instructions from the same flash memory.
As i'm working on this for the first can you please help me out. how to locate the Flash code into RAM
Google is your friend.
http://www.keil.com/support/docs/3228.htm