This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software: Code Composer Studio
Hi everyone!
I have a query about Flash programming and running ISRs in SRAM!
Whenever I flash my code (with state machine and ISRs) it goes into (ILLEGAL ISR), why is that happening?
I am using ADC ISR for all functioning (PI, startup) and scheduling in state machine (Timer 0), how to configure the CCS settings, to run code perfectly; without falling into ILLEGAL ISR
// Here is my Main File
/*
* Main.c
*
* Created on: 01-Oct-2019
* Author: Abhinav
*/
#include "F28x_Project.h"
#include "IQmathLib.h"
//
void GpioSetup(void);
void SetupEPwm(void);
void AdcInit(void);
void InitTimer(void);
void InitINT(void);
void MAVG_Init(void);
void SSramp(void);
//
__interrupt void ISR1(void);
__interrupt void SMISR(void);
//
//
void main(void)
{
InitSysCtrl();
DINT;
InitPieCtrl();
IER = 0x0000;
IFR = 0x0000;
EALLOW;
CpuSysRegs.PCLKCR0.bit.TBCLKSYNC = 0;
EDIS;
GpioSetup();
InitTimer();
InitINT();
MAVG_Init();
AdcInit();
SetupEPwm();
EALLOW;
CpuSysRegs.PCLKCR0.bit.TBCLKSYNC = 1;
EDIS;
EINT;
ERTM;
for(;;);
}
//
void InitINT(void)
{
InitPieVectTable();
EALLOW;
PieVectTable.ADCA1_INT = &ISR1;
PieVectTable.TIMER0_INT = &SMISR;
EDIS;
//
CpuTimer0Regs.TCR.all = 0x4001; // Use write-only instruction to set TSS bit = 0
//
IER |= M_INT1;
//
PieCtrlRegs.PIEIER1.bit.INTx1 = 1;
PieCtrlRegs.PIEIER1.bit.INTx7 = 1;
}
//
Regards
Abhinav Soni
Abhinav,
Just to confirm:
Are you saying that you are using Flash API in your application and is ending up in illegal ISR? If yes, make sure to execute the Flash API from RAM and not from Flash.
OR
Are you saying that you are executing your application from Flash (no use of Flash API) and that it is ending up in illegal ISR? If yes, please make sure to call mempcy() in your application before executing any code that if mapped to Flash for load and RAM for run.
Thanks and regards,
Vamsi
Hi Vamsi,
No, I am not using Flash APIs, but yeah, I'm executing my applications from Flash. Sure I'll try Memcopy() function
Thanks
Abhinav Soni
Abhinav,
Thank you for the clarification.
Ok, let me know how it goes after doing the change.
Thanks and regards,
Vamsi
Hi, Vamsi
Thanks for your support, It worked!
All I did was included a _Flash Predefined Symbol in properties of the project.
Regards
Abhinav Soni