<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Thanks for the analysis and solution!<br>
<br>
What kind of speedup is achievable by replacing the cp2102? Is it
just linear 16 → 20 MHz = 25%?<br>
<br>
Or does this also solve hidden retransmission issues?<br>
<br>
<br>
<tt><a class="moz-txt-link-abbreviated" href="mailto:balzer@leela:~/esp/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3">balzer@leela:~/esp/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3</a>>
time ssh dexze85.local "vfs ls /sd/logs"</tt><tt><br>
</tt><tt> 541.7k 22-Apr-2018 22:34 can-180422</tt><tt><br>
</tt><tt> 449.0k 17-May-2018 09:56 log</tt><tt><br>
</tt><tt> 580.8k 01-May-2018 18:15 dm</tt><tt><br>
</tt><tt> 1.0M 30-Apr-2018 00:51 log.20180430-005121</tt><tt><br>
</tt><tt> 1.0M 30-Apr-2018 10:27 log.20180430-102732</tt><tt><br>
</tt><tt> 1.0M 30-Apr-2018 19:41 log.20180430-194146</tt><tt><br>
</tt><tt> 1.0M 01-May-2018 02:21 log.20180501-022128</tt><tt><br>
</tt><tt> 1.0M 01-May-2018 11:03 log.20180501-110318</tt><tt><br>
</tt><tt> 80 01-May-2018 14:09 can-180501</tt><tt><br>
</tt><tt> 1.0M 01-May-2018 17:56 log.20180501-175658</tt><tt><br>
</tt><tt> 1.1M 01-May-2018 18:17 dm2</tt><tt><br>
</tt><tt> 2.0M 01-May-2018 18:28 dm3</tt><tt><br>
</tt><tt> 1.3M 01-May-2018 20:21 dm4</tt><tt><br>
</tt><tt> 1.0M 02-May-2018 04:06 log.20180502-040605</tt><tt><br>
</tt><tt> 1.0M 02-May-2018 13:38 log.20180502-133816</tt><tt><br>
</tt><tt> 1.0M 03-May-2018 00:04 log.20180503-000415</tt><tt><br>
</tt><tt> 1.0M 03-May-2018 10:38 log.20180503-103815</tt><tt><br>
</tt><tt> 1.0M 03-May-2018 19:46 log.20180503-194654</tt><tt><br>
</tt><tt> 1.0M 04-May-2018 06:22 log.20180504-062242</tt><tt><br>
</tt><tt> 1.0M 04-May-2018 17:23 log.20180504-172311</tt><tt><br>
</tt><tt> 1.0M 05-May-2018 03:50 log.20180505-035002</tt><tt><br>
</tt><tt> 1.0M 05-May-2018 15:01 log.20180505-150115</tt><tt><br>
</tt><tt> 1.0M 06-May-2018 01:22 log.20180506-012241</tt><tt><br>
</tt><tt> 1.0M 06-May-2018 09:42 log.20180506-094249</tt><tt><br>
</tt><tt> 1.0M 06-May-2018 16:58 log.20180506-165842</tt><tt><br>
</tt><tt> 1.0M 07-May-2018 02:08 log.20180507-020820</tt><tt><br>
</tt><tt> 1.0M 07-May-2018 09:08 log.20180507-090846</tt><tt><br>
</tt><tt> 1.0M 07-May-2018 13:10 log.20180507-131042</tt><tt><br>
</tt><tt> 630.2k 23-Apr-2018 23:51 can-180423</tt><tt><br>
</tt><tt> 1.0M 07-May-2018 16:40 log.20180507-164032</tt><tt><br>
</tt><tt> 3.6M 24-Apr-2018 00:30 can-180424</tt><tt><br>
</tt><tt> 1.0M 24-Apr-2018 01:09 log.20180424-010932</tt><tt><br>
</tt><tt> 1.0M 24-Apr-2018 11:36 log.20180424-113642</tt><tt><br>
</tt><tt> 1.0M 24-Apr-2018 18:41 log.20180424-184124</tt><tt><br>
</tt><tt> 1.0M 25-Apr-2018 02:54 log.20180425-025415</tt><tt><br>
</tt><tt> 1.0M 25-Apr-2018 13:10 log.20180425-131000</tt><tt><br>
</tt><tt> 1.0M 25-Apr-2018 23:40 log.20180425-234048</tt><tt><br>
</tt><tt> 1.0M 26-Apr-2018 08:23 log.20180426-082309</tt><tt><br>
</tt><tt> 1.0M 26-Apr-2018 13:17 log.20180426-131718</tt><tt><br>
</tt><tt> 1.0M 26-Apr-2018 17:32 log.20180426-173218</tt><tt><br>
</tt><tt> 1.0M 26-Apr-2018 22:26 log.20180426-222645</tt><tt><br>
</tt><tt> 1.0M 27-Apr-2018 06:19 log.20180427-061932</tt><tt><br>
</tt><tt> 1.0M 27-Apr-2018 11:45 log.20180427-114534</tt><tt><br>
</tt><tt> 1.0M 27-Apr-2018 16:07 log.20180427-160751</tt><tt><br>
</tt><tt> 1.0M 28-Apr-2018 05:07 log.20180428-050703</tt><tt><br>
</tt><tt> 1.0M 28-Apr-2018 14:39 log.20180428-143956</tt><tt><br>
</tt><tt> 1.0M 29-Apr-2018 00:07 log.20180429-000755</tt><tt><br>
</tt><tt> 1.0M 29-Apr-2018 10:26 log.20180429-102600</tt><tt><br>
</tt><tt> 1.0M 29-Apr-2018 14:09 log.20180429-140942</tt><tt><br>
</tt><tt> 1.0M 07-May-2018 18:39 log.20180507-183951</tt><tt><br>
</tt><tt> 1.0M 07-May-2018 21:18 log.20180507-211821</tt><tt><br>
</tt><tt> 1.0M 08-May-2018 01:06 log.20180508-010616</tt><tt><br>
</tt><tt> 1.0M 08-May-2018 08:12 log.20180508-081232</tt><tt><br>
</tt><tt> 1.0M 08-May-2018 13:31 log.20180508-133133</tt><tt><br>
</tt><tt> 1.0M 08-May-2018 14:52 log.20180508-145232</tt><tt><br>
</tt><tt> 1.0M 08-May-2018 15:55 log.20180508-155530</tt><tt><br>
</tt><tt> 1.0M 08-May-2018 16:18 log.20180508-161814</tt><tt><br>
</tt><tt> 1.0M 08-May-2018 16:33 log.20180508-163344</tt><tt><br>
</tt><tt> 1.0M 08-May-2018 16:51 log.20180508-165156</tt><tt><br>
</tt><tt> 1.0M 08-May-2018 18:40 log.20180508-184035</tt><tt><br>
</tt><tt> 1.0M 09-May-2018 02:13 log.20180509-021338</tt><tt><br>
</tt><tt> 1.0M 09-May-2018 11:28 log.20180509-112803</tt><tt><br>
</tt><tt> 1.0M 09-May-2018 13:10 log.20180509-131042</tt><tt><br>
</tt><tt> 1.0M 09-May-2018 13:30 log.20180509-133049</tt><tt><br>
</tt><tt> 1.0M 09-May-2018 13:46 log.20180509-134607</tt><tt><br>
</tt><tt> 1.0M 09-May-2018 14:02 log.20180509-140208</tt><tt><br>
</tt><tt> 1.0M 09-May-2018 14:17 log.20180509-141725</tt><tt><br>
</tt><tt> 1.0M 09-May-2018 14:31 log.20180509-143108</tt><tt><br>
</tt><tt> 1.0M 09-May-2018 14:44 log.20180509-144407</tt><tt><br>
</tt><tt> 1.0M 09-May-2018 14:58 log.20180509-145806</tt><tt><br>
</tt><tt> 1.0M 09-May-2018 15:20 log.20180509-152009</tt><tt><br>
</tt><tt> 1.0M 09-May-2018 18:59 log.20180509-185904</tt><tt><br>
</tt><tt> 1.0M 10-May-2018 00:10 log.20180510-001018</tt><tt><br>
</tt><tt> 1.0M 10-May-2018 09:11 log.20180510-091155</tt><tt><br>
</tt><tt> 1.0M 10-May-2018 13:57 log.20180510-135727</tt><tt><br>
</tt><tt> 1.0M 10-May-2018 21:50 log.20180510-215045</tt><tt><br>
</tt><tt> 1.0M 11-May-2018 07:34 log.20180511-073403</tt><tt><br>
</tt><tt> 1.0M 11-May-2018 13:24 log.20180511-132440</tt><tt><br>
</tt><tt> 1.0M 11-May-2018 17:13 log.20180511-171332</tt><tt><br>
</tt><tt> 1.0M 11-May-2018 22:00 log.20180511-220047</tt><tt><br>
</tt><tt> 1.0M 12-May-2018 11:08 log.20180512-110827</tt><tt><br>
</tt><tt> 1.0M 12-May-2018 15:30 log.20180512-153022</tt><tt><br>
</tt><tt> 1.0M 12-May-2018 17:42 log.20180512-174248</tt><tt><br>
</tt><tt> 1.0M 12-May-2018 22:29 log.20180512-222949</tt><tt><br>
</tt><tt> 1.0M 13-May-2018 10:03 log.20180513-100341</tt><tt><br>
</tt><tt> 1.0M 13-May-2018 14:26 log.20180513-142603</tt><tt><br>
</tt><tt> 1.0M 13-May-2018 22:53 log.20180513-225343</tt><tt><br>
</tt><tt> 1.0M 14-May-2018 07:58 log.20180514-075805</tt><tt><br>
</tt><tt> 1.0M 14-May-2018 11:35 log.20180514-113524</tt><tt><br>
</tt><tt> 1.0M 14-May-2018 16:27 log.20180514-162753</tt><tt><br>
</tt><tt> 1.0M 15-May-2018 01:31 log.20180515-013153</tt><tt><br>
</tt><tt> 1.0M 15-May-2018 08:58 log.20180515-085847</tt><tt><br>
</tt><tt> 1.0M 15-May-2018 12:30 log.20180515-123053</tt><tt><br>
</tt><tt> 1.0M 15-May-2018 18:24 log.20180515-182435</tt><tt><br>
</tt><tt> 1.0M 16-May-2018 07:25 log.20180516-072553</tt><tt><br>
</tt><tt> 1.0M 16-May-2018 08:55 log.20180516-085501</tt><tt><br>
</tt><tt> 1.0M 16-May-2018 12:01 log.20180516-120115</tt><tt><br>
</tt><tt> 1.0M 16-May-2018 19:46 log.20180516-194613</tt><tt><br>
</tt><tt> 1.0M 17-May-2018 06:14 log.20180517-061451</tt><tt><br>
</tt><tt><br>
</tt><b><tt>real 0m18.965s</tt></b><tt><br>
</tt><tt>user 0m0.018s</tt><tt><br>
</tt><tt>sys 0m0.009s</tt><tt><br>
</tt><br>
<br>
<br>
<div class="moz-cite-prefix">Am 17.05.2018 um 04:22 schrieb Mark
Webb-Johnson:<br>
</div>
<blockquote type="cite"
cite="mid:56C111E5-AC24-4BE2-8800-61616261D757@webb-johnson.net">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode:
space; line-break: after-white-space;" class="">
<div class=""><br class="">
</div>
<div class="">Good grief. A year into this, and still writing
about SD CARD issues with ESP32. If I could get into a room
with the engineer who decided to share boot strapping pins
with SDCARD pins, and to hard wire the SDIO controller to
specific pins, I would literally try to slap some sense into
him.</div>
<div class=""><br class="">
</div>
<div class="">The China guys and I have been struggling for the
past couple of months trying to work out why we can’t get as
much speed out of the SD CARD as we wanted. If we raise the
speed to the normal 20MHz, we randomly get errors (timeouts,
checksums, etc). It looked like interference on the bus lines,
but scoping those we can’t find any. Dropping the speed to
16MHz works around the issue, but SD CARD accesses are slow.</div>
<div class=""><br class="">
</div>
<div class="">Then, we worked out it wasn’t random. It was based
on whether we were powering from USB or external 12V. On the
bench it works fine. In the car the problem appears. Simply
put, if the USB was plugged in the ‘interference’ disappeared.
If USB was unplugged, it came back. USB + external 12V
combination also didn’t suffer from the issue, so the problem
is not coming from the 12v side. The issue often appeared on
only the second test of SD CARD, not the first. We didn’t see
this problem on either the v3.0 developer modules, or v3.1
prototypes.</div>
<div class=""><br class="">
</div>
<div class="">We looked at the capacitors and pull-up resistors
on that side of the circuit, without success. Whatever we did
made little difference (or randomly changed things for the
better/worse). We thought maybe ground-line interference, but
nope. We spent some time looking at C20, C22, C23 to see if
the manufacturers had messed up the component values - they
hadn’t.</div>
<div class=""><br class="">
</div>
<div class="">Anyway, to cut a long story short, we finally
found the culprit. The CP2102 chip itself.</div>
<div class=""><br class="">
</div>
<div class="">We’d already had to change the power supply design
early on in the project to cope with a bug in CP2102 not
correctly handling USB host disconnect and not properly going
into suspend mode (to reduce power consumption of cp2101
circuit when usb was disconnected) - our current design
completely powers down the cp2102 chip when the USB cable is
disconnected. Michael Stegen had previously warned me about
clones of this chip (see <a
href="https://wiki.sha2017.org/w/Projects:Badge" class=""
moz-do-not-send="true">https://wiki.sha2017.org/w/Projects:Badge</a>
and what they went through), and we had added the extra
resistor already to cope with that eventuality. But, from what
we can tell this is not a clone part issue. Here is what we
found:</div>
<div class=""><br class="">
</div>
<div class="">
<ol class="MailOutline">
<li class="">OVMS v3.0 and early v3.1 prototypes use CP2102
v1412+. For that chip, when the USB cable is disconnected,
CSL-TXD is 3.3v.</li>
<li class="">OVMS v3.1 first production batch use a
newer CP2102 v1708+. For that chip, when the USB cable is
disconnected, CSL-TXD is pulled down to 0.78v.</li>
<li class="">We have replaced the cp2102 on a v3.1 first
production module with v1412+, and SD CARD resumes normal
operation (even with usb disconnected).</li>
<li class="">The version number seems to be a date code.
YYWW (year, week), I guess.</li>
<li class="">We have absolutely no idea why this would be
affecting the SD CARD performance or interference.
Somehow, that CSL-TXD line is going through the ESP32 chip
and affecting the SDIO controller (perhaps related to the
bootstrapping pins dual use). The interference we see is
inside the ESP32, not on the lines going from ESP32 to the
SDCARD (which is why we couldn’t see it on the scope).</li>
</ol>
</div>
<div class=""><br class="">
</div>
<div class="">I tried shutting down the pins on the ESP32 for
CSL-TXD and CSL-RXD, to see if I could work around the problem
in firmware, but couldn’t get it to work. There is no way of
knowing whether the USB is connected, and even if we did know,
setting CSL-TXD and CSL-RXD pins to output mode, or float,
doesn’t seem to make any difference.</div>
<div class=""><br class="">
</div>
<div class="">The good news is that we’ve at least identified
the problem. We are (a) checking the revision of cp2102 chip
in the upcoming production batch, and (b) changing QC
procedures to set SD CARD bus speed to default (20MHz) and
randomly test modules twice on 12V power. Latest production
batch is now using v1742+, and that has been tested as
working. Going forward, we can resolve this.</div>
<div class=""><br class="">
</div>
<div class="">As for the first production batch units, they are
what they are. For normal SD CARD operation (copying files,
flashing firmware, etc), it makes little difference. I guess
most users don’t even have an SD CARD inserted. The speed
limitation really only becomes an issue if you are trying to
log lots of data to SD CARD (such as CAN bus dumps). If the
USB is connected, you can 'config set sdcard maxfreq.khz
20000’ and it will work faster. The CP2102 chip can be
changed, and I’ll do that for anyone that needs it. I’m asking
China to send me some from the latest production batch that we
know works. Replacement is relatively straightforward, but
involves micro-soldering (the cp2102 is a surface mount chip,
very small footprint, with lots of other components near it on
the board).</div>
<div class=""><br class="">
</div>
<div class="">Regards, Mark.</div>
<div class=""><br class="">
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
OvmsDev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:OvmsDev@lists.openvehicles.com">OvmsDev@lists.openvehicles.com</a>
<a class="moz-txt-link-freetext" href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev">http://lists.openvehicles.com/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>
</body>
</html>