smartcard does not get ATR

389 views Asked by At

I am using STM32L053R8 and TDA8034. I can not get the atr, I am using prepared code by given ST Firm and Sodexo card as a smart card. When I debug the code , it stucks here.

/* Read ATR - loop until it's read */
    do
    {
      atr_size = sizeof(atr_buff);
    }
    while (HAL_OK != ATR_Read(&SCInterface, atr_buff, &atr_size));

and when I entered this ATR_Read funtion, I noticed it can't exit here as a return value Hal_OK

     /* read ATR to buffer (ATR must be sent up to 40000 clocks after reset) */
  retval = HAL_SMARTCARD_Receive(hsc, buffer, *buffersize, SC_CWT_TIMEOUT);
#ifdef USART_V0
  *buffersize = *buffersize - hsc->RxXferCount - 1;
#else
  *buffersize = *buffersize - hsc->RxXferCount;
#    endif
  if ((*buffersize >= 2) && (retval == HAL_TIMEOUT))
  {
    retval = HAL_OK;
  }
  return(retval);
}

is there anyone who can help ?

0

There are 0 answers