ST has renamed some key files for this peripheral. Read up on the change in the issue: github.com/prtzl/Embedded_videos/issues/2
@andrefrol4107
3 жыл бұрын
greate work men
@mbl1154
4 ай бұрын
It's a very helpful video. However I am a little confused. What if I want to change the layout via Windows (from german to US/ or UK). I guess that wouldn't work right? And do you have any recommendations or ideas how to implement that?
@ademr9508
3 жыл бұрын
How to make HID Gamepad device ??? Anyone please any tutorial ?
@usmanhaider8634
Жыл бұрын
great work. please make a video on external spi fash.
@amingattout
Жыл бұрын
How the interrupt is actually triggered ? After flashing should we just push a button or is it something else ? Also in Middlewares/ST/STM32_USB_Device_Library/Class/CustomHID/Src/usbd_customhid.c, USB_DESC_TYPE_INTERFACE is set to 4 which is mouse and keyboard. Is it a problem ?
@ilkeraykut7064
2 жыл бұрын
Thx for tutorial. How to make HID Gamepad device ?
@muhammadarsalan3412
Жыл бұрын
Is it possible to implement the led for caps lock num lock and scroll with stm32. If its possible can you guide me how I can do that ?
Жыл бұрын
You will have to take a look into USB HID usage tables and the construction of the report. Here are the links to the standards: www.usb.org/sites/default/files/documents/hid1_11.pdf usb.org/sites/default/files/hut1_4.pdf The report descriptor, that I used in the video was copied from somewhere else and happened to work fine as a keyboard, but it could support much more. The way your usb device sends data, that is interpreted by the host, is by looking at the structure of the report data configured by the report descriptior. In video, the array is called CUSTOM_HID_ReportDesc_FS. The way the report is configured is by composing differrent groups of data together, defining their types, number and sizes. You can read an example in the HID_1.11 specification on page 35 of pdf around a descriptor for a mouse with three buttons. Since there are lots of different buttons to choose from and each only has a byte for an unique ID, the buttons are grouped into pages (usage pages). You can read more on them in the other document. This way a page represents a namespace of keys/functions with common features. Normal keys are in "Generic desktop page (0x01)", buttons are in "Buttons page (0x09) " and LEDs are in "LEDs page (0x08)". You can use the aforementioned example from the document to compose a custom descriptor for keyboard along with the LEDs you wish to control as well. You will need to change some macros, like the report size (it is limited to 64B for USB full speed) and the report that you send. The length of the report (those bytes 0 and 2 that I set in the videos) are just part of the keyboard. Others will be mapped to match the report descriptor. I found this article as well, have a look: eleccelerator.com/tutorial-about-usb-hid-report-descriptors/ This looks like a fun "more in depth" video idea, but I don't have a device handy or time to test it now. Hope this helps for now.
@BEdmonson85
Жыл бұрын
Any ideas in regards to the cpu hanging when sending keyboard data? I've set my code up exactly as it is in the video but every time I try to send anything, it sends the first char and then the cpu crashes and that character gets sent over and over. I even disabled the button interrupt and used gpio polling to get the button press, but it has the same problem. Only difference is I'm using the STM32F411E-DISCO board clocked at 96MHz. If i use the standard HID (not custom) device lib, it works ok. /shrug
Жыл бұрын
Just by that description I cannot think of a reason as to why. Must be either a interrupt or dma problem the way you described it. I would just use a debugger and find the point whete it stops working as expected. Maybe simplify the code even more.
@shilpasonone1584
2 жыл бұрын
Can you please help me to add brightness increment and decrement keys in the keyboard
2 жыл бұрын
Those are either buttons reserved for the keyboard firmware or they can be controlled over usb as well. You'll just have to find the keys that are sent for that action.
@BEdmonson85
Жыл бұрын
When I generate code, I don't get a usbd_hid.h file. The closest thing to that name is a usbd_customhid.h file under STM32_USB_Device_Library directory. Did ST change their library code generation maybe? Or do I have something set up wrong. I'm using STM32CubeIDE Version: 1.10.1. Thanks.
Жыл бұрын
Thank you for pointing it out. I added a link to the issue in the video description and comment as well.
@mbl1154
4 ай бұрын
@ My Inc and Src folder are completly empty... Any ideas??
@dickyfirmansyah996
3 жыл бұрын
Hi Matej, this is a very good guide. But I am having some problem tough. I try using stm32f10c8t6 (Bluepill) connected to an IR proximity sensor as external interrupt, so when the sensor capture an obstacle the mcu would send a character to pc. It work. But, it have a behaviour like we press a key but never release it. I test it using text editor , instead of write 'A' character, it would write 'A' character continously (and never end unles I unplug the Bluepill usb cable). I try debuging the isr callback function, and there is no problem because the interrupt callback is called exactly once on each obstacle. Hope you can have some clue. Thank you
3 жыл бұрын
When you send a key press to the computer, like 'A', you also have to send 0 in order to release the key. Sounds like this is the problem you are describing.
@dickyfirmansyah996
3 жыл бұрын
@ , Yes I also suspect this is the case. I use your library, and in usb_hid_keyboard.c file in line 142, there is already a routine to send release key report.
@dickyfirmansyah996
3 жыл бұрын
When I use USB packet sniffing tool, there is no release key data come from usb. The 'USBD_CUSTOM_HID_SendReport' return function not returning zero when sending release key (seems like USB peripheral is still busy or not ready to send data), so I create a looping to sending release key report again until succes('USBD_CUSTOM_HID_SendReport' return zero), and it work. But this feels like a horrible hack to me :D Maybe it is about timing or for some reason the peripheral still considering the data transfer is not done so the release key data is dropped.
3 жыл бұрын
That solution sounds good enaugh but I feel you. Maybe increase the time after sending a keypress from 15ms to 20. I mentioned that this is the lowest time it was working for me, so maybe try playing with that. Becausw you really need to send release key, that solution for sending data might be an ugly solition, but a necessary one. Just make sure you are not doing too much waiting in something like an interrupt routine, that is bad practise.
3 жыл бұрын
Hmmmm, you said that you used external interrupt to send keyboard data when you sensor released the signal. Usb peripheral also uses interrupt for dealing with usb data. Make sure that your external interrupt priority is lower than usbs. By default usb peripheral interrupt priority is 0, so lower your EXTI interrupt to 1 or lower(higher number). This way usb interrupt can preempt your exti interrupt. I recommend you to watch my new video 34 for more information :)
@xenuz3914
3 жыл бұрын
Can u help me? I cant type on my Pc Nad i see its USB keyboard but idk what is that pls help
3 жыл бұрын
I dont understand you problem. Can you be nore specific? Maybe have a look at my previous video on keyboards where I explain certain parameters more.
@dumdabake3287
3 жыл бұрын
if (pdev->pClassData == NULL) { return (uint8_t)USBD_FAIL; } This is inside USBD_CUSTOM_HID_SendReport(USBD_HandleTypeDef *pdev, uint8_t *report, uint16_t len). My code runs into this error (Runs into exception error because of USBD_FAIL) Did I miss something? I went through the debug process and always saw pdev->pClassData = 0x0.
3 жыл бұрын
Sorry for late reply, didn't see it before. I don't have that much insight into usb driver but I can tell you that I had a problem with usb peripheral when I had another interrupt, i think it was exti one wired to a button and when I pressed the button, sometimes the code would crash. I lowered that interrupt priority level to (at least) one lower than USB's and I didn't have that problem anymore. I think it has to do with the way USB works and its strict timings.
@dumdabake3287
3 жыл бұрын
@ thanks. That and enabling the internal oscillator made it work.
@blackmath72
2 жыл бұрын
@@dumdabake3287 hey, I ran into the same issue. What do you mean by enabling the internal oscillator? Thanks in advance.
@tazoeztm5070
3 жыл бұрын
How can i change keyboard buttons to joystick buttons ? Please answer. I serching for days
3 жыл бұрын
I would suggets you to look up(online) joystick button codes. On linux I can get my input code by using command 'showkey -a' which will display ascii, decimal and hex value for a given key press. you might also have to look into Game Controls Page of the HID usage tables that describes codes for those. Hope this helps.
@tazoeztm5070
3 жыл бұрын
@ thanks. Can you give me tutorial link or website link or the codes ?
@ademr9508
3 жыл бұрын
@@tazoeztm5070 I need this too. Make a tutorial about it please
@andrefrol4107
3 жыл бұрын
Hi. Example not work in WinXP and BIOS. How repair it?
3 жыл бұрын
Maybe the problem is with drivers in old windows, but the microcontroller should present itself as a usb 1.0 hid device, for which it should not need drivers. Have you tried on other computer? If it still doesnt work, maybe the code or the board has a problem.
@andrefrol4107
3 жыл бұрын
the same device has been tested on many computers. also tested several of the devices themselves. On all computers and all devices, everything works fine if the operating system is Win7, 8, 10 but not XP or BIOS.
3 жыл бұрын
That is interesting, I have no idea why would that be, at least XP should support usb 1.1 out of the box, I even found a keil page for stm32 usb hid sample that claimed so.
@issacdelgado3327
3 жыл бұрын
So for my keyboard it usually has a rgb pattern happening and now its frozen and isnt letting me type however my mouse is still working which is plugged into a port on the keyboard any advice?
3 жыл бұрын
I didn't have any problems with any of my computers. I don't have an rgb keyboard, but it does have backlight and some effects (logitech g610). Multiple keyboard should be seen as one input by the operating system, so I don't know why would that happen.
@issacdelgado3327
3 жыл бұрын
@ my computer is detecting 4 HID keyboards in the keyboard tab, however I fixed it by opening it in safe mode
3 жыл бұрын
Interesting. Thank you for sharing. Can you tell me if this problem is on windows, mac or linux?
@issacdelgado3327
3 жыл бұрын
@ windows
@mbl1154
4 ай бұрын
@@issacdelgado3327 Had that problem with my At32u4 based Keyboard. In the end I had to fix the whole USB HID library. Simply redownloaded the library from some website and then reinstalled and rebuilt it. After that it worked fine, but some special keys (shift, cl, enter...) didnt worked.
Пікірлер: 45