Custom USB HID Interface using STM32 (stm32f103c8)

preview_player
Показать описание
How to build a Custom USB HID interface on an STM32 (stm32f103c8) and control it using a GUI built with Python and GTK .

Project Code :

Useful links :

Рекомендации по теме
Комментарии
Автор

Thanks for the tutorial! FYI, STM32U575 doesn't come with USB middleware, only HAL. I generated middleware code for a different STM, and copied the files and it worked

eitantal
Автор

Thank you for taking the time to make this. It saved me hours. The USB protocol is very complex and I couldn't find a concise tutorial. I thought I needed to make a custom report descriptor which is a real rabbit hole.. Oussama walked me through how to setup exactly what I was looking for and tied to together information I'd gathered elsewhere. I have solved my current problem and I have better understanding of USB HID protocol and STM32 USB.

RonMoreland
Автор

30:40 Note about the timeout of 100ms: You set the timeout to be the same number as the report interval. The timeout effectively races the interval. In the unlikely event when they align perfectly, you have a race condition. Make the timeout larger - say, 5% so that this race condition will never occur. FYI, USB HID devices self-report what the report interval actually is, in their descriptors

eitantal
Автор

Very nice video, I've been taught not only STM32 Embedded HID interface but also a GTK-based upper software to control via this interface. Thank you

tonyzhang
Автор

25:27 More specifically, linux comes with its own built-in driver for generic HID. you'll find it in /dev/usb/hiddev0 . You're using libusb, so you need to "unseat" the driver that you do not use, so that libusb has access. I don't know of python bindings for said built-in linux driver

eitantal
Автор

Thanks, this is what I was actually looking ! i.e. a code to write from host to device USB. Thanks man!

otenyop
Автор

Thanks for the explanation. This is gold.

fpgamachine
Автор

This is a wonderful video. I know you have not tested it in Windows but when I does not seem to work it still shows up as a Virtual Comm Port just as the NUCLEO board did when it was out of the box. I see no HID.

alexstickel
Автор

Thanks for the video! Ive been exactly looking for something like this. I have some questions: 1. Is it possible to change the hid descriptor so that the stm32 is being recognized as a keyboard? (So the stm32 acts like a keyboard, but you can still control it via a GUI in python for example). 2. Is it also possible to receive data from the stm32? (So for example the GUI in python reads some data from the STM32 over the usb hid interface)

maofpv
Автор

Thanks for your videos! I jumpered my ST-Link V2 and although it's difficult it works like a charm. Enjoyed that video. I'm looking at this HID interface video and I'm wondering if you can describe the tools your using to create the gui etc. Python apparently as well as? Glade maybe? If you could go into some detail about what you're using I would certainly appreciate it. I'm on Mint Mate 20.2 Uma. Thanks in advance Oussama!

johnadcock
Автор

im on windows 10 and get in device manager "unknown USB device (Device descriptor request failed)" any idea in which stage this can fail?

bassamry
Автор

I don't really understand the part where you updated the report descriptor to include an extra byte (12:02) Can you link any documentation on this part please?

samsamm
Автор

Hi, Thank you for such detailed explanation. I'm facing this issue on windows, where the dev.write() method is timing out. Occasionally it has not. Would you have any idea what's happening?

abhishekshankar
Автор

Hello how are you. Excellent video, good explanation. Congratulations. I unfortunately for my application with the Host already developed I can't receive more than 2 payloads by the function -> static int8_t *buffer). Even the link on the STM website similar to your explanation didn't work either. To send payloads from Device to Host works fine, Ok. Could you help me and I thank you in advance.

silvioaugustobortolim
Автор

you are doing great, I am working on my final year project, I want to build a password manager using hid devices . I need guidance like where to start from can you help me?

khalidkhushal
Автор

Hi. Great work, Would you be kind enough to assist me how can i use my esp32 as an HID keyboard device

najamiqbal
Автор

Can this be done with arduino bootloader ? I have stm32 with arduino bootloader and I want to make gampepad.

muhamedtrumic
Автор

I made the same but it gave me "driver error" issue on windows 10.

hoantran
Автор

Great tutorial please can you kindly give me your email i have searched but could not find thanks.

tallabrianmonde