<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="">In vino veritas.<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 16 Jan 2018, at 11:48 AM, 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 all, (but mostly Michael...),<br class="">
    <br class="">
    I'm sitting here at my workbench, with a glass of Merlot in one
    hand, and a red velvet and white chocolate cookie in the other,
    staring at a yet-again hung CAN3 bus on the v3 module.  A sequence
    of multiple Transmits, closely spaced, can cause the chip to stop
    processing (issuing) interrupts, hanging the receive side, and
    making the transmit side operate strangely.  Nothing I do seems to
    help, and Google searches are not encouraging.<br class="">
    <br class="">
    Looking at the chip's programming manual, I start to see a lot of
    "feature" (complication) in the transmit buffering.  Multiple
    priorities, etc., none of which we are (should be) using.  So, since
    Michael has implemented a very efficient excess-frame queuing
    mechanism, how about we just use a single transmit buffer at a time,
    and queue the rest?  Not quite as good as double buffering the
    transmit, but still a lot faster than the original fixed delay. 
    Will it fix the hang?<br class="">
    <br class="">
    Bingo!<br class="">
    <br class="">
    Fix is simple and implemented, and seems to work.  I will do some
    more testing before committing later tonight.  Perhaps another glass
    of Merlot is in order. Or, maybe an old-vine Zin...<br class="">
    <br class="">
    Greg<br class="">
    <br class="">
    <br class="">
    Michael Balzer wrote:<br class="">
    <blockquote type="cite" cite="mid:2a4a31c9-c398-0e31-df50-02cfe7e3d822@expeedo.de" class="">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" class="">
      Greg,<br class="">
      <br class="">
      ah yes, the esp-idf currently doesn't implement oneshot interrupts
      on levels, we need to do that ourselves.<br class="">
      <br class="">
      Something along the base line of this:<br class="">
      <br class="">
      <a class="moz-txt-link-freetext" href="https://github.com/espressif/esp-idf/issues/1234#issuecomment-342320583" moz-do-not-send="true">https://github.com/espressif/esp-idf/issues/1234#issuecomment-342320583</a><br class="">
      <br class="">
      …just with reversed logic, as we get triggered on low.<br class="">
      <br class="">
      Regards,<br class="">
      Michael<br class="">
      <br class="">
      <br class="">
      <div class="moz-cite-prefix">Am 14.01.2018 um 20:36 schrieb Greg
        D.:<br class="">
      </div>
      <blockquote type="cite" cite="mid:8ac84279-15dd-90f8-3ca9-9b10f39e99e2@gmail.com" class="">
        <meta http-equiv="Content-Type" content="text/html;
          charset=UTF-8" class="">
        hi Michael,<br class="">
        <br class="">
        Good try, but the whole system hangs, so I'm guessing that we're
        stuck in an infinite interrupt loop.  But that suggests that the
        issue is related to unbalanced interrupt processing somehow.<br class="">
        <br class="">
        I'm going to try for some diagnostic logging once it gets stuck,
        and see if I can identify its state.  The absolute
        reproducibility of the base issue leads me to think the reported
        empty interrupt issue (your prior email) is probably not it, but
        rather the driver is not handling some confluence of events
        properly.  I have no trouble running the HUD display, for
        example, but it doesn't produce the rapid transmit frames of the
        OBDWiz dongle.  Something about the transmit side is messing up
        the receive...  I wonder if we're getting an interrupt for both
        the last Tx frame being sent and the VIN request PID being
        received at the same time?  Transmit interrupts don't check for
        receive, and vice-versa.<br class="">
        <br class="">
        Will report back later today...<br class="">
        <br class="">
        Greg<br class="">
        <br class="">
        <br class="">
        <div class="moz-cite-prefix">Michael Balzer wrote:<br class="">
        </div>
        <blockquote type="cite" cite="mid:6124be5d-abf7-5cf2-008f-b2231d809726@expeedo.de" class="">
          <meta http-equiv="Content-Type" content="text/html;
            charset=UTF-8" class="">
          Greg,<br class="">
          <br class="">
          here's another report of level triggering solving the issue: <a class="moz-txt-link-freetext" href="https://community.nxp.com/thread/456907" moz-do-not-send="true">https://community.nxp.com/thread/456907</a><br class="">
          <br class="">
          Can you please give that a try? I.e. change line 77 to:<br class="">
          <br class="">
          <tt class="">  gpio_set_intr_type((gpio_num_t)m_intpin,
            GPIO_INTR_LOW_LEVEL);</tt><br class="">
          <br class="">
          <br class="">
          I'll also get a DB9 plug to implement Marks test solution.<br class="">
          <br class="">
          Regards,<br class="">
          Michael<br class="">
          <br class="">
          <br class="">
          <div class="moz-cite-prefix">Am 14.01.2018 um 17:52 schrieb
            Michael Balzer:<br class="">
          </div>
          <blockquote type="cite" cite="mid:9f4f5d02-a193-0886-9408-ebd058dccbc6@expeedo.de" class=""><br class="">
            <blockquote type="cite" class=""><span style="color: rgb(34, 34, 34);
                font-family: "Helvetica Neue", Arial,
                sans-serif; font-size: 15px; font-style: normal;
                font-variant-ligatures: normal; font-variant-caps:
                normal; font-weight: 400; letter-spacing: normal;
                orphans: 2; text-align: start; text-indent: 0px;
                text-transform: none; white-space: normal; widows: 2;
                word-spacing: 0px; -webkit-text-stroke-width: 0px;
                text-decoration-style: initial; text-decoration-color:
                initial; display: inline !important; float: none;" class="">Hmmmm</span><span style="color: rgb(34, 34, 34); font-family:
                "Helvetica Neue", Arial, sans-serif;
                font-size: 15px; font-style: normal;
                font-variant-ligatures: normal; font-variant-caps:
                normal; font-weight: 400; letter-spacing: normal;
                orphans: 2; text-align: start; text-indent: 0px;
                text-transform: none; white-space: normal; widows: 2;
                word-spacing: 0px; -webkit-text-stroke-width: 0px;
                text-decoration-style: initial; text-decoration-color:
                initial; display: inline !important; float: none;" class="">, I
                think level triggered interrupt would help here</span><span id="selection_url_f" style="color: rgb(34, 34, 34);
                font-family: "Helvetica Neue", Arial,
                sans-serif; font-size: 15px; font-style: normal;
                font-variant-ligatures: normal; font-variant-caps:
                normal; font-weight: 400; letter-spacing: normal;
                orphans: 2; text-align: start; text-indent: 0px;
                text-transform: none; white-space: normal; widows: 2;
                word-spacing: 0px; -webkit-text-stroke-width: 0px;
                text-decoration-style: initial; text-decoration-color:
                initial;" class=""></span><span style="color: rgb(34, 34, 34);
                font-family: "Helvetica Neue", Arial,
                sans-serif; font-size: 15px; font-style: normal;
                font-variant-ligatures: normal; font-variant-caps:
                normal; font-weight: 400; letter-spacing: normal;
                orphans: 2; text-align: start; text-indent: 0px;
                text-transform: none; white-space: normal; widows: 2;
                word-spacing: 0px; -webkit-text-stroke-width: 0px;
                text-decoration-style: initial; text-decoration-color:
                initial; display: inline !important; float: none;" class="">.</span></blockquote>
            <br class="">
            We currently let the interrupt trigger on the negative edge
            (line 77). Maybe GPIO_INTR_LOW_LEVEL can help?<br class="">
          </blockquote>
          <br class="">
          <pre class="moz-signature" cols="160">-- 
Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
</pre>
          <br class="">
          <fieldset class="mimeAttachmentHeader"></fieldset>
          <br class="">
          <pre wrap="" class="">_______________________________________________
