CAN Message TX issue 6 times then quits

1 post / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am using the various CAN files that are available from Atmel for the ATmega16M1   ..i.e.,  can_it_drv.* and can_it_lib.*  

 

I stripped the code down to only send (TX) a message every 500msec.   I have the ISR enabled for TXOK.    It will successfully transmit 5 times...then upon the 6th attempt will fail the  if ((cmd->handle) != MOB_INT_NUM)

test.   It will never recover from this error without RESET of the program at which point it will TX 5 times, then hang on the 6th attempt.   Any ideas???

 

// Is there always interrupts pending (i.e. some MOB interrupts are set ) ?

if (can_get_general_interrupt() == CAN_INT_MSK) {

// Is the right handling ?

cmd = can_descript_list[MOB_INT_NUM]; // #define MOB_INT_NUM (CANHPMOB>>4)

if ((cmd->handle) != MOB_INT_NUM) {

can_manag_error_count++; return;

}