Part Number: TMS320F280049
hello,dear
I am performing an illegal fetch from CPU as part of SRAM10 test, following SDL example "RAM access protection violation detection". Set memory LS6 as program memory for CLA. Now the fetch from CPU Calling this function (which has been placed in LS6) will cause a CPU fetch access violation.
But it will go to illegalISR() and stuck in it, it remains running in the interrupt. at last, come to Break at address "0x3fb02a" with no debug information available, or outside of program code.
My question is : how to break out of the illegal interrupt and running the normal program.


#pragma CODE_SECTION(testCPUFetchFunc,"ramls6");
void testCPUFetchFunc(void);
uint32_t generateNonMasterCPUFetchViolation()
{
uint16_t fail = 0U;
uint16_t timeout = ISR_LOOP_TIMEOUT;
//
// Enable violation interrupt
//
MemCfg_enableViolationInterrupt(MEMCFG_NMVIOL_CPUFETCH);
//
// Memory is shared between CLA & CPU.
//
MemCfg_setLSRAMMasterSel(MEMCFG_SECT_LS6, MEMCFG_LSRAMMASTER_CPU_CLA1);
//
// Set memory as program memory for CLA. Now the fetch from CPU
// will result in a non-master CPU fetch violation.
//
MemCfg_setCLAMemType(MEMCFG_SECT_LS6, MEMCFG_CLA_MEM_PROGRAM);
//
// Clear access violation status variables
//
illegalISRFlag = false;
violationISRFlag = false;
violationAddr = 0U;
violationStatus = 0U;
//
// Calling this function (which has been placed in LS1) will cause a CPU
// fetch access violation.
//
testCPUFetchFunc();
//
// The violation will generate both an ITRAP interrupt and the RAM access
// violation interrupt.
//
while(((illegalISRFlag != true) || (violationISRFlag != true)) &&
(timeout != 0U))
{
timeout--;
}
//
// Disable interrupt.
//
MemCfg_disableViolationInterrupt(MEMCFG_NMVIOL_CPUFETCH);
//
// Check if interrupt occurred as expected or if the loop timed out.
//
if(timeout == 0U)
{
fail++;
}
//
// Check if the violation address was testCPUFetchFunc().
//
if(violationAddr != (uint32_t)&testCPUFetchFunc)
{
fail++;
}
//
// Confirm the expected violation type was detected.
//
if((violationStatus & MEMCFG_NMVIOL_CPUFETCH) == 0U)
{
fail++;
}
return(fail);
}
void testCPUFetchFunc(void)
{
NOP;
}
__interrupt void illegalISR(void)
{
illegalISRFlag = true;
//
// Need to remove the protection on LS6RAM to allow us to return.
//
MemCfg_setProtection(MEMCFG_SECT_LS6, MEMCFG_PROT_ALLOWCPUFETCH);
MemCfg_setCLAMemType(MEMCFG_SECT_LS6, MEMCFG_CLA_MEM_DATA);
}



