K64 SmartCard Interface: The error when handling 1 byte response(Procedure Byte)

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

K64 SmartCard Interface: The error when handling 1 byte response(Procedure Byte)

1,402件の閲覧回数
yklee1
Contributor II

Dear Team,

 

One of my customer is developing some product with K64 and SmartCard interface.

But he found some error when handling 1 byte response(Procedure byte) like below.

 

@emvl1_core.c

static smartcard_core_error_t ttl_send_cmd_t0(smartcard_core_params_t *coreParams,

                                              smartcard_ttl_cmd_t *ttlCmd,

                                              smartcard_ttl_resp_t *ttlRespPtr)

{

 

else if (coreParams->Case == kSCCommandCase3)  -> Even case 1 and 2 have a same problem.

    {

        /* send command header */

        send_data(coreParams, header, 5u);

        tc = 0u;

        do

        {

            /* Get procedure/status byte(s) */

            receive_data(coreParams, ttlRespPtr->resp, 2u, &rcvLength); 

            while ((rcvLength == 2u) && (ttlRespPtr->resp[0u] == 0x60u))  -> Actually one PB byte can be received.(please refer to below )

    But at this code if 2 bytes are not received, 1 byte PB is not   proceeded.  So finally system waits until time out.

            {

                ttlRespPtr->resp[0u] = ttlRespPtr->resp[1u];

                rcvLength--;

                if ((ttlRespPtr->resp[0u] == header[1u]) || ((ttlRespPtr->resp[0u] ^ (header[1u])) == 0xFFu))

                {

                    break;

                }

                temp32 = 0u;

                receive_data(coreParams, (ttlRespPtr->resp + 1u), 1u, &temp32);

                rcvLength += temp32;

            }

 

As you can see this driver cannot handle one byte response normally.

Have you ever used SmartCard driver with K64 or another Kinetis chips?

If yes, could you please share your experience?

 

And below is the part of ISO7816 spec.

166470_166470.pngpastedImage_1.png

 

Thanks a lot for your help in advance.

 

Best Regards,

 

YK Lee

ラベル(1)
0 件の賞賛
返信
2 返答(返信)

1,160件の閲覧回数
ivadorazinova
NXP Employee
NXP Employee

Hi YK Lee,

Please, are you trying to implement a generic smart card interface (ISO-7816)? Or do you have a point-of-sale system where they actually need EMV? We do have a newer version of the EMV level 1 code and a lot of software components available as part of our POS solutions.

 

However, that is focused on EMV, and even the code they are attempting to use now is EMV targeted. So if you are trying to use that code for a standard 7816 smartcard, then that is probably the reason for the issue. If you want standard smartcard (non-EMV), then you should be using the KSDK driver as opposed to the EMV middleware. 

I hope this helps.

Best Regards,

Iva

0 件の賞賛
返信

1,160件の閲覧回数
ivadorazinova
NXP Employee
NXP Employee

Hi YK Lee,

Thank you for your question.

We will let you know as soon as possible.

Best Regards,

Iva

0 件の賞賛
返信