Part Number: TMS320F28069M
Other Parts Discussed in Thread: MOTORWARE
I am trying to use the flash API to emulate EEPROM on a board that runs the Motorware proj_lab09a. To do this I used code from Example_Flash2806x_API from c2000 ware.
For testing purposes I inserted the following code right before the for(;;) loop in main():
EALLOW;
Flash_CPUScaleFactor = SCALE_FACTOR;
Flash_CallbackPtr = NULL;
EDIS;
FLASH_ST FlashStatus;
static uint16_t status = 1;
flashVersion = Flash_APIVersionHex();
Flash_Erase((SECTORG|SECTORH),&FlashStatus);
uint16_t buffer[0x100];
int i = 0;
for(i=0;i<0x100;i++)
{
buffer[i] = 0x100+i;
}
uint16_t *Flash_ptr = Sector[0].StartAddr;
Flash_Program(Flash_ptr,buffer,0x100,&FlashStatus);
status = Flash_Verify(Flash_ptr,buffer,0x100,&FlashStatus);
When I run the code, the program drops to PIE_illegalIsr() when it reaches Flash_Erase(). And if I comment out the erase function, it does the same at Flash_Program(). When I run the lab09 and the flash api example separately, there is no problem in either.
What am I missing?