OvmsDev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:OvmsDev@lists.teslaclub.hk" moz-do-not-send="true">OvmsDev@lists.teslaclub.hk</a>
<a class="moz-txt-link-freetext" href="http://lists.teslaclub.hk/mailman/listinfo/ovmsdev" moz-do-not-send="true">http://lists.teslaclub.hk/mailman/listinfo/ovmsdev</a>
</pre>
        </blockquote>
        <br class="">
        <br class="">
        <fieldset class="mimeAttachmentHeader"></fieldset>
        <br class="">
        <pre wrap="" class="">_______________________________________________
OvmsDev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:OvmsDev@lists.teslaclub.hk" moz-do-not-send="true">OvmsDev@lists.teslaclub.hk</a>
<a class="moz-txt-link-freetext" href="http://lists.teslaclub.hk/mailman/listinfo/ovmsdev" moz-do-not-send="true">http://lists.teslaclub.hk/mailman/listinfo/ovmsdev</a>
</pre>
      </blockquote>
      <br class="">
      <pre class="moz-signature" cols="160">-- 
Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
</pre>
      <br class="">
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br class="">
      <pre wrap="" class="">_______________________________________________
OvmsDev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:OvmsDev@lists.teslaclub.hk">OvmsDev@lists.teslaclub.hk</a>
<a class="moz-txt-link-freetext" href="http://lists.teslaclub.hk/mailman/listinfo/ovmsdev">http://lists.teslaclub.hk/mailman/listinfo/ovmsdev</a>
</pre>
    </blockquote>
    <br class="">
  </div>

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