Hello,
We are having some problems erasing flash with the F021 flash API.
Our bootloader sits in the first few sectors of bank 0 and we do not want to waste the area in the same bank above this. If I erase a sector in bank 1 everything works OK
I am aware that it is not possible to erase memory in the same bank that the code is running in so we are loading the flash API to RAM as described in the post at http://e2e.ti.com/support/microcontrollers/hercules/f/312/t/62954.aspx. I am also following the recommended flow defined in section 5 of the Flash API manual (SPNU501C).
When I try to erase a sector in the same bank, for example at address 0x160000, I get an undefined instruction exception.
If I single step past the FAPI erase function everythingworks fine. If I put a break immediately after the flow has completed but before returning from our erase function, everything works fine too. However if I put a break in the calling function at the line immediately after the call to our erase function then I am getting an undefined instruction exception.
Even though we have relocated the flash library to RAM, I notice that there are still some trampolines in flash. Is this a possible cause?
I have spent a long time trying to track this issue down. Any help would be greatly appreciated. I have attached our flash erase function.
Regards,
Richard