简体   繁体   English

为什么我没有收到SIM(ISO-7816)的回复?

[英]How come I do not recieve a response from the SIM (ISO-7816)?

I've got a sim connected to my microcontroller. 我有一个连接到我的微控制器的SIM卡。 The rst, i/o, and clck pins are wired correctly. rst,i / o和clck引脚正确连接。 There is a hardware UART on my board, but since it is full-duplex and not half, I've jumperd RX/TX together. 板上有一个硬件UART,但是由于它是全双工而不是一半,所以我将RX / TX一起跳了起来。

So far, I toggle RST according to ISO-7816, and my UART buffer fills up with the ATR the sim card responds with. 到目前为止,我根据ISO-7816切换了RST,我的UART缓冲区填充了SIM卡响应的ATR。 Once I've received the ATR, I change the UART to TX mode and send it a PPS. 收到ATR后,我将UART更改为TX模式并发送给PPS。 After sending, I change the UART back to RX only mode. 发送后,我将UART改回“仅接收”模式。 It follows the correct format as stated in ISO-7816, but I do not receive the confirmation bytes from the sim. 它遵循ISO-7816中所述的正确格式,但是我没有从sim收到确认字节。 The confirmation is supposed to be a repeat of the settings I sent. 该确认应该是我发送的设置的重复。

I suppose your problem is of the same origin as I had with gsm modems. 我想您的问题与gsm调制解调器的起源相同。 Sending a command you get an acknowledgement from the device, then send the next command, get ack, etc, etc. Soon or later the device hangs up. 发送命令,您会从设备获得确认,然后发送下一条命令,得到确认等。设备不久或将挂断。

The key is the interpretation of the acknowledgement. 关键是确认的解释。 You may think the acknowledgement means the command is accepted AND executed. 您可能认为确认表示命令已被接受并执行。 However - at least at ALL gsm modems I know - it means no more but the command was accepted and INTERPRETED - but not executed. 但是-至少在我知道的所有gsm调制解调器上-意味着没有更多的意思了,但命令已被接受并已解释-但未执行。 In case of time consuming commands you send your next command during previous command is being executed. 如果是耗时的命令,则在上一条命令执行期间发送下一条命令。 You do it because you may think acknowledgement means the command is done - but it is not true. 之所以这样做,是因为您可能认为确认表示命令已完成-但事实并非如此。 The device may or may not buffering cumulative commands, but soon or later the device runs out of resources and hangs up. 该设备可能会或可能不会缓冲累积的命令,但是设备不久或以后将耗尽资源并挂断。

I have no experience with device you use but the phenomena seems to be the same. 我没有使用过的设备的经验,但现象似乎是相同的。

While I'm not a protocol expert, the most likely cause seems to me, that you send PPS too early- "after sending" can be easily too early on modern microcontrollers. 虽然我不是协议专家,但在我看来,最可能的原因是您发送PPS的时间过早-在现代微控制器上,“发送后”很容易过早。 ISO 7816-3 states, that the guard time applies as usual and the waiting time is 9600 etu's. ISO 7816-3指出,保护时间照常适用,等待时间为9600 etu。 Sending PPS too early means, that the card does not yet listen, which perfectly explains receiving no response at all. 过早发送PPS意味着该卡尚未收听,这完全可以解释为完全没有响应。 Wrong format would cause an error block, which should also be visible on the scope, which supports my assumption. 错误的格式将导致错误块,该错误块在示波器上也应可见,这支持我的假设。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM