<matrixBuild _class='hudson.matrix.MatrixBuild'><action _class='hudson.model.CauseAction'><cause _class='org.jenkinsci.plugins.workflow.support.steps.build.BuildUpstreamCause'><shortDescription>Started by upstream project "gerrit-simtrace2" build number 122</shortDescription><upstreamBuild>122</upstreamBuild><upstreamProject>gerrit-simtrace2</upstreamProject><upstreamUrl>job/gerrit-simtrace2/</upstreamUrl></cause></action><action></action><action _class='hudson.model.ParametersAction'><parameter _class='hudson.model.StringParameterValue'><name>COMMENT_TYPE</name><value></value></parameter><parameter _class='hudson.model.StringParameterValue'><name>DISTRO</name><value></value></parameter><parameter _class='hudson.model.StringParameterValue'><name>GERRIT_BRANCH</name><value>master</value></parameter><parameter _class='hudson.model.StringParameterValue'><name>GERRIT_CHANGE_NUMBER</name><value>43126</value></parameter><parameter _class='hudson.model.StringParameterValue'><name>GERRIT_HOST</name><value>gerrit.osmocom.org</value></parameter><parameter _class='hudson.model.StringParameterValue'><name>GERRIT_PATCHSET_NUMBER</name><value>1</value></parameter><parameter _class='hudson.model.StringParameterValue'><name>GERRIT_PATCHSET_REVISION</name><value>b3856f9968c162007d32ed677645dc67ce8bde6b</value></parameter><parameter _class='hudson.model.StringParameterValue'><name>GERRIT_PATCHSET_UPLOADER_NAME</name><value>Hoernchen</value></parameter><parameter _class='hudson.model.StringParameterValue'><name>GERRIT_PORT</name><value>29418</value></parameter><parameter _class='hudson.model.StringParameterValue'><name>GERRIT_PROJECT</name><value>simtrace2</value></parameter><parameter _class='hudson.model.StringParameterValue'><name>GERRIT_REFSPEC</name><value>refs/changes/26/43126/1</value></parameter><parameter _class='hudson.model.StringParameterValue'><name>GERRIT_REPO_URL</name><value>ssh://jenkins@gerrit.osmocom.org:29418/simtrace2</value></parameter><parameter _class='hudson.model.StringParameterValue'><name>PIPELINE_BUILD_URL</name><value>https://jenkins.osmocom.org/jenkins/job/gerrit-simtrace2/122/</value></parameter><parameter _class='hudson.model.StringParameterValue'><name>PROJECT_NAME</name><value>simtrace2</value></parameter><parameter _class='hudson.model.StringParameterValue'><name>BRANCH_CI</name><value>master</value></parameter></action><action _class='jenkins.metrics.impl.TimeInQueueAction'><blockedDurationMillis>0</blockedDurationMillis><blockedTimeMillis>0</blockedTimeMillis><buildableDurationMillis>0</buildableDurationMillis><buildableTimeMillis>0</buildableTimeMillis><buildingDurationMillis>300494</buildingDurationMillis><executingTimeMillis>300494</executingTimeMillis><executorUtilization>1.0</executorUtilization><subTaskCount>0</subTaskCount><waitingDurationMillis>5825</waitingDurationMillis><waitingTimeMillis>5825</waitingTimeMillis></action><action></action><action _class='hudson.plugins.git.util.BuildData'><buildsByBranchName><osmith0.8.2 _class='hudson.plugins.git.util.Build'><buildNumber>55</buildNumber><marked><SHA1>5b5785af7a089b2a4f0c6963fdeebfc48fb22540</SHA1><branch><SHA1>5b5785af7a089b2a4f0c6963fdeebfc48fb22540</SHA1><name>osmith/0.8.2</name></branch></marked><revision><SHA1>5b5785af7a089b2a4f0c6963fdeebfc48fb22540</SHA1><branch><SHA1>5b5785af7a089b2a4f0c6963fdeebfc48fb22540</SHA1><name>osmith/0.8.2</name></branch></revision></osmith0.8.2><master _class='hudson.plugins.git.util.Build'><buildNumber>122</buildNumber><marked><SHA1>b3856f9968c162007d32ed677645dc67ce8bde6b</SHA1><branch><SHA1>b3856f9968c162007d32ed677645dc67ce8bde6b</SHA1><name>master</name></branch></marked><revision><SHA1>b3856f9968c162007d32ed677645dc67ce8bde6b</SHA1><branch><SHA1>b3856f9968c162007d32ed677645dc67ce8bde6b</SHA1><name>master</name></branch></revision></master></buildsByBranchName><lastBuiltRevision><SHA1>b3856f9968c162007d32ed677645dc67ce8bde6b</SHA1><branch><SHA1>b3856f9968c162007d32ed677645dc67ce8bde6b</SHA1><name>master</name></branch></lastBuiltRevision><remoteUrl>ssh://jenkins@gerrit.osmocom.org:29418/simtrace2</remoteUrl><scmName></scmName></action><action></action><action></action><action></action><action _class='org.jenkinsci.plugins.displayurlapi.actions.RunDisplayAction'></action><building>false</building><displayName>#122</displayName><duration>300494</duration><estimatedDuration>327764</estimatedDuration><fullDisplayName>gerrit-simtrace2-build #122</fullDisplayName><id>122</id><inProgress>false</inProgress><keepLog>false</keepLog><number>122</number><queueId>181020</queueId><result>SUCCESS</result><timestamp>1785265451389</timestamp><url>https://jenkins.osmocom.org/jenkins/job/gerrit-simtrace2-build/122/</url><builtOn></builtOn><changeSet _class='hudson.plugins.git.GitChangeSetList'><item _class='hudson.plugins.git.GitChangeSet'><affectedPath>firmware/test/card_emu_tests.c</affectedPath><affectedPath>firmware/libcommon/source/card_emu.c</affectedPath><commitId>b3856f9968c162007d32ed677645dc67ce8bde6b</commitId><timestamp>1785257901000</timestamp><author><absoluteUrl>https://jenkins.osmocom.org/jenkins/user/ewild</absoluteUrl><fullName>ewild</fullName></author><authorEmail>ewild@sysmocom.de</authorEmail><comment>firmware: card_emu: use Di in the waiting time

ISO 7816-3 section 10.2 defines WT = WI x 960 x Fi/f seconds,
store as etu, etu = Fi / (D x f) seconds, so the Fi cancels,
but the D does not:

	WT [etu] = WI x 960 x D

cemu dropped both (?!) -&gt; WI x 960.
The old comment explains why Fi can be dropped, which is right, but
what about Di ?!
sniffer gets it right (wt_wi * 960UL * wt_d), so the two state machines
disagreed here again, by up to a factor of 64???!!?!!?

This was fixed in osmo-ccid-firmware in 066489d in 2020 but not ported
to st2.

Additionally the waiting time was only recalculated at the end of the ATR,
where D is still 1 by definition, so a PPS increasing D reprogrammed the
baud rate but left the waiting time untouched??!

etu duration shrinks with D by the same factor, wall clock WT is
independent of D, which is the whole point.
The old code decreased the waiting time by a factor of D:
after a PPS to D=8 the card emitted its NULL procedure byte at ~0.09s
instead of ~0.71s with a reader deadline of ~1.43s,
and the inactivity timeout fires 8x too early, which probably led to
unexplained wtime_exp errors.

Update wt when WI becomes known (end of ATR) and
where D changes (after the PPS response) + tests.

Change-Id: I4263176d6073029d01f9ff5b11a6311617956af6
</comment><date>2026-07-28 18:58:21 +0200</date><id>b3856f9968c162007d32ed677645dc67ce8bde6b</id><msg>firmware: card_emu: use Di in the waiting time</msg><path><editType>edit</editType><file>firmware/test/card_emu_tests.c</file></path><path><editType>edit</editType><file>firmware/libcommon/source/card_emu.c</file></path></item><kind>git</kind></changeSet><culprit><absoluteUrl>https://jenkins.osmocom.org/jenkins/user/ewild</absoluteUrl><fullName>ewild</fullName></culprit><run><number>122</number><url>https://jenkins.osmocom.org/jenkins/job/gerrit-simtrace2-build/a1=default,a2=default,a3=default,a4=default,label=osmocom-gerrit/122/</url></run></matrixBuild>