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

STM32F4 USBD keyboard problem with USB_CM3_L.lib

Hi,

I work with STM32F4LP5 chip and Keil USB device stack.

I configure USB-HID with HID_REPORT_DESCRITOR to 63 and a specific descriptor as follow :

#define KBD_REPORT_DESC_SIZE                                           63U
const uint8_t usbd_hid0_report_descriptor[KBD_REPORT_DESC_SIZE] =
{
0x05, 0x01, // Usage Page (Generic Desktop),
0x09, 0x06, // Usage (Keyboard),
0xA1, 0x01, // Collection (Application),
0x75, 0x01, // Report Size (1),
0x95, 0x08, // Report Count (8),
0x05, 0x07, // Usage Page (Key Codes),
0x19, 0xE0, // Usage Minimum (224),
0x29, 0xE7, // Usage Maximum (231),
0x15, 0x00, // Logical Minimum (0),
0x25, 0x01, // Logical Maximum (1),
0x81, 0x02, // Input (Data, Variable, Absolute),
//;Modifier byte
0x95, 0x01, // Report Count (1),
0x75, 0x08, // Report Size (8),
0x81, 0x03, // Input (Constant),
//;Reserved byte
0x95, 0x05, // Report Count (5),
0x75, 0x01, // Report Size (1),
0x05, 0x08, // Usage Page (LEDs),
0x19, 0x01, // Usage Minimum (1),
0x29, 0x05, // Usage Maximum (5),
0x91, 0x02, // Output (Data, Variable, Absolute),
//;LED report
0x95, 0x01, // Report Count (1),
0x75, 0x03, // Report Size (3),
0x91, 0x03, // Output (Constant), ;LED report?
// padding
0x95, 0x06, //................// Report Count (6),
0x75, 0x08, // Report Size (8),
0x15, 0x00, // Logical Minimum (0),
0x25, 0x68, // Logical Maximum(104),
0x05, 0x07, // Usage Page (Key Codes),
0x19, 0x00, // Usage Minimum (0),
0x29, 0x68, // Usage Maximum (104),
0x81, 0x00, // Input (Data, Array),
0xc0 // End Collection
};

In main, i do USB initialization layer :

    USBD_Initialize (0);       // USB Device 0 Initialization
    USBD_Connect    (0);       // USB Device 0 Connect  

PC HOST view and is ok to mangage keyboard USB-HID : Ok

Then the first call to USBD_HID_GetReportTrigger() function works fine and send a correct 8 bytes flow  to HOST (pc) :

USBD_HID_GetReportTrigger(0, 0, (uint8_t *)&keyBoardHIDsub, sizeof(keyBoardHIDsub) );

But STM32 won't send 8 bytes to release the key and send only one 0 byte over USB link and HOST repeat the key in loop.

The second call to USBD_HID_GetReportTrigger give 0x23 error : usbDriverBusy

Why ?

Regards,

G.Grange