2022-09-28 07:28 AM
Hi,
I try to implement an USB CCID device on an STM32WB55 MCU and the stm32_mw_usb_device release V2.11.
I do not find any documentation about how to use this implementation...
Today, I created an USB peripheral that is recognised by Windows as CCID device but I do not know what I need to write in the "CCID_Send_Process" function (for example...) from the "usbd_ccid_if_template.c" file.
uint8_t CCID_Send_Process(uint8_t *Command, uint8_t *Data)
{
Command_State_t Command_State = Command_NOT_OK;
/* Initialize ICC APP header */
uint8_t SC_Command[5] = {0};
UNUSED(Data);
UNUSED(Command_State);
UNUSED(SC_Command);
/* Start SC Demo ---------------------------------------------------------*/
switch (Command[1]) /* type of instruction */
{
case SC_ENABLE:
/* Add your code here */
break;
case SC_VERIFY:
/* Add your code here */
break;
case SC_READ_BINARY :
/* Add your code here */
break;
case SC_CHANGE :
/* Add your code here */
break;
default:
break;
}
/* check if Command header is OK */
(void)CCID_Response_Process(); /* Get ICC response */
return ((uint8_t)USBD_OK);
}
Somebody know if there is an exemple to implement an USB CCID device ?
Thank you.
2022-10-07 02:24 AM
Hello,
Unfortunately, there isn't any example on USB CCID device on STM32WB.
Best Regards
2022-10-07 03:30 AM
Hi,
since I wrote this question I have succeeded to create a CCID device. But when i try to send the first frame to the device (frame type : PC to reader ICC power off) i have in response a wrong frame (like an echo) :
I good response should be a RDR_to_PC_SlotStatus frame type according to the CCID standard and the STM implementation.
I have executed step by step the program and all is fine even when i go down in the "USBD_LL_Transmit" function...
Maybe i need to flush somethink before to send a response ?
Thank you.