Hi Team,
In one of our project we need to read the Vim Irq index register to find the current ISR inside ISR. The vimREG->IRQINDEX register changing some times before exit current ISR.
example:
RTI ISR index number is 3. In below example we are checking vimREG->IRQINDEX register for 3. some times this value is not equal to 3.
Code:
/* USER CODE BEGIN (8) */
extern uint8_t RTI_Flag;
uint32_t counter = 0;
/* USER CODE END */
#pragma WEAK(rtiNotification)
void rtiNotification(uint32 notification)
{
/* enter user code between the USER CODE BEGIN and USER CODE END. */
/* USER CODE BEGIN (9) */
/* SET FLAG - USED TO TRIGGER SPI TRANSFER CONTINUES FOR 1MS */
RTI_Flag = 1;
/* CLEAR COUNTER */
counter = 0;
/* HOLD ISR */
while(counter < 0x1000)
{
++counter;
}
/* CHECK VIM IRQ INDEX REGISTER - 0x03(RTI-IRQ NUMBER)*/
if(vimREG->IRQINDEX != 3)
{
counter = 0;
}
/* USER CODE END */
}10_tms570Ls3137_index_test.zip
Note: We are using TMS570ls3137 Hercules Development Board and we have attached the project file with this forum.
Kindly support us on this, thanks