This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Emulate USB Keyboard with MCBSTM32Exl

Hi,

I use the board MCBSTM32Exl (http://www.keil.com/arm/mcbstm32exl/) and i wanna that my Board emulate a USB HID Keyboard (When i use the push-button User, the char 'Q' is send to my PC Host). For this, i studied the STMicroelectronics' library "USB full-speed device library" (www.st.com/.../um0424.zip) and adapted interruptions/GPIOs to use this Flibrary with my Board. Also, my PC recognize the device and i successed send data (I watched with a sniffer).

But, it's not like a keyboard, i tried to change the descriptor but it does'nt work (for exemple, my PC don't recognize the device)...

Have you any idea to help me ?

Regards,
ealary.

Parents
  • 1) Clean up wrong device instance(s) on registry
    On the PC Device Manager, do you see an extra keyboard, made by your device?
    If you wouldn't, unplug your device.
    a) And uninstall all the device instance(s) of VID/PID = 0x0483/0x5750, using USBDeview

    USBDeview
    www.nirsoft.net/.../usb_devices_view.html

    OR
    b) Assign another VID/PID on the device descriptor

    2) Key interrupt
    ST's example sees the User Button on STM3210E-EVAL board which connects to PG8.
    Fortunately, Keil MCBSTM32Exl also has a User Button at PG8.

    To enable interrupt on both edge,

    \STM32_USB-FS-Device_Lib_V3.3.0\Utilities\STM32_EVAL\STM3210E_EVAL\stm3210e_eval.c
    
    void STM_EVAL_PBInit(Button_TypeDef Button, ButtonMode_TypeDef Button_Mode)
    {
      ...
      ...
        if(Button != BUTTON_WAKEUP)
        {
          EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Falling;
    
          if (Button == BUTTON_KEY)                                  // <---  add these two lines
            EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Rising_Falling;
    
        }
    

    OR

    You may poll this User Button in main loop, instead of interrupt
    And put above input reports at the state transition

    Tsuneo

Reply
  • 1) Clean up wrong device instance(s) on registry
    On the PC Device Manager, do you see an extra keyboard, made by your device?
    If you wouldn't, unplug your device.
    a) And uninstall all the device instance(s) of VID/PID = 0x0483/0x5750, using USBDeview

    USBDeview
    www.nirsoft.net/.../usb_devices_view.html

    OR
    b) Assign another VID/PID on the device descriptor

    2) Key interrupt
    ST's example sees the User Button on STM3210E-EVAL board which connects to PG8.
    Fortunately, Keil MCBSTM32Exl also has a User Button at PG8.

    To enable interrupt on both edge,

    \STM32_USB-FS-Device_Lib_V3.3.0\Utilities\STM32_EVAL\STM3210E_EVAL\stm3210e_eval.c
    
    void STM_EVAL_PBInit(Button_TypeDef Button, ButtonMode_TypeDef Button_Mode)
    {
      ...
      ...
        if(Button != BUTTON_WAKEUP)
        {
          EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Falling;
    
          if (Button == BUTTON_KEY)                                  // <---  add these two lines
            EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Rising_Falling;
    
        }
    

    OR

    You may poll this User Button in main loop, instead of interrupt
    And put above input reports at the state transition

    Tsuneo

Children