<p>tsaitgaist has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/simtrace2/+/16078">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">check RST/VCC/CLK line at every step of the activation<br><br>ISO-7816 specifies a card activation sequence: VCC on, CLK active, then RST<br>release.<br>we now check for the end state at every state of the activation in case the<br>reader does not strictly follows the sequence.<br><br>change has been tested on OWHW slot 1.<br><br>Change-Id: Ie55505ab3a70cbd64281af40af53d5e120313228<br>---<br>M firmware/libcommon/source/card_emu.c<br>1 file changed, 7 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/78/16078/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/firmware/libcommon/source/card_emu.c b/firmware/libcommon/source/card_emu.c</span><br><span>index 087867f..5298ffc 100644</span><br><span>--- a/firmware/libcommon/source/card_emu.c</span><br><span>+++ b/firmware/libcommon/source/card_emu.c</span><br><span>@@ -380,6 +380,13 @@</span><br><span>     case ISO_S_WAIT_RST:</span><br><span>                 /* disable Rx and Tx of UART */</span><br><span>              card_emu_uart_enable(ch->uart_chan, 0);</span><br><span style="color: hsl(120, 100%, 40%);">+            /* check end activation state (only necessary if the reader to not respect the activation sequence) */</span><br><span style="color: hsl(120, 100%, 40%);">+                if (ch->vcc_active && ch->clocked && !ch->in_reset) {</span><br><span style="color: hsl(120, 100%, 40%);">+                        /* enable the TC/ETU counter once reset has been released */</span><br><span style="color: hsl(120, 100%, 40%);">+                  tc_etu_enable(ch->tc_chan);</span><br><span style="color: hsl(120, 100%, 40%);">+                        /* prepare to send the ATR */</span><br><span style="color: hsl(120, 100%, 40%);">+                 card_set_state(ch, ISO_S_WAIT_ATR);</span><br><span style="color: hsl(120, 100%, 40%);">+           }</span><br><span>            break;</span><br><span>       case ISO_S_WAIT_ATR:</span><br><span>                 /* Reset to initial Fi / Di ratio */</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/simtrace2/+/16078">change 16078</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/simtrace2/+/16078"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: simtrace2 </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ie55505ab3a70cbd64281af40af53d5e120313228 </div>
<div style="display:none"> Gerrit-Change-Number: 16078 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: tsaitgaist <kredon@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>