2023-06-26 02:18 AM
Hi All
We are testing the STM32U585 Smart Card mode with clock and trying to connect with external SAM module. We are able to get the USART-ISO7816 frame format from the controller but we are unable to capture the ATR value from the module in a correct manner. From the logic analyzer with the setup connected we are getting correct ATR values but inside the controller the ATR values are in the wrong format. Following is the expected card ATR response:
This waveform is obtained from the card reader connected to the STM32U585 board. and the ATR waveform is the correct format as described in the standards. the same signals we are capturing in the STM32U585 debug mode and getting the data as shown in the below figure.
We have used the Smart Card with card clock mode in STM32 side with the following configuration:
/* USER CODE END USART3_Init 1 */
hsmartcard3.Instance = USART3;
hsmartcard3.Init.BaudRate = 9758;
hsmartcard3.Init.WordLength = SMARTCARD_WORDLENGTH_9B;
hsmartcard3.Init.StopBits = SMARTCARD_STOPBITS_1_5;
hsmartcard3.Init.Parity = SMARTCARD_PARITY_EVEN;
hsmartcard3.Init.Mode = SMARTCARD_MODE_TX_RX;
hsmartcard3.Init.CLKPolarity = SMARTCARD_POLARITY_LOW;
hsmartcard3.Init.CLKPhase = SMARTCARD_PHASE_1EDGE;
hsmartcard3.Init.CLKLastBit = SMARTCARD_LASTBIT_DISABLE;
hsmartcard3.Init.OneBitSampling = SMARTCARD_ONE_BIT_SAMPLE_DISABLE;
hsmartcard3.Init.Prescaler = 22;
hsmartcard3.Init.GuardTime = 0;
hsmartcard3.Init.NACKEnable = SMARTCARD_NACK_DISABLE;
hsmartcard3.Init.TimeOutEnable = SMARTCARD_TIMEOUT_DISABLE;
hsmartcard3.Init.BlockLength = 0;
hsmartcard3.Init.AutoRetryCount = 0;
hsmartcard3.Init.ClockPrescaler = SMARTCARD_PRESCALER_DIV1;
hsmartcard3.AdvancedInit.AdvFeatureInit = SMARTCARD_ADVFEATURE_NO_INIT;
This is the first time we are working with ISO7816 protocol. We need the guidance from the team to find were we went wrong either in the configuration side or in any other side. Awaiting your valuable support in this regard.
Thanks and Regards
Psj
2023-06-28 11:57 PM
2023-06-30 07:19 AM
Hi, there's also the AN4800 and X-CUBE-SMBUS example. It's not directly working with STM32U5, but it should be reasonably easy to port the SW and it may be helpful.
BR,
J
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2023-07-01 05:16 AM
Hello @Bubbles,
I think it is X-CUBE-SMCARD which you are referring to.
Regards,
2023-07-03 01:29 AM
Hello @AdarshTR ,
yes, of course. Thanks.
At least I got the AN number correct.
BR,
J
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.