Hi Team,
I am facing issue with CANIntStatus() API.
I am using CANIntStatus() API in CAN Application code. It will return the value CAN_INT_INTID_STATUS ( i.e. status interrupt 0x8000 ) and it will return number of the message object that caused the interrupt. In this case, i am reading the status register by using CANStatusGet() API. This API will return the information of error interrupts. I have implemented 15 message objects. But TM4C123GH6PM micro controller can support 32 message objects.
For instant,
Sample code:
In CAN Interrupt Handler,
status = CANIntStatus(CAN_BASE, CAN_INT_STS_CAUSE); // This will return total number of message objects and cause of interrupt.
if( status == CAN_INT_INTID_STATUS)
{
ulStatus = CANStatusGet(CAN1_BASE, CAN_STS_CONTROL);
CANIntClear(CAN_BASE, CAN_INT_INTID_STATUS); // Clearing the status interrupr register.
}
else
{
switch(status)
{
case 1: message object 1; break;
case 2: message object 2; break;
case 3: message object 3; break;
..........
..........
..........
case 15; message object 15; break;
}
}
Here, all the message objects are dependent on each other because of Arbitration. Please correct me, if i am wrong.
I am feeding the 5 messages to CAN transceiver (Part no: SN65HVD1040D ). I am expecting that the first 5 cases will execute.
Below are the observation while testing:
1. The CANIntStatus() is always returning 1 and 2. And getting only 2 messages.
2. If i put break point in case 3, case 4 and case 5, cursor is not hitting any of the break point.
3. If i put break point in case 2 also, all the 5 cases executing properly. So that, i can monitor 5 messages.
But after removing break point in case 2, cursor is not hitting in remaining break points in other cases (case 3, 4 and 5).
Here, my question is, based on the number of messages(for example 10 ) that we are feeding to CAN transceiver, CAN interrupt status register will return that particular value (i.e. 10) and that particular message objects will execute.
Why, the CANIntStatus() API is not returning the proper value.???
Please excuse me, if any grammatical mistakes are there.
Thank you very much.
regards
Suman