Part Number: TMS320F28027
Hi,
I've write a bootloader project based on "f28027_flash_kernel" example project offered by TI. And I've loaded the project to FLASHA, the main function is as below:
Uint32 main(void)
{
//GPIO and SCI are still setup from Sci_Boot()
//Setup sysctl and pll
//DisableDog();
IntOsc1Sel();
memcpy(&RamfuncsRunStart, &RamfuncsLoadStart, (size_t)&RamfuncsLoadSize);//copy SCI_Boot() from flash to RAM
InitPll(DSP28_PLLCR,DSP28_DIVSEL);
InitFlash();
DELAY_US(100);
return SCI_Boot();
}
SCI_Boot() function is the function for upgrading the application reside in FLASHB, FLASHC, FLASHD.
It works well to upgrade the application project.
And then I want to upgrade the bootloader itself which reside in FLASHA, then I need to erase FLASHA in SCI_Boot(), the code is as below:
status = Flash_Erase((SECTORA | SECTORB | SECTORC | SECTORD), &FlashStatus);
but when CPU execute this code, it will run into illegal trap interrupt.
Does it mean that I cannot erase the FLASH sector which the main function reside in? I've already copied SCI_Boot() to RAM.
Thanks.