Other Parts Discussed in Thread: C2000WARE
Hi Engineers,
I am currently working on an Application on TMS320F28004x using Flash API. I would like to use the version embedded in Boot ROM.
The F021_ROM_API_F28004x_FPU32.lib I already included in my project. The Mapfile knows the symbols with locations that reside in BOOT ROM:
I wrote a very simple Program for testing Flash API on F280049 Control Card. Unfortunately, my program crashes to ILLEGAL ISR just when executing the LCR Instruction to jump to Boot ROM.
My question is: Did I forget a setting in my Code to be able to branch to BOOT ROM?
// Included Files
//
#include "F28x_Project.h"
#include "F021_F28004x_C28x.h"
//
// Defines
//
#define DEVICE_GPIO_PIN_LED1 31
void Example_CallFlashAPI(void);
//
// Main
//
void main(void)
{
//
// Initialize device clock and peripherals
//
InitSysCtrl();
//
// Initialize GPIO and configure the GPIO pin as a push-pull output
//
InitGpio();
GPIO_SetupPinMux(DEVICE_GPIO_PIN_LED1, GPIO_MUX_CPU1, 0);
GPIO_SetupPinOptions(DEVICE_GPIO_PIN_LED1, GPIO_OUTPUT, GPIO_PUSHPULL);
//
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
//
DINT;
InitPieCtrl();
IER = 0x0000;
IFR = 0x0000;
//
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
//
InitPieVectTable();
//
// Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
//
EINT;
ERTM;
//
// Loop Forever
//
Example_CallFlashAPI();
for(;;)
{
//
// Turn on LED
//
GPIO_WritePin(DEVICE_GPIO_PIN_LED1, 0);
//
// Delay for a bit.
//
DELAY_US(500000);
//
// Turn off LED
//
GPIO_WritePin(DEVICE_GPIO_PIN_LED1, 1);
//
// Delay for a bit.
//
DELAY_US(500000);
//Example_CallFlashAPI();
}
}
// Function for using Flash API
#pragma CODE_SECTION(Example_CallFlashAPI, "ramgs2");
void Example_CallFlashAPI(void)
{
Fapi_StatusType oReturnCheck;
Fapi_FlashStatusType oFlashStatus;
Fapi_FlashStatusWordType oFlashStatusWord;
EALLOW;
// Flash API must be initialized once on startup
oReturnCheck = Fapi_initializeAPI(F021_CPU0_BASE_ADDRESS, 100);
if(oReturnCheck != Fapi_Status_Success)
{
// Emit Error
//Example_Error(oReturnCheck);
}
}Best regards, Chris