calypso SIM driver on c139 (also: l1ctl SIM APDU)

Gianni Tedesco gianni at scaramanga.co.uk
Wed May 11 00:12:28 UTC 2011


The SIM and the SIM reader in the phone and the mechanical contact
between them are definitely working because the SIM can be accessed from
the motorola firmware, from another phone and from a PC smartcard reader
with no PIN or anything.

However, under simtest firmware no data is received by the phone, even
the ATR is zero bytes...

Anybody had this problem?

Also, is l1CTL SIM APDU command not implemented in the layer1 firmware?
How are people making calls without a SIM? :P

Gianni

----------------SIMTEST----8<-----------------
Initializing driver:
SIM: Registering interrupt handler for simcard-interface



====================== CALYPSO SIM REGISTER DUMP =====================
Reg_sim_cmd register (R/W) - FFFE:0000
  |-REG_SIM_CMD = 0000
  |  |-REG_SIM_CMD_CMDCARDRST = 0 ==> SIM card reset sequence disabled.
  |  |-REG_SIM_CMD_CMDIFRST = 0
  |  |-REG_SIM_CMD_CMDSTOP = 0
  |  |-REG_SIM_CMD_CMDSTART = 0
  |  |-REG_SIM_CMD_MODULE_CLK_EN = 0 ==> Clock of the module disabled.
  |-REG_SIM_STAT = 000b
  |  |-REG_SIM_STAT_STATNOCARD = 1 ==> No card!
  |  |-REG_SIM_STAT_STATTXPAR = 1 ==> Parity ok!
  |  |-REG_SIM_STAT_STATFIFOFULL = 0
  |  |-REG_SIM_STAT_STATFIFOEMPTY = 1 ==> Fifo empty!
  |-REG_SIM_CONF1 = 000c
  |  |-REG_SIM_CONF1_CONFCHKPAR = 0 ==> Parity check on reception disabled.
  |  |-REG_SIM_CONF1_CONFCODCONV = 0 ==> Coding convention is direct (normal).
  |  |-REG_SIM_CONF1_CONFTXRX = 1 ==> SIO line direction is in transmit mode.
  |  |-REG_SIM_CONF1_CONFSCLKEN = 1 ==> SIM clock in normal mode.
  |  |-REG_SIM_CONF1_reserved = 0 ==> ETU period is CONFETUPERIOD.
  |  |-REG_SIM_CONF1_CONFSCLKDIV = 0 ==> SIM clock frequency is 13/4 Mhz.
  |  |-REG_SIM_CONF1_CONFSCLKLEV = 0 ==> SIM clock idle level is low.
  |  |-REG_SIM_CONF1_CONFETUPERIOD = 0 ==> ETU period is 372/8*1/Fsclk.
  |  |-REG_SIM_CONF1_CONFBYPASS = 0 ==> Hardware timers and start and stop sequences are normal.
  |  |-REG_SIM_CONF1_CONFSVCCLEV = 0 ==> SVCC Level is low (Only valid when CONFBYPASS = 1).
  |  |-REG_SIM_CONF1_CONFSRSTLEV = 0 ==> SRST Level is low (Only valid when CONFBYPASS = 1).
  |  |-REG_SIM_CONF1_CONFTRIG = 0x0 (FIFO trigger level)
  |  |-REG_SIM_CONF1_CONFSIOLOW = 0
  |-REG_SIM_CONF2 = 0940
  |  |-REG_SIM_CONF2_CONFTFSIM = 0x0 (time delay for filtering of SIM_CD)
  |  |-REG_SIM_CONF2_CONFTDSIM = 0x4 (time delay for contact activation/deactivation)
  |  |-REG_SIM_CONF2_CONFWAITI = 0x9 (CONFWAITI overflow wait time between two received chars)
  |-REG_SIM_IT = 0000
  |  |-REG_SIM_IT_SIM_NATR = 0 ==> On read access to REG_SIM_IT.
  |  |-REG_SIM_IT_SIM_WT = 0 ==> On read access to REG_SIM_IT.
  |  |-REG_SIM_IT_SIM_OV = 0 ==> On read access to REG_SIM_IT.
  |  |-REG_SIM_IT_SIM_TX = 0 ==> On write access to REG_SIM_DTX or on switching
  |  |                           from transmit to receive mode (CONFTXRX bit)
  |  |-REG_SIM_IT_SIM_RX = 0 ==> On read access to REG_SIM_DRX.
  |-REG_SIM_DRX = 0100
  |  |-REG_SIM_DRX_SIM_DRX = 0x0 (next data byte in FIFO available for reading)
  |  |-REG_SIM_DRX_STATRXPAR = 1 ==> Parity Ok.
  |-REG_SIM_DTX = 00 (next data byte to be transmitted)
  |-REG_SIM_MASKIT = 003f
  |  |-REG_SIM_MASKIT_MASK_SIM_NATR = 1 ==> No-answer-to-reset interrupt is masked.
  |  |-REG_SIM_MASKIT_MASK_SIM_WT = 1 ==> Character wait-time overflow interrupt is masked.
  |  |-REG_SIM_MASKIT_MASK_SIM_OV = 1 ==> Receive overflow interrupt is masked.
  |  |-REG_SIM_MASKIT_MASK_SIM_TX = 1 ==> Waiting characters to be transmit interrupt is masked.
  |  |-REG_SIM_MASKIT_MASK_SIM_RX = 1 ==> Waiting characters to be read interrupt is masked.
  |  |-REG_SIM_MASKIT_MASK_SIM_CD = 1 ==> SIM card insertion/extraction interrupt is masked.
  |-REG_SIM_IT_CD = fffe0010
     |-REG_SIM_IT_CD_IT_CD = 0 ==> SIM card insertion/extraction interrupt is unmasked.
Power up simcard:
 * Power enabled!
 * Clock enabled!
 * Reset released!
SIM-ISR: Interrupt caught:  Waiting characters to be read...
SIM-ISR: Interrupt caught:  Waiting characters to be read...
SIM-ISR: Interrupt caught:  Waiting characters to be read...
SIM-ISR: Interrupt caught:  Waiting characters to be read...
SIM-ISR: Interrupt caught:  Waiting characters to be read...
SIM-ISR: Interrupt caught:  Waiting characters to be read...
SIM-ISR: Interrupt caught:  Waiting characters to be read...
SIM-ISR: Interrupt caught:  Waiting characters to be read...
SIM-ISR: Interrupt caught:  Waiting characters to be read...
SIM-ISR: Interrupt caught:  Waiting characters to be read...
SIM-ISR: Interrupt caught:  Waiting characters to be read...
SIM-ISR: Interrupt caught:  Waiting characters to be read...
SIM-ISR: Interrupt caught:  Waiting characters to be read...
SIM-ISR: Interrupt caught:  Waiting characters to be read...
SIM-ISR: Interrupt caught:  Waiting characters to be read...
SIM-ISR: Interrupt caught:  Waiting characters to be read...
SIM-ISR: Interrupt caught:  Waiting characters to be read...
SIM-ISR: Interrupt caught:  Waiting characters to be read...
SIM-ISR: Interrupt caught:  Waiting characters to be read...
SIM-ISR: Interrupt caught:  Waiting characters to be read...
SIM-ISR: Interrupt caught:  Waiting characters to be read...
SIM-ISR: Interrupt caught:  Waiting characters to be read...
SIM-ISR: Interrupt caught:  Character underflow!
(0 bytes)
Reset simcard:
 * Reset pulled down!
 * Reset released!
