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.

TMS320F28379D: How to resolve the Illegal Operation Trap (illegal ISR()) issue ?

Part Number: TMS320F28379D

Hi TI experts, 

After adding some MSGRAM (address 0x3_FC00) parameter initialization block for IPC, we noticed that the local CPU1 entered into "Illegal Operation Trap" and could not execute further. 

          // CPU1toCPU2PutBuffer and Index Initialization
          mwIpcControllerTx[chNum].psPutBuffer = &MW_IPCCPU1toCPU2Buffers[chNum][0];
          mwIpcControllerTx[chNum].pusPutWriteIndex = &MW_PutWriteIndexes[chNum];
          mwIpcControllerTx[chNum].pusGetReadIndex = &MW_GetReadIndexes[chNum];
          mwIpcControllerTx[chNum].ulPutFlag = (uint32_t)(1 << (chNum));

The CPU1 became failing in executing a previously proven to be working statement :  fid = fopen("scia", "w"); 

          status = add_device("scia", _SSA, SCI_open, SCI_close, SCI_read, SCI_write, SCI_lseek, SCI_unlink, SCI_rename);
          fid = fopen("scia","w");

It failed to locate an empty slot in the file table (_ftable), and the debug variable showed : index = -1, and _mode != "w"

But once I commented out the above IPC buffer and index initialization, CPU1 can execute again as per usual without any illegal operation trap failure. 

1)    The IPC buffer and index that we initialized are all located in MSGRAM at address starting with  0x3_FC00, and should be unrelated to .econstant located at 0x9_0624. 

2)    How to get more information on the file table (_ftable)  ?   Why it failed to locate for an empty slot in the file table ?   How to know the number of available slots ? 

3)    What can we do to resolve this kind of issue ? 

Thank you. 

Best regards, 

Djony Pamudji

/*****************************************************************************/
/* FOPEN - Open a file and return a pointer to it */
/* */
/* This function calls _SEARCH_FP to locate an empty slot in the file */
/* table (_ftable), and calls _OPENFILE with it to open a stream to the */
/* file _FNAME. It returns a pointer to the stream that was allocated, */
/* or NULL if it was not successful. */
/* */
/*****************************************************************************/
_CODE_ACCESS FILE *fopen(const char * __restrict _fname,
const char * __restrict _mode)
{
FILE *f;

/*-----------------------------------------------------------------------*/
/* This is a critical section because search_fp looks for a new file */
/* slot in the global table _ftable. */
/*-----------------------------------------------------------------------*/
__TI_resource_lock(__TI_LOCK_FILE_TBL);
f = _openfile(_fname, _search_fp(), _mode);
__TI_data_synch_WBINV(&_ftable, sizeof(_ftable));
__TI_resource_unlock(__TI_LOCK_FILE_TBL);
return f;
}

  • Hi,

    It looks like stack overrun issue. Can you use breakpoints/ use the step into option while debugging and check closely where you are going wrong?

    Thanks & Regards,

    Santosh