HID mouse doesn't move
We are trying to move the mouse cursor using HID.
However, the mouse cursor does not move even though it is USBD_OK in the USBD_HID_SendReport.
Why doesn't it work?
[IDE]STM32CubeIDE 1.14.0
Connectivity -> USB_OTG_FS -> [Mode]Device_Only
Middleware -> USB_DEVICE -> [Class For FS IP]HID
[board] NUCLEO-F446RE
[Our code]
typedef struct
{
int8_t buttons;
int8_t x;
int8_t y;
int8_t wheel;
} Mouse;
Mouse mouse_status = {0};
uint32_t before_time[sizeof(Mouse) / sizeof(int8_t)] = {0};
extern USBD_HandleTypeDef hUsbDeviceFS;
int main(void)
{
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* Configure the system clock */
SystemClock_Config();
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_USART2_UART_Init();
MX_USB_DEVICE_Init();
USBD_HID.Init(&hUsbDeviceFS,0);
/* Infinite loop */
while (1)
{
//送信
mouse_status.x = 1;
USBD_HID_SendReport(&hUsbDeviceFS, (uint8_t *)&mouse_status, sizeof(Mouse));
HAL_Delay(1000);
}
(Edited to format the code)


