cancel
Showing results for 
Search instead for 
Did you mean: 

CCID / STM32WBXX Example

RJARC.1
Associate II

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.

2 REPLIES 2
Remy ISSALYS
ST Employee

Hello,

Unfortunately, there isn't any example on USB CCID device on STM32WB.

Best Regards

RJARC.1
Associate II

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) :

0693W00000UnaWGQAZ.png 

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.