Skip to main content
mikael239955
Associate
August 11, 2010
Question

Trouble getting the CAN error interrupt to work correctly on STM32F103VET6

  • August 11, 2010
  • 5 replies
  • 969 views
Posted on August 11, 2010 at 10:11

Trouble getting the CAN error interrupt to work correctly on STM32F103VET6

    This topic has been closed for replies.

    5 replies

    stforum2
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 14:01

    ''Also tried to write a '0' to the ERRI bit in the CAN_MSR. register but it doesn't help.''

    Write a '1' to the ERRI bit in the CAN_MSR instead.

    stforum2
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 14:01

    ''Also, it seems like the unit stops to retransmit the packet once TEC reaches 0x80 and the counter doesn't go any higher.''

    When a transmitter is 'error passive' and detects an ACK error, it doesn't increase the transmit error count.  Since you don't have another node to do an ACK then I guess this is what is happening.

    Are you sure it stops transmitting? It doesn't on our board.

    stforum2
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 14:01

    The TEC will start to decrease once the node starts to successfully transmit messages.

    mikael239955
    Associate
    May 17, 2011
    Posted on May 17, 2011 at 14:01

    Tnx for the answers. Think  the reference manual was a bit unclear on the 'setting bit to 1 to clear it'. Works much better now.

    Been reading the Bosch specification about CAN but must have missed that the TEC should not increase for acc errors in passive mode. That explains a lot. Thank you for the reply.

    A follow-up question. Is there any way to reset the TEC counter back to zero from software? Or do I need to reset the controller to do that?

    cheers,

    Mikael R

    mikael239955
    Associate
    May 17, 2011
    Posted on May 17, 2011 at 14:01

    Ok, that's the only way to decrease TEC. Will have to live with that when handling the 'one unit on the bus' case. tnx.

    / M