cancel
Showing results for 
Search instead for 
Did you mean: 

HID communication with classic USB library on STM32U5

Simo_Sappo
Associate III

Hi everyone, I am trying to implement HID communication using the classic USB library on the NUCLEO-U5A5ZJ-Q. Until now I tried to follow this tutorial 

https://community.st.com/t5/stm32-mcus/how-to-use-stmicroelectronics-classic-usb-device-middleware-with/ta-p/599274

Sadly, between the H7 and U5 there are a couple of difference and I can't seem to find a way to make use of this tutorial for it.

I tried to implement the HID Device from this git 

https://github.com/STMicroelectronics/stm32u5-classic-coremw-apps/tree/main/Projects/NUCLEO-U575ZI-Q/Applications/USB_Device/HID_Standalone

but I am not able to merge these file within an STM32CubeIDE project and make it work (I didn't even manage to build it).

Before getting into the USBX version of the HID communication I still want to try to implement one without the use of a FreeRTOS, can somebody help me? Maybe if you already followed one of the links you can tell me what extra steps you did to make it work. Thank you in advance!

1 REPLY 1
mhupp
Associate

Hello Simo_Sappo,

you didn't provide much information about the type of your HID project, so I can't offer a concrete way to build your project at the moment. Are you planning a project based on the standard HID class or do you want to develop a custom HID device ?

For start a short step-by-step guide on how to integrate your classic middleware.
Start a new STM32 project and create an empty framework with the Cube IDE.

- File -> New -> STM32 Project
- Enter the Commercial Part Number STM32U575ZIT6Q into the MCU/MPU Selector
- Click on the MCU/MPU list showing the NUCLEO-U575 Board and click Next
- Enter the Project Name and the Project location into the Dialog Box and press Finish
- The IDE should show now the CubeMX view
- Select System Core -> SYS -Timebase Source -> SysTick
- Select -> Connectivity -> USB_OTG_FS --> Mode -> Device Only and NVIC enable Inter
- Select -> RCC -> CRS SYNC -> CRS SYNC Source USB
- Change to the Clock Configuration
- PLL1 Input HSI , PLLM = 1, N = 10, R= 1, Sys Mux to PLL -> HCLK 160MHz
From the previous setting you should see USB Clock = 48MHz
Press save and let the IDE generate the Project Framework, skip the ICACHE for now.
Now you should have the Start FrameWork , Build the Project. -> No Errors

Now copy the legacy Middleware under the Driver directory and press Refresh the project tree. You should see that the middleware becomes part of you project tree.

For the next step you provide some info  what type of HID device you want to build.