<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:36.0pt;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
span.EmailStyle19
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:625820734;
mso-list-type:hybrid;
mso-list-template-ids:-514523658 -61159166 336134147 336134149 336134145 336134147 336134149 336134145 336134147 336134149;}
@list l0:level1
{mso-level-start-at:0;
mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;
mso-fareast-font-family:Calibri;
mso-bidi-font-family:"Times New Roman";}
@list l0:level2
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level3
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l0:level4
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l0:level5
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level6
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l0:level7
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l0:level8
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level9
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l1
{mso-list-id:1818449840;
mso-list-type:hybrid;
mso-list-template-ids:586044698 310000172 336134147 336134149 336134145 336134147 336134149 336134145 336134147 336134149;}
@list l1:level1
{mso-level-start-at:0;
mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;
mso-fareast-font-family:Calibri;
mso-bidi-font-family:"Times New Roman";}
@list l1:level2
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l1:level3
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l1:level4
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l1:level5
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l1:level6
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l1:level7
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l1:level8
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l1:level9
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-NZ link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal>Another default-branch patchset update is attached. It is still based on 5a70ffc4644b.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>For convenience, I’ve made an <a href="https://sourceforge.net/u/uecasm/etherlab-patches/ci/default/tree/#readme">online patchset repository</a>. It contains a README that describes the individual patches (from prior posts, where I could find them; let me know if something is unclear) and gives the commands required to clone your own copy of the upstream repository and apply the patches to it.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Modified patches:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l1 level1 lfo2'><![if !supportLists]><span style='font-family:Symbol'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><b>0051-fsm_change-external-datagram.patch</b>:<br><b>0052-fsm_slave_config-external-datagram.patch</b>:<br><b>0053-fsm_slave_scan-external-datagram.patch</b>:<br>Fixed some spots where it was accessing the wrong datagram.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>New patches:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo4'><![if !supportLists]><span style='font-family:Symbol'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><b>0043-ethercat-diag.patch</b>:<br>Recently posted to the users list by Ralf Roesch, adding a “diag” command to the ethercat command line tool, to aid in locating lost links and other comms errors.<br><br>Other than rebasing within the patchset, I’ve made the following tweaks to the code (otherwise it is largely unchanged):<b><o:p></o:p></b></p><p class=MsoListParagraph style='margin-left:72.0pt;text-indent:-18.0pt;mso-list:l0 level2 lfo4'><![if !supportLists]><span style='font-family:"Courier New"'><span style='mso-list:Ignore'>o<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]>Various whitespace fixes.<b><o:p></o:p></b></p><p class=MsoListParagraph style='margin-left:72.0pt;text-indent:-18.0pt;mso-list:l0 level2 lfo4'><![if !supportLists]><span style='font-family:"Courier New"'><span style='mso-list:Ignore'>o<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]>Moved a few lines in main.cpp for consistent grouping.<b><o:p></o:p></b></p><p class=MsoListParagraph style='margin-left:72.0pt;text-indent:-18.0pt;mso-list:l0 level2 lfo4'><![if !supportLists]><span style='font-family:"Courier New"'><span style='mso-list:Ignore'>o<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]>Changed llc_reset to a bool, since it was being used as a bool.<b><o:p></o:p></b></p><p class=MsoListParagraph style='margin-left:72.0pt;text-indent:-18.0pt;mso-list:l0 level2 lfo4'><![if !supportLists]><span style='font-family:"Courier New"'><span style='mso-list:Ignore'>o<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]>Tweaked a few lines from assignment to compound assignment to simplify.<b><o:p></o:p></b></p><p class=MsoListParagraph style='margin-left:72.0pt;text-indent:-18.0pt;mso-list:l0 level2 lfo4'><![if !supportLists]><span style='font-family:"Courier New"'><span style='mso-list:Ignore'>o<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]>Removed the data type lookup in EscRegRead and EscRegWrite.<b><o:p></o:p></b></p><p class=MsoListParagraph style='margin-left:108.0pt;text-indent:-18.0pt;mso-list:l0 level3 lfo4'><![if !supportLists]><span style='font-family:Wingdings'><span style='mso-list:Ignore'>§<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]>Since this is all internal and only used to get the size, which is well known to the caller, the lookup seemed unnecessary.<b><o:p></o:p></b></p><p class=MsoListParagraph style='margin-left:72.0pt;text-indent:-18.0pt;mso-list:l0 level2 lfo4'><![if !supportLists]><span style='font-family:"Courier New"'><span style='mso-list:Ignore'>o<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]>Made EscRegRead and EscRegWrite output errors to stderr instead of stdout.<b><o:p></o:p></b></p><p class=MsoListParagraph style='margin-left:72.0pt;text-indent:-18.0pt;mso-list:l0 level2 lfo4'><![if !supportLists]><span style='font-family:"Courier New"'><span style='mso-list:Ignore'>o<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]>Fixed a printf format issue that generated a compiler warning.<b><o:p></o:p></b></p><p class=MsoListParagraph style='margin-left:72.0pt;text-indent:-18.0pt;mso-list:l0 level2 lfo4'><![if !supportLists]><span style='font-family:"Courier New"'><span style='mso-list:Ignore'>o<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]>Made EscRegRead and EscRegWrite treat errors as non-fatal.<b><o:p></o:p></b></p><p class=MsoListParagraph style='margin-left:108.0pt;text-indent:-18.0pt;mso-list:l0 level3 lfo4'><![if !supportLists]><span style='font-family:Wingdings'><span style='mso-list:Ignore'>§<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]>Some slaves do not implement all of these registers, and so trying to read them will produce an “I/O error” exception. In this case it makes more sense to continue reading the other registers than to abort.<b><o:p></o:p></b></p><p class=MsoListParagraph style='margin-left:108.0pt;text-indent:-18.0pt;mso-list:l0 level3 lfo4'><![if !supportLists]><span style='font-family:Wingdings'><span style='mso-list:Ignore'>§<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]>For example, Beckhoff EL3062 does not implement register 0x030C.<b><o:p></o:p></b></p><p class=MsoListParagraph style='margin-left:108.0pt;text-indent:-18.0pt;mso-list:l0 level3 lfo4'><![if !supportLists]><span style='font-family:Wingdings'><span style='mso-list:Ignore'>§<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]>0x0308-0x030B can similarly be absent on some older slaves.<br><br><b><o:p></o:p></b></p><p class=MsoListParagraph>I’m a <b>little</b> hesitant about the command name being “diag” – while it’s not a bad name for network diagnostics or error stats it might be confused with the “Diagnosis History” object as specified in ETG1020, which is an entirely different thing. (And something that might be useful to add to the tool in the future.) I’m open to alternative suggestions.<o:p></o:p></p><p class=MsoListParagraph><b><o:p> </o:p></b></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo4'><![if !supportLists]><span style='font-family:Symbol'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><b>0044-diag-readwrite.patch</b>:<br>This is a further modification on top of the previous patch which replaces several separate read and write requests with a single read or read+write request (plus one additional read) per slave. (So naturally it depends on patch 0026.)<br><br>In theory this is more efficient, but most importantly since the reset occurs using the same datagram as the read, it’s now atomic and there’s no risk of losing counts (which could previously happen if the slave incremented its counter after the read but before the write).<br><br><b><o:p></o:p></b></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo4'><![if !supportLists]><span style='font-family:Symbol'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><b>0045-slave-config-position.patch</b>:<br>Adds a “position” field to the structure returned by ecrt_slave_config_state. This allows you to quickly get the ring position of a slave from its relative alias:offset address, which in turn allows you to call other APIs that require this (eg. ecrt_master_get_slave).<br><br>Note that the position is only valid if “online” is true, and that it is possible for the value to be stale (ie. the slave has moved to a different position) if the network changes and is consequently rescanned after this call. So use it defensively. (You’re reasonably safe in the period between requesting the master and activating it, as rescans are inhibited during this time. OTOH, only the application can request the master; an external tool can’t.)<br><br>I’m considering whether it would be useful to make a general function available for this conversion, to avoid duplicating the alias:offset conversion logic in too many places (eg. the tool requires it as well, but can’t use the slave_config-based conversion since it can’t request the master).<br><br><b><o:p></o:p></b></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo4'><![if !supportLists]><span style='font-family:Symbol'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><b>0046-e1000e-link-detection.patch</b>:<br>Fixed link detection in e1000e driver for 3.10-3.16.<br><br>This is <a href="http://lists.etherlab.org/pipermail/etherlab-dev/2016/000554.html">Christoph Permes</a>’ 3.16 patch and 3.14-v2 patch, with the latter backported to 3.12 and 3.10. I haven’t tested these personally.<br><br><b><o:p></o:p></b></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo4'><![if !supportLists]><span style='font-family:Symbol'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><b>0057-fsm_foe-simplify.patch</b>:<br>Removes some redundant fields from the FoE FSM; some were unused copy/paste holdovers from the CoE FSM while others were duplicated unnecessarily between the read and write operations, which can’t be concurrent for a given slave anyway.<br><br>Also fixes the case where the incoming data exceeds the provided buffer to properly terminate the state machine instead of leaving things dangling. Although note that this still leaves the FoE conversation itself dangling, so you’ll likely get an error on the next request if this occurs.<br><br><b><o:p></o:p></b></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo4'><![if !supportLists]><span style='font-family:Symbol'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><b>0058-foe-password.patch</b>:<br>Adds support for sending an FoE password along with read or write requests.<br><br>Also implements the -o option for the foe_read command (which was documented but not implemented).<br><br>Also makes the ioctl behind foe_read actually use the buffer size requested by the caller (instead of a hard-coded value); though note that foe_read itself still uses a hard-coded value of its own (but it’s larger, so bigger files should be readable now). It’s possible that users on limited-memory embedded systems might need to reduce this value, but it’s still fairly conservative as RAM sizes go.<br><br><b><o:p></o:p></b></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo4'><![if !supportLists]><span style='font-family:Symbol'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><b>0059-foe-requests.patch</b>:<br>Makes FoE transfer requests into public ecrt_* API, similar to SDO requests.<br><br>Primarily (following my goal of “parallel all the things”), this allows FoE transfers to be non-blocking so that transfers to multiple slaves can occur concurrently from the same requesting thread (previously this was only possible by using separate threads, since the only API was blocking). Note that due to patch 0018 you can call ecrt_master_deactivate() to delete these requests when you’re done with them, even if you haven’t called ecrt_master_activate() yet.<br><br>It has a possible side benefit that FoE transfers can now be started and monitored from realtime context, although as FoE is mostly used for firmware updates this is unlikely to be all that useful in practice.<br><br>I considered a few alternative approaches to this (the next leading contender was to make async versions of the existing FoE ioctls), but this seemed more consistent with existing APIs. I’m open to suggestions here too though, since it does feel like a slightly odd fit. (But works quite nicely.)<br><br><b><o:p></o:p></b></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo4'><![if !supportLists]><span style='font-family:Symbol'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><b>0060-foe-request-progress.patch</b>:<br>Adds a way to get a “current progress” value (actually the byte offset) for async FoE transfers.<b><o:p></o:p></b></p><p class=MsoNormal><b><o:p> </o:p></b></p></div></body></html>