SIM-ISR: Interrupt caught:  Waiting characters to be read...
SIM-ISR: Interrupt caught:  Waiting characters to be read...
SIM-ISR: Interrupt caught:  Waiting characters to be read...
SIM-ISR: Interrupt caught:  Waiting characters to be read...
SIM-ISR: Interrupt caught:  Waiting characters to be read...
SIM-ISR: Interrupt caught:  Waiting characters to be read...
SIM-ISR: Interrupt caught:  Waiting characters to be read...
SIM-ISR: Interrupt caught:  Waiting characters to be read...
SIM-ISR: Interrupt caught:  Waiting characters to be read...
SIM-ISR: Interrupt caught:  Waiting characters to be read...
SIM-ISR: Interrupt caught:  Waiting characters to be read...
SIM-ISR: Interrupt caught:  Waiting characters to be read...
SIM-ISR: Interrupt caught:  Waiting characters to be read...
SIM-ISR: Interrupt caught:  Waiting characters to be read...
SIM-ISR: Interrupt caught:  Waiting characters to be read...
SIM-ISR: Interrupt caught:  Waiting characters to be read...
SIM-ISR: Interrupt caught:  Waiting characters to be read...
SIM-ISR: Interrupt caught:  Waiting characters to be read...
SIM-ISR: Interrupt caught:  Waiting characters to be read...
SIM-ISR: Interrupt caught:  Waiting characters to be read...
SIM-ISR: Interrupt caught:  Waiting characters to be read...
SIM-ISR: Interrupt caught:  Waiting characters to be read...
SIM-ISR: Interrupt caught:  Character underflow!
(0 bytes)
SIM-T0: Transceiving APDU-Header: (a0 a4 00 00 02)
SIM-ISR: Interrupt caught:  Waiting for character to transmit...
SIM-ISR: Interrupt caught:  Waiting for character to transmit...
SIM-ISR: Interrupt caught:  Waiting for character to transmit...
SIM-ISR: Interrupt caught:  Waiting for character to transmit...
SIM-ISR: Interrupt caught:  Waiting for character to transmit...
SIM-T0: Case 2: No input / Output of known length (See also GSM 11.11 Page 34)
SIM-ISR: Interrupt caught:  Waiting characters to be read...
SIM-ISR: Interrupt caught:  Character underflow!
SIM-T0: T0 Protocol error: Missing ACK byte -- aborting!
SIM-T0: Transceiving APDU-Header: (a0 c0 00 00 0f)
SIM-ISR: Interrupt caught:  Waiting for character to transmit...
SIM-ISR: Interrupt caught:  Waiting for character to transmit...
SIM-ISR: Interrupt caught:  Waiting for character to transmit...
SIM-ISR: Interrupt caught:  Waiting for character to transmit...
SIM-ISR: Interrupt caught:  Waiting for character to transmit...
SIM-T0: Case 4: Input / No output (See also GSM 11.11 Page 34)
SIM-ISR: Interrupt caught:  Waiting characters to be read...
SIM-ISR: Interrupt caught:  Waiting characters to be read...
SIM-ISR: Interrupt caught:  Character underflow!
SIM-T0: T0 Protocol error: Incorrect or missing answer -- aborting!
e0 73 d7 b9 ae ea bf 7e f7 3b 7f 6f 32 fe 25 (15 bytes)
Test Phase 1: Testing bare sim commands...
 * Testing SELECT: Selecting MF
SIM-T0: Transceiving APDU-Header: (a0 a4 00 00 02)
SIM-ISR: Interrupt caught:  Waiting for character to transmit...
SIM-ISR: Interrupt caught:  Waiting for character to transmit...
SIM-ISR: Interrupt caught:  Waiting for character to transmit...
SIM-ISR: Interrupt caught:  Waiting for character to transmit...
SIM-ISR: Interrupt caught:  Waiting for character to transmit...
SIM-T0: Case 2: No input / Output of known length (See also GSM 11.11 Page 34)
SIM-ISR: Interrupt caught:  Waiting characters to be read...
SIM-ISR: Interrupt caught:  Character underflow!
SIM-T0: T0 Protocol error: Missing ACK byte -- aborting!
   ==> Status word: ffff
 * Testing SELECT: Selecting DF_GSM
SIM-T0: Transceiving APDU-Header: (a0 a4 00 00 02)
SIM-ISR: Interrupt caught:  Waiting for character to transmit...
SIM-ISR: Interrupt caught:  Waiting for character to transmit...
SIM-ISR: Interrupt caught:  Waiting for character to transmit...

At this point it hangs "forever" - well at least half hour.






More information about the baseband-devel mailing list