Busoff problem [plz refer to this mail, the previous mail was not perfect]
Hi everyone,
I am using S12MSCANV2 can protocol for my application.
I have an issue here
As we all know, When the nodes enters the Busoff state, it is not
allowed to participate in the communication untill recovery to normal
state.
The following two are my sample codes in which one enables my Transmit
interrupt for every 10ms and the other one in CAN error interrupt ISR.
CAN_Tx_Routine()
{
if(timer > 10ms)
{
if(node_status != BUSOFF/OVERRUN)
{
enable Tx interrupt; /* enables the CAN Tx interrupt */
}
}
}
interrupt _CAN_Error_ISR()
{
if(CAN0RFLG_TSTAT == 3) /* if node stauts is busoff */
{
node_status = BUSOFF;
DisableInterrupts;
CAN_Init_Reg(); /* this contains the CAN controller registers
intialization */
EnableInterrupts;
}
}
Every thing works fine with the above sample code when i create an
bus-off condition i.e. My node can receive and transmit messages after
recovery from busoff state.
But, I tried something different, i.e. I enable my Transmit interrupt
for every 10ms irrespective of the Node status like below. i.e i am not
checking whether my node is in Error passive or busoff or over run in my
Tx routine.
i.e. Even though, busoff occurs, this routine keep enabling the Transmit
interrupt.
CAN_Tx_Routine()
{
if(timer > 10ms)
{
enable Tx interrupt;
}
}
Now, I created the bus-off condition (using CANstressDR tool). But,after
recovery from the bus-off, my node can not receive any messages from the
other node or the network. But it can send all of its Transmit messages
on the network perfectly.
I know that the node should not participate in the communication during
busoff, but I want to know what's happening in the system when my node
is trying to send mesages to the network during busoff.
Can anyone tell me the reason for this..? It would be greatly helpfull
to me.
thanks & regards
Kasu
[Non-text portions of this message have been removed]