STM32Cube generated HID project, could not find hUsbDeviceFS

symptom

In a message to try the main host computer:

Solution

HID STM32 generated in the project, the default is not to hUsbDeviceFS derived usb_device.h need to modify the file, USER CODE BEGIN VARIABLES and USER CODE END VARIABLES between export hUsbDeviceFS variable code:

/* USER CODE BEGIN VARIABLES */
extern USBD_HandleTypeDef hUsbDeviceFS;
/* USER CODE END VARIABLES */

Guess you like

Origin www.cnblogs.com/DragonStart/p/12004286.html