SIM management

Generic SIM access +CSIM

+CSIM

Modules

All products

Attributes

Syntax

PIN required

Settings saved

Can be aborted

Response time

Error reference

full

Yes

No

No

-

+CME Error

Description

Allows direct control of the SIM by a distant application on the TE. This command transparently transmits the <command> to the SIM via the MT. The <response> is returned in the same manner to the TE.

The command needs the SIM module to work correctly.

It is recommended to wait some seconds after boot (or reset) before using the command.

It is recommended to disable the power saving with AT+UPSV=0 before sending a sequence of commands to the SIM card. The power saving can be re-enabled at the end.

The PIN insertion is not mandatory before the VERIFY PIN command execution.

Syntax

TypeSyntaxResponseExample

Set

AT+CSIM=<length>,<command>

+CSIM: <length>,<response>

OK

AT+CSIM=14,"A0A40000027F20"

+CSIM: 4,"6E00"

OK

Test

AT+CSIM=?

OK

OK

Defined values

ParameterTypeDescription

<length>

Number

Length of the characters sent to the TE in <command> or <response> parameters

<command>

String

Command passed on by MT to SIM in hex format; see the 3GPP TS 51.011 [41] and ETSI TS 102 221 [42]

<response>

String

Response to the command passed on by the SIM to the MT (3GPP TS 51.011 [41] and ETSI TS 102 221 [42])

Restricted SIM access +CRSM

+CRSM

Modules

All products

Attributes

Syntax

PIN required

Settings saved

Can be aborted

Response time

Error reference

full

Yes

No

No

< 10 s

+CME Error

Description

Allows easy access to the SIM database. The set command transmits the SIM command and its required parameters to the MT. The MT handles internally all SIM-MT interface locking and file selection routines. As response to the command, the MT sends the actual SIM information parameters and response data. An error result code may be returned when the command cannot be passed to the SIM, but the failure in the execution of the command in the SIM is reported in <sw1> and <sw2> parameters.

The expected response time shall be increased when using a remote SIM card via SAP and in case of simultaneous access to the SIM by another AT interface or by internal clients (e.g. BIP, IMS).

The command needs the SIM module to work correctly.

It is recommended to disable the power saving with AT+UPSV=0 before sending a sequence of commands to the SIM card. The power saving can be re-enabled at the end.

Syntax

TypeSyntaxResponseExample

Set

AT+CRSM=<command>[,<fileid>[,<P1>,<P2>,<P3>[,<data>[,<pathid>]]]]

+CRSM: <sw1>,<sw2>[,<response>]

OK

AT+CRSM=176,28471,0,0,3

+CRSM: 144,0,"989301770020594178F2"

OK

Test

AT+CRSM=?

OK

OK

Defined values

ParameterTypeDescription

<command>

Number

Allowed commands:

  • 176: read binary

  • 178: read record

  • 192: get response

  • 203: retrieve data

  • 214: update binary

  • 219: set data

  • 220: update record

  • 242: status

Allowed values:

  • 176, 178, 192, 214, 220, 242

<fileid>

Number

Identifies an elementary datafile on SIM. Mandatory for each command except STATUS (e.g. 28423: meaning IMSI file (6F07)). For a complete description of Elementary Files (EF), see 3GPP TS 31.102 [21].

<P1>, <P2>, <P3>

Number

Defines the request. These parameters are mandatory for each command, except GET RESPONSE and STATUS. The values are described in 3GPP TS 51.011 [41] and ETSI TS 102 221 [42].

<data>

String

Information which shall be written to the SIM (hexadecimal character format; see the +CSCS - string containing hexadecimal characters)

<pathid>

String

Contains the path of an elementary file on the SIM/UICC in hexadecimal format as defined in ETSI TS 102 221 [42] (e.g. "7F205F70" in SIM and UICC case). The <pathid> shall only be used in the mode "select by path from MF" as defined in ETSI TS 102 221 [42].

<sw1>, <sw2>

Number

Contains SIM information about the execution of the actual command and can be (more details in 3GPP TS 51.011 [41] and ETSI TS 102 221 [42]).

Status words examples for 2G SIM cards:

  • 0x90 0x00: normal ending of the command

  • 0x9F 0xXX: length XX of the response data

  • 0x92 0x0X: command successful but after using an internal retry routine X times

  • 0x92 0x40: memory problem

  • 0x94 0x00: no EF selected

  • 0x94 0x02: out of range (invalid address)

  • 0x94 0x04: file ID not found; pattern not found

  • 0x94 0x08: file is inconsistent with the command

  • 0x98 0x02: no CHV initialized

  • 0x98 0x04: access condition not fulfilled / unsucc. CHV verify / authent.failed

  • 0x98 0x08: in contradiction with CHV status

  • 0x98 0x10: in contradiction with invalidation status

  • 0x98 0x40: unsucc. CHV-verif. or UNBLOCK CHV-verif. / CHV blocked /UNBL.blocked

  • 0x67 0xXX: incorrect parameter P3

  • 0x6A 0x81: function not supported

  • 0x6A 0x82: file not found

  • 0x6B 0xXX: incorrect parameter P1 or P2

  • 0x6D 0xXX: unknown instruction code given in the command

  • 0x6E 0xXX: wrong instruction class given in the command

  • 0x6F 0xXX: technical problem with no diagnostic given

Status words examples for 3G SIM cards:

  • 0x90 0x00: normal ending of the command

  • 0x91 0xXX: length XX of the response data

  • 0x63 0xCX: command successful but after using an internal retry routine X times

  • 0x62 0x00: no information given, state of non volatile memory unchanged

  • 0x64 0x00: no information given, state of non-volatile memory unchanged

  • 0x65 0x00: no information given, state of non-volatile memory changed

  • 0x65 0x81: memory problem

  • 0x67 0x00: wrong length

  • 0x69 0x85: conditions of use not satisfied

  • 0x69 0x86: command not allowed (no EF selected)

  • 0x69 0x82: security status not satisfied

  • 0x62 0x81: part of returned data may be corrupted

  • 0x6A 0x81: function not supported

  • 0x6A 0x82: file not found

  • 0x6A 0x83: record not found

  • 0x6B 0x00: wrong parameter(s) P1, P2

  • 0x6D 0x00: instruction code not supported or invalid

  • 0x6E 0x00: instruction code not supported or invalid

  • 0x6F 0x00: technical problem, no precise diagnosis

<response>

String

The response of successful completion of the command previously issued (hexadecimal character format; see the +CSCS). STATUS and GET RESPONSE return data, which gives information about the current elementary datafield. This information includes the type of file and its size (see the 3GPP TS 51.011 [41] and the ETSI TS 102 221 [42]). After READ BINARY or READ RECORD command the requested data will be returned. <response> is not returned after a successful UPDATE BINARY or UPDATE RECORD command.

SIM hot insertion configuration +UDCONF=50

+UDCONF=50

Modules

All products

Attributes

Syntax

PIN required

Settings saved

Can be aborted

Response time

Error reference

full

No

NVM

No

-

+CME Error

Description

Configures the SIM hot insertion feature. The feature enables the SIM interface upon detection of external SIM card physical insertion / removal and behaves accordingly, triggering registration to / deregistration from the cellular network.

The command setting is saved in NVM and will be effective at the next power on.

Syntax

TypeSyntaxResponseExample

Set

AT+UDCONF=50,<sim_hot_insertion>

OK

AT+UDCONF=50,1

OK

Read

AT+UDCONF=50

+UDCONF: 50,<sim_hot_insertion>

OK

AT+UDCONF=50

+UDCONF: 50,1

OK

Defined values

ParameterTypeDescription

<sim_hot_insertion>

Number

SIM hot insertion setting. Allowed values:

  • 0 (factory-programmed value): SIM hot insertion disabled

  • 1: SIM hot insertion enabled

Notes

  • The +UDCONF=50 command doesn’t have an active role in the hot insertion feature, which is fully handled by the "SIM card detection" feature (configurable by means of the +UGPIOC AT command).

  • Reading command +UDCONF=50 returns 1 if SIM card detection is enabled, otherwise 0.

  • Writing command +UDCONF=50,1 returns OK if SIM card detection is enabled, otherwise +CME ERROR: operation not allowed.

  • Writing command +UDCONF=50,0 returns OK if SIM card detection is not enabled, otherwise +CME ERROR: operation not allowed.

Open logical channel +CCHO

+CCHO

Modules

All products

Attributes

Syntax

PIN required

Settings saved

Can be aborted

Response time

Error reference

full

No

No

No

-

+CME Error

Description

Causes the MT to return <sessionid> to allow the TE to identify a channel that is being allocated by the currently selected UICC, which is attached to ME. The currently selected UICC will open a new logical channel, select the application identified by the <dfname> received with this command and return a session Id as the response. The ME shall restrict the communication between the TE and the UICC to this logical channel.

When the maximum number of logical channels have been opened (normally 3, 2 when the IMS client is active), the command provides an error result code.

The <sessionid> is to be used when sending commands with +CGLA AT command.

Syntax

TypeSyntaxResponseExample

Set

AT+CCHO=<dfname>

+CCHO: <sessionid>

OK

AT+CCHO="A0000000871004FF49FF0589"

+CCHO: 11791

OK

Test

AT+CCHO=?

OK

Defined values

ParameterTypeDescription

<dfname>

Number

DF name, coded on 1 to 16 bytes, identifying the UICC application.

<sessionid>

Number

Session Id to be used to target a specific application on the smart card using logical channel mechanism.

Close logical channel +CCHC

+CCHC

Modules

All products

Attributes

Syntax

PIN required

Settings saved

Can be aborted

Response time

Error reference

full

No

No

No

-

+CME Error

Description

Asks the ME to close a communication session with the active UICC. The ME shall close the previously opened logical channel. The TE will no longer be able to send commands on this logical channel. The UICC will close the logical channel when receiving this command.

Syntax

TypeSyntaxResponseExample

Set

AT+CCHC=<sessionid>

+CCHC

OK

AT+CCHC=11791

+CCHC

OK

Test

AT+CCHC=?

OK

Defined values

ParameterTypeDescription

<sessionid>

Number

Session Id to be used to target a specific application on the smart card using logical channel mechanism.

Generic UICC logical channel access +CGLA

+CGLA

Modules

All products

Attributes

Syntax

PIN required

Settings saved

Can be aborted

Response time

Error reference

full

Yes

No

No

-

+CME Error

Description

Transmits to the MT the <command> that shall be sent as it is to the selected UICC. In the same manner the UICC <response> shall be sent back by the MT to the TA as it is.

The command allows a direct control of the currently selected UICC by an application on the TE. The TE shall then take care of processing UICC information within the frame specified by GSM/UMTS networks.

Although the command allows the TE to take control over the UICC-MT interface, there are some functions of the UICC-MT interface that logically do not need to be accessed from outside the TA/MT. Moreover, for security reason the GSM network authentication should not be handled outside the TA/MT.

Syntax

TypeSyntaxResponseExample

Set

AT+CGLA=<sessionid>,<length>,<command>

+CGLA: <length>,<response>

OK

Test

AT+CGLA=?

OK

Defined values

ParameterTypeDescription

<sessionid>

Number

Identifier of the session to be used to send the APDU commands to the UICC. It is mandatory to send the commands to the UICC when targeting applications on the smart card using a logical channel other than the default channel (channel "0").

<length>

Number

Length of the characters that are sent to TE in <command> or <response> (two times the actual length of the command or response)

<command>

String

Command passed on by the MT to the UICC in the format as described in 3GPP TS 31.101 [43] (hexadecimal character format; see +CSCS AT command)

<response>

String

Response to the command passed on by the UICC to the MT in the format as described in 3GPP TS 31.101 [43] (hexadecimal character format; see +CSCS AT command)

SIM states reporting +USIMSTAT

+USIMSTAT

Modules

All products

Attributes

Syntax

PIN required

Settings saved

Can be aborted

Response time

Error reference

partial

No

NVM

No

-

+CME Error

Description

Configures the +UUSIMSTAT URC presentation. Based on the configuration, the URC is able to report the SIM card initialization status, the phonebook initialization status and the REFRESH proactive command execution result.

If <state> 9 and 10 are reported, update all SIM card related parameters cached in the DTE’s application (e.g. the IMSI retrieved with +CIMI command).

Syntax

TypeSyntaxResponseExample

Set

AT+USIMSTAT=<mode>

OK

AT+USIMSTAT=3

OK

Read

AT+USIMSTAT?

+USIMSTAT: <mode>

OK

+USIMSTAT: 3

OK

Test

AT+USIMSTAT=?

+USIMSTAT: (list of supported <mode>s)

OK

+USIMSTAT: (0-7)

OK

URC

+UUSIMSTAT: <state>

+UUSIMSTAT: 8

Defined values

ParameterTypeDescription

<mode>

Number

Bitmask representing which indications the +UUSIMSTAT URC is allowed to report.

See Table 10 for the meaning of each bit. The factory-programmed value is 0.

<state>

Number

Indicates the SIM card initialization status, the phonebook initialization status and the REFRESH proactive command execution result:

  • 0: SIM card not present

  • 1: PIN needed

  • 2: PIN blocked

  • 3: PUK blocked

  • 4: (U)SIM not operational

  • 5: (U)SIM in restricted use (FDN or BDN active)

  • 6: (U)SIM operational (registration may be initiated)

  • 7: SIM phonebook ready to be used (when the SIM application is active)

  • 8: USIM phonebook ready to be used (when the USIM application is active)

  • 9: (U)SIM toolkit REFRESH proactive command successfully concluded

  • 10: (U)SIM toolkit REFRESH proactive command unsuccessfully concluded

  • 11: PPP connection active, (U)SIM toolkit REFRESH proactive command delayed till PPP deactivation

  • 12: voice call active, (U)SIM toolkit REFRESH proactive command delayed till call release

  • 13: CSD call active, (U)SIM toolkit REFRESH proactive command delayed till call release

  • 14: eSIM operational (registration may be initiated)

Allowed values:

  • LEXI-R10401D-00B / LEXI-R10801D-00B - 0, 1, 2, 3, 4, 6, 14

  • LEXI-R10401D-01B / LEXI-R10801D-01B / LEXI-R10001D - 0, 1, 2, 3, 4, 6, 9, 10, 14

Notes

  • <state>=9 and 10 will not be reported when dedicated (+CFUN: 6) or raw (+CFUN: 9) mode is active.

  • Table 10 provides the meaning of each bit with the corresponding state:

    Table 10. <mode> bitmask meaning
    BitStates reported

    0

    Reports the (U)SIM initialization status (<state>'s from 0 to 6 and state 14 may be reported)

    1

    Reports the (U)SIM phonebook initialization status (<state>'s from 7 to 8 may be reported)

    2

    Reports the (U)SIM toolkit REFRESH proactive command execution result (<state>'s from 9 to 13 may be reported)

  • The command setting can be stored in the profiles. Refer to Section B.1 for additional details.

Last updated: Jan 13, 2025
Need help?Contact Support
Questions?Contact us