スマートカードと通信するためのリーダーとして stm32f103 と st8024 を使用しています。私の問題は、ATR を取得した後、応答が得られないことです。
HAL_SMARTCARD_Receive(&hsc1 , response1 , sizeof(response1) , 1000);
上記の関数は、どのコマンドに対しても常に TIMEOUT を返します。response1には何も入れません。
以下は私のコードです:
uint8_t command1[] = {0xC0 , 0x20 , 0 , 1 , 8 , 0x30 , 0x30 , 0x30 , 0x30 , 0x30 , 0x30 , 0x30 , 0x30 , 0};
uint8_t response1[20];
HAL_SMARTCARD_Transmit(&hsc1 , command1 , sizeof(command1),1000);
HAL_Delay(100);
HAL_SMARTCARD_Receive(&hsc1 , response1 , sizeof(response1) , 1000);