<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:"Tms Rmn";
panose-1:2 2 6 3 4 5 5 2 3 4;}
@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;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
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;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></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-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">HI all,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I am evaluating a HBM CX27 EtherCAT data aquisition system.<o:p></o:p></p>
<p class="MsoNormal">It has, at least for me unusal way of configuring the PDO map.<o:p></o:p></p>
<p class="MsoNormal">Each input signal, and its corresponding data signal occupies<o:p></o:p></p>
<p class="MsoNormal">two 'ec_pdo_info_t' entries. <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">To clearify, 'ethercat cstruct' looks like this:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">ec_pdo_entry_info_t slave_10_pdo_entries[] = {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> {0x6130, 0x01, 32},<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> {0x6150, 0x01, 8},<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> {0x6130, 0x02, 32},<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> {0x6150, 0x02, 8},
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">...<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> {0x6130, 0xc7, 32},<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> {0x6150, 0xc7, 8},<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> {0x61d1, 0x02, 64},<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> {0x61d1, 0x03, 64},<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> {0x61e1, 0x01, 64},<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">};<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">ec_pdo_info_t slave_10_pdos[] = {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> {0x1a00, 2, slave_10_pdo_entries + 0},<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> {0x1a01, 2, slave_10_pdo_entries + 2},<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> {0x1a02, 2, slave_10_pdo_entries + 4},<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> {0x1a03, 2, slave_10_pdo_entries + 6},<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> {0x1a04, 2, slave_10_pdo_entries + 8},<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">...<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> {0x1ac8, 1, slave_10_pdo_entries + 399},<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> {0x1ac9, 1, slave_10_pdo_entries + 400},<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> {0x1aca, 1, slave_10_pdo_entries + 401},<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">};<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">As you can see it can handle loads of data signals.<o:p></o:p></p>
<p class="MsoNormal">The problem is that during configuration of the device<o:p></o:p></p>
<p class="MsoNormal">I get a stack overflow. <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I have instrumented some code in fsm_pdo.c, showing the actual free stack space.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">-- Function: ec_fsm_pdo_conf_action_pdo_mapping stack free: 0x00001be0<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">-- Function: ec_fsm_pdo_conf_action_check_mapping stack free: 0x00001b6c<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">-- Function: ec_fsm_pdo_conf_action_pdo_mapping stack free: 0x00001b4c<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">-- Function: ec_fsm_pdo_conf_action_check_mapping stack free: 0x00001b4c<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">...<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">-- Function: ec_fsm_pdo_conf_action_pdo_mapping stack free: 0x0000006c<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">-- Function: ec_fsm_pdo_conf_action_check_mapping stack free: 0x0000003c<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">-- Function: ec_fsm_pdo_conf_action_pdo_mapping stack free: 0x0000001c<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">-- Function: ec_fsm_pdo_conf_action_check_mapping stack free: 0x00000004<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">-- Function: ec_fsm_pdoBUG: unable to handle kernel paging request at 696c610a<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">There seems to be some recursion going on, eating the stack and crashing the application.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">If the HBM is cold-started, it has no configuration and the code does not<o:p></o:p></p>
<p class="MsoNormal">go into recusion. It probably uses the escape route in <o:p>
</o:p></p>
<p class="MsoNormal">ec_fsm_pdo_conf_action_pdo_mapping() where the list_empty() exits the function.<o:p></o:p></p>
<p class="MsoNormal">If the application is restarted without a power cycle on the HBM unit<o:p></o:p></p>
<p class="MsoNormal">it enters the recursion and crashes.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">For now I have a work around this problem. Default the SII-EEPROM does not have<o:p></o:p></p>
<p class="MsoNormal">'enable_pdo_configuration' bit set, in CoE details. When I enable this bit, the
<o:p></o:p></p>
<p class="MsoNormal">code uses the escape in 'ec_fsm_pdo_conf_action_check_mapping' and exits via<o:p></o:p></p>
<p class="MsoNormal">ec_fsm_pdo_entry_start_configuration().<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">For now this seems to work. I have to double check if I get all my data.<o:p></o:p></p>
<p class="MsoNormal">At least the application does not crash anymore.<o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:"Tms Rmn",serif"><o:p> </o:p></span></p>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse">
<tbody>
<tr>
<td width="884" style="width:663.2pt;padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal" style="page-break-after:avoid;text-autospace:none"><span style="font-size:9.0pt;font-family:"Verdana",sans-serif;color:black">Godert Luigjes,</span><span style="font-size:12.0pt;font-family:"Verdana",sans-serif;color:black">
<o:p></o:p></span></p>
<p class="MsoNormal" style="page-break-after:avoid;text-autospace:none"><span style="font-size:9.0pt;font-family:"Verdana",sans-serif;color:black">Software Engineer</span><span style="font-size:12.0pt;font-family:"Verdana",sans-serif;color:black">, Moog Inc.<o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<br>
<p style="font-size:12px"><font face="Calibri">Confidentiality Notice: This electronic mail transmission is intended for the use of the individual or entity to which it is addressed and may contain confidential and/or proprietary information belonging to the
sender. If you are not the intended recipient, you are hereby notified that any disclosure, use, copying, distribution, or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this transmission
in error, please notify the sender immediately by e-mail and delete the original message. Thank you for your cooperation.</font>
<br>
</p>
</body>
</html>