<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi all, (but mostly Michael...),<br>
<br>
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>
<br>
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>
<br>
Bingo!<br>
<br>
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>
<br>
Greg<br>
<br>
<br>
Michael Balzer wrote:<br>
<blockquote type="cite"
cite="mid:2a4a31c9-c398-0e31-df50-02cfe7e3d822@expeedo.de">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
Greg,<br>
<br>
ah yes, the esp-idf currently doesn't implement oneshot interrupts
on levels, we need to do that ourselves.<br>
<br>
Something along the base line of this:<br>
<br>
<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>
<br>
…just with reversed logic, as we get triggered on low.<br>
<br>
Regards,<br>
Michael<br>
<br>
<br>
<div class="moz-cite-prefix">Am 14.01.2018 um 20:36 schrieb Greg
D.:<br>
</div>
<blockquote type="cite"
cite="mid:8ac84279-15dd-90f8-3ca9-9b10f39e99e2@gmail.com">
<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8">
hi Michael,<br>
<br>
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>
<br>
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>
<br>
Will report back later today...<br>
<br>
Greg<br>
<br>
<br>
<div class="moz-cite-prefix">Michael Balzer wrote:<br>
</div>
<blockquote type="cite"
cite="mid:6124be5d-abf7-5cf2-008f-b2231d809726@expeedo.de">
<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8">
Greg,<br>
<br>
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>
<br>
Can you please give that a try? I.e. change line 77 to:<br>
<br>
<tt> gpio_set_intr_type((gpio_num_t)m_intpin,
GPIO_INTR_LOW_LEVEL);</tt><br>
<br>
<br>
I'll also get a DB9 plug to implement Marks test solution.<br>
<br>
Regards,<br>
Michael<br>
<br>
<br>
<div class="moz-cite-prefix">Am 14.01.2018 um 17:52 schrieb
Michael Balzer:<br>
</div>
<blockquote type="cite"
cite="mid:9f4f5d02-a193-0886-9408-ebd058dccbc6@expeedo.de"><br>
<blockquote type="cite"><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;">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;">, 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;"></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;">.</span></blockquote>
<br>
We currently let the interrupt trigger on the negative edge
(line 77). Maybe GPIO_INTR_LOW_LEVEL can help?<br>
</blockquote>
<br>
<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>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
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>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
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>
<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>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
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>
</body>
</html>