I use the CCID driver for STM32F072RB, converted to the Hal library.

There was a need to make a multi-slot Smart Card Reader (specifically - there will be 3 slots for smart card). In the process, I would like to be able to dynamically switch between them. And that's the main thing.

In the "usbd_ccid_core file.c" there is a set of bytes of the General information of the reader USBD_CCID_CfgDesc[SMARTCARD_SIZ_CONFIG_DESC] (line 82). It has the property "bMaxSlotIndex :highest available slot on this device", which I set to two (bMaxSlotIndex = 0x02).Also, in the file usbd_ccid_cmd.c (line 939) is the RDR_to_PC_NotifySlotChange method. The description of the CCID Protocol specifies that the response to the "RDR_to_PC_NotifySlotChange" command that this method sends a response to should be the number of slot States (https://www.usb.org/sites/default/files/DWG_Smart-Card_CCID_Rev110.pdf page. 56).I forcibly send the answer allegedly Card Reader has 3 slots and in each card is inserted (I send in the answer number 63).

But windows still shows me one map and not even sends requests for the remaining indices of the slots (and the pcsc program that I could find).

I suggested that usually multiloculate Smart Card Reader display underneath each slot is a separate friendly name. And that's where I shut up.

I can not understand how it is possible to implement, knocking his forehead against the wall for the third day, no progress.

I work with smart card directly through the controller. Everything works fine. You only need to display multiple slots in the system.

The project itself

UPDATE Digging on the Internet came across such a thing as a composite USB device. Now the main problem is processing and sending requests. The system displays 3 card reader stm32 receives requests, sends the response to the ATR, but on the PC side, the answer is not accepted (the interrupt handler USB left untouched virgin, one to one as in the project example).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.