Project

General

Profile

Bug #4815

PowerUp when no card is inserted fails after a very long delay: 60 seconds

Added by rousseau 4 days ago. Updated 4 days ago.

Status:
New
Priority:
Low
Assignee:
-
Target version:
-
Start date:
10/17/2020
Due date:
% Done:

0%

Spec Reference:

Description

If I insert a card connector but without a SIM card in the card connector then the reader (sysmoOCTSIM in my case) reports a card present.
My CCID driver then tries to power up the card. The reader does not respond before 60 seconds. I think that is a very long delay.

00000008 [140021143160576] ifdhandler.c:1885:IFDHICCPresence() usb:1d50/6141:libudev:0:/dev/bus/usb/001/008 (lun: 20001)
00000010 [140021143160576] -> 000003 65 00 00 00 00 01 32 00 00 00 
00000531 [140021143160576] <- 000003 81 00 00 00 00 01 32 01 00 00 
00000020 [140021143160576] ifdhandler.c:2006:IFDHICCPresence() Card present
00000009 [140021143160576] ifdhandler.c:1184:IFDHPowerICC() action: PowerUp, usb:1d50/6141:libudev:0:/dev/bus/usb/001/008 (lun: 20001)
00000010 [140021143160576] -> 000003 62 00 00 00 00 01 33 01 00 00 
58660283 [140021143160576] <- 000003 80 00 00 00 00 01 33 41 FE 00 
00000020 [140021143160576] commands.c:246:CmdPowerOn Card absent or mute
00000009 [140021143160576] commands.c:275:CmdPowerOn() Power up with 5V failed. Try with auto.
00000009 [140021143160576] -> 000003 62 00 00 00 00 01 34 03 00 00 
58660581 [140021143160576] <- 000003 80 00 00 00 00 01 34 41 FE 00 
00000023 [140021143160576] commands.c:246:CmdPowerOn Card absent or mute
00000008 [140021143160576] commands.c:275:CmdPowerOn() Power up with 1.8V failed. Try with 3V.
00000010 [140021143160576] -> 000003 62 00 00 00 00 01 35 02 00 00 
58660339 [140021143160576] <- 000003 80 00 00 00 00 01 35 41 FE 00 
00000024 [140021143160576] commands.c:246:CmdPowerOn Card absent or mute
00000008 [140021143160576] commands.c:275:CmdPowerOn() Power up with 3V failed. Try with 5V.
00000006 [140021143160576] ifdhandler.c:1251:IFDHPowerICC() PowerUp failed

From the logs you can see that the reader answers with the "Card absent or mute" status only after 58660283 ┬Ás (or 59 seconds).

I have not checked the ISO 76816-3 to know the maximum delay allowed for the card to send the first ATR byte (TS).
I think 60 seconds is very long. I guess a timeout of 1 second is enough.

History

#1 Updated by Hoernchen 4 days ago

  • Priority changed from Normal to Low

Yes, the timeouts might be longer than what the spec says in some cases, since they are mostly major errors and the actual time does not really matter, and I think the manual mentions that empty trays should not be inserted into the octsim...

#2 Updated by Hoernchen 4 days ago

...That being said the timeout does appears to be a bit too long, it is usually the whole time required for the whole expected transfer, so in this case 33 bytes * 9600 ETU -> ~5 seconds for the 6720 baud default rate at 2.5mhz is what I'd expect to see here...

#3 Updated by rousseau 4 days ago

Hoernchen wrote:

...That being said the timeout does appears to be a bit too long, it is usually the whole time required for the whole expected transfer, so in this case 33 bytes * 9600 ETU -> ~5 seconds for the 6720 baud default rate at 2.5mhz is what I'd expect to see here...

If the card does not send the first ATR byte within the 9600 ETU then the reader could declare the card to be mute.
No need to wait for 33 bytes. The timeout could be much shorter than ~5 seconds (33 times shorter).

#4 Updated by Hoernchen 4 days ago

Should be fixed by https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/20710 - my original WT calculation was using GT instead of WT so it was ~90 times less, which was fine at the time, but then i forgot to update it after fixing the timeouts, so it was now suddenly far too long.

#5 Updated by rousseau 4 days ago

Wonderful, and fast correction.

I guess it is possible to update the reader firmware. Can you provide me a documentation and a new firmware?

#6 Updated by Hoernchen 4 days ago

The patches are not yet merged - new firmware ends up at https://ftp.osmocom.org/binaries/osmo-ccid-firmware/latest/ so as soon as the patches are merged and the nightly firmware build is done you can grab the bin file from there + use dfu-util (something like sudo dfu-util -d 1d50:6141 -D sysmoOCTSIM-0.2.9-e060.bin -R) to flash the octsim, it features a dfu runtime descriptor so you do not need to push the button for that.

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)