Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 3 of 3

Thread: CAN bus sporadic failure

  1. #1

    CAN bus sporadic failure

    Hi All,

    so I'm working on a project that uses the CAN bus for some command/control and I'm getting an inconsistent problem.
    I'm using the flexCAN library by teachop, and a T3.2. In the setup another T3.2 is connected to the other end of the bus, pretending to be the computing module (ergo I'll refer to it as the master to disambiguate)

    Sometimes, the CAN bus fails to write properly from bootup. There's a "handshake" on bootup, where the teensy sends the same message to the master until it receives an appropriate response. I see the calls to Can0.write() execute, the buffers fill up and the function begins to return 0. Looking at the CAN lines on a scope, I can physically see there's no signal present. Notably, messages from the master are still received and handled properly.
    The behaviour is the same as if the CAN bus was disconnected, where the calls to write eventually fill up all the buffers and don't get sent.

    Reprogramming the teensy seems to fix the problem when it occurs. I've tried calling end() and then begin() to reset the bus, but to no avail. I realise that without a repeatable problem, solutions have to be best guesses but

    - Does anyone have an idea of what can cause CAN to receive but fail to send?
    - Is there a way to hard reset the CAN bus, without resetting the T3.2 itself.

    I'll add any more information as I get it,

    EDIT1: I also get the same behaviour if I call Can0.write(message) in an infinite loop, and the tx remains locked after I stop calls

    thanks
    Last edited by Edward; 01-09-2020 at 02:59 PM.

  2. #2
    Could be a power up problem. How are you powering the T3.2 and the CAN transceiver ?

    Post the schematic and some photos of the setup.

  3. #3
    oh, that's embarrassing. I'm supplying my CAN transceiver 3.3 when it needs 5V, that certainly would explain why it's being sketchy. I'll rework the board and see if the problem resolves itself!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •