CAN busoff cannot be cleared?

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi freaks,

i have a weird problem with the UC3C CAN bus error handling:

When i encounter a busoff error, i cannot reset it. The interrupt occures again and again.

ASF (3.1.3) does the following in the interrupt handler:

static void can0_int_busoff_handler(void)
{
    CANIF_clr_interrupt_status(0);
    can_lib_params.can_msg_callback_channel0(0xFF,CAN_STATUS_BUSOFF, CANLIB_BUSERR);
}

The definition of CANIF_clr_interrupt_status is:

#define CANIF_clr_interrupt_status(ch)          {  AVR32_CANIF.channel[ch].caniscr = CANIF_get_interrupt_status(ch); }
#define CANIF_get_interrupt_status(ch)          ( AVR32_CANIF.channel[ch].canisr)

Wich basic looks ok to me.

So the question is for me:
Is it normal, that the busoff interrupt reoccurs after being cleared via writing to CANISCR?

What are you doing in your busoff interrupt handler?

Thanks
Holger

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ok, solved this one myself.

I have to clear the current MOB if it's a TX MOB, otherwise it'll try to send again and again...

It was a bit confusing that the Busoff error did not get cleared immediatly in the studio IO view - no idea if it's a studio bug or if it's the real behaviour :?

Now i can see that the busoff error goes away a few steps after it was actually cleared wich was not happening before since it reoccured too fast.

Holger