<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">The fault must be in mcp2515::RxCallback.<div class=""><br class=""></div><div class="">Good news is that the way we marshal these interrupts, that callback is in a normal task and can be logged / debugged using normal tools. It is not running in interrupt context.</div><div class=""><br class=""></div><div class="">The usual cause of these sorts of things is the interrupt not being raised, so mcp2515::RxCallback is not called, and locks forever. Perhaps you can try adding a command to inject a spoofed interrupt message (see MCP2515_isr and just use xQueueSend not xQueueSendFromISR), and see if that command can ‘free’ a locked up CAN bus. If so, that is the cause.</div><div class=""><br class=""></div><div class="">Regards, Mark.<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 24 May 2018, at 1:26 PM, Greg D. <<a href="mailto:gregd2350@gmail.com" class="">gregd2350@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">
  
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" class="">
  
  <div text="#000000" bgcolor="#FFFFFF" class="">
    Hi Mark,<br class="">
    <br class="">
    Ok, did some more poking around, being careful to not wiggle too
    many things at once.  I can get a reliable lockup by doing the
    following:<br class="">
    <br class="">
    1.  power ext12v off<br class="">
    2.  obdii ecu stop<br class="">
    3.  power ext12v on<br class="">
    ...wait a few seconds <br class="">
    4.  obdii ecu start can3<br class="">
    <br class="">
    If I restart obdii too soon, all works.  Otherwise, I can repeatedly
    disable and re-enable 12v to cycle the HUD, and it will never
    connect.  The ordering of steps 1 and 2 don't seem to matter. 
    Unfortunately, I don't see anything in the can status that's
    uniquely different between scenarios where its working and not. 
    Will need some additional diagnostic logging...<br class="">
    <br class="">
    Now, for fun, I hook the OBDII Dongle to the module, and try the
    same steps, but instead of turning on the HUD, I try connecting a
    few times while the OBDII ECU task is not running (simulating the
    HUD's attempts to connect), then start the ecu, then try to
    connect.  It connects!  And this is with the Dongle doing its
    multi-speed scan each time.  So simply having frames come in while
    we're not watching, or frames coming in at the wrong speed does not
    cause the hang.  Rather, it might be that we've got a window in the
    code where incoming traffic <i class="">colliding with</i> the opening of
    the CAN driver is nailing the chip in some critical region.  If I
    hit it just right, I can sometimes cause this collision with the
    Dongle by stopping the ecu, starting the connect, then restarting
    the ecu during the connect sequence.  Not always, but sometimes.<br class="">
    <br class="">
    Just a guess...  I need to dust off the chip document and see if
    there are any interesting bits to look at.<br class="">
    <br class="">
    Greg<br class="">
    <br class="">
    <br class="">
    <div class="moz-cite-prefix">Mark Webb-Johnson wrote:<br class="">
    </div>
    <blockquote type="cite" cite="mid:206B7B88-2C5D-4FCF-8CF9-DC9013495F5A@webb-johnson.net" class="">
      <div class="">When the client (HUD, whatever) is trying to connect to the
        ECU, it can try 500K, 250K. Or it can try 250K, 500K. I suspect
        yours tries the first descending sequence, and hence doesn’t
        have any issues as it finds the match at 500K first.</div>
      <div class=""><br class="">
      </div>
      <div class="">Anyway, this MCP2515 can bus lockup is something we have to
        fix. The fact it is reproducible on obd2ecu is good and helpful
        for that.</div>
      <div class=""><br class="">
      </div>
    </blockquote>
    <br class="">
  </div>

_______________________________________________<br class="">OvmsDev mailing list<br class=""><a href="mailto:OvmsDev@lists.openvehicles.com" class="">OvmsDev@lists.openvehicles.com</a><br class="">http://lists.openvehicles.com/mailman/listinfo/ovmsdev<br class=""></div></blockquote></div><br class=""></div></body></html>