cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a EF file in SmartCard(GSM File System sample card)?

Wang Zane
Associate
Posted on March 29, 2017 at 16:43

I am trying to create a EF file in SmartCard on STM32F09C-EVAL board.

My code is as follow.

--------------------------------------------------------------------------------------------------------------------------------------------

#define FILE_PARAM_SIZE 16

const uint8_t FILE_PARAM[16] = {0x62, 14, 0x80, 0x01, 0x20, 0x82, 0x01, 0x41, 0x83, 0x02, 0x12, 0x34, 0x85, 0x01, 0x01, 0x00};

      /* Send APDU Command for create file */

      SC_ADPU.Header.CLA = SC_CLA_GSM11;

      SC_ADPU.Header.INS = SC_CREATE_FILE;

      SC_ADPU.Header.P1 = 0x00;

      SC_ADPU.Header.P2 = 0x00;

      SC_ADPU.Body.LC = FILE_PARAM_SIZE;

      for(i = 0; i < SC_ADPU.Body.LC; i++)

      {

        SC_ADPU.Body.Data[i] = FILE_PARAM[i];

      }

      while(i < LC_MAX)

      {    

        SC_ADPU.Body.Data[i++] = 0;

      }

      SC_ADPU.Body.LE = 0;

      SC_Handler(&SCState, &SC_ADPU, &SC_Response);

-----------------------------------------------------------------------------------------------

But I am getting 0x6D00 as response.

What's wrong?

Please help me.

0 REPLIES 0