Use STM32 as a KEYBOARD || F103C8 || USB Device HID

แชร์
ฝัง
  • เผยแพร่เมื่อ 13 ก.ค. 2024
  • Purchase the Products shown in this video from :: controllerstech.store
    ________________________________________________________________________________________
    00:00 ----- Introduction
    06:30 ----- Basic Keyboard
    11:56 ----- Keypad as a Keyboard
    Download the keyboard Descriptor ::: controllerstech.com/wp-conten...
    Download the PDF ::: controllerstech.com/wp-conten...
    Download the code ::: controllerstech.com/how-to-us...
    Check out more VIDEO on USB with STM32 • STM32 USB
    ________________________________________________________________________________________
    ****** SUPPORT US BY DONATING*****
    paypal.me/controllertech
    ******Join the Membership******
    / @controllerstech
    Join the Discord Server / discord
    Join the Telegram Group t.me/controllerstechdiscuss
    Follow me on Instagram / controllerstech
    For more info, visit www.controllerstech.com
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 89

  • @tanuttreratanakulwong823
    @tanuttreratanakulwong823 2 ปีที่แล้ว +4

    Thanks for a wonderful tutorial. Very concise and easy to understand.

  • @ranger81de
    @ranger81de 3 ปีที่แล้ว +5

    Thank you very much, really great tutorials and nice website with code samples and snippets. Greatly appreciated!

  • @TuanNguyen-pd5yo
    @TuanNguyen-pd5yo 3 ปีที่แล้ว +2

    You did a perfect tutorial, I finish my project by follow your guide, thank you very much! Love from Vietnam

  • @Broman3100
    @Broman3100 3 ปีที่แล้ว +1

    Very helpful video, and very helpful channel, it seems wherever I'm stuck on something I can find it here :)

  • @andresfelipe6085
    @andresfelipe6085 3 ปีที่แล้ว

    amazing, thank you for all of your greatest videos

  • @deadall127
    @deadall127 3 ปีที่แล้ว +2

    awesome, everything is very clear, thanks a lot 👍

  • @noweare1
    @noweare1 3 ปีที่แล้ว

    Very useful. I put it on my to-do list.

  • @Tims_Projects
    @Tims_Projects 7 หลายเดือนก่อน

    An exhalent video, thank you.

  • @kagekiyo7772
    @kagekiyo7772 3 ปีที่แล้ว

    Now it works as keybord thanks to this video.

  • @malkin_laboratory4692
    @malkin_laboratory4692 2 ปีที่แล้ว

    Great video, everything works! I've made joystick for Dendy simulator. I also use usblc6 for usb protection

  • @Jack-pi8ur
    @Jack-pi8ur 2 ปีที่แล้ว

    Thanks, this works on my nucleo F401RE board. As nucleo board has no USB port for USB device , I have to connect USB D-(DM) to PA11 and D+(DP) to PA12 .

  • @sofisma-electronicsforever3471
    @sofisma-electronicsforever3471 3 ปีที่แล้ว

    Great job

  • @Gratiman
    @Gratiman ปีที่แล้ว

    Eres el mejor, Dios te remil bendiga.

  • @petercheung63
    @petercheung63 ปีที่แล้ว

    thank you hero

  • @a.a.patrick
    @a.a.patrick 3 ปีที่แล้ว +1

    Really simplified. Thanks.
    Will this also work for GUI and STM32? If no,
    How can I interface the STM32 USB to custom GUI to control maybe d.c?

  • @unomasenelmar
    @unomasenelmar 3 ปีที่แล้ว +1

    Powerfull tools. Please teach USB OTG camera in mode host attach in stm32 thanks

  • @troelssudergaard807
    @troelssudergaard807 2 ปีที่แล้ว

    Hallo great video, do you know if it possaible to use the USB device HID for mouse inputs and keyboard inputs at the same time?

  • @fazalrehman4382
    @fazalrehman4382 2 ปีที่แล้ว

    This video is informative, Thank you . i have one question how can i make stm32l432 microcontroller that support the matrix keyboard (3*4) and sends information read from keyboard to the computer? can you guide and help me

  • @botak333
    @botak333 10 หลายเดือนก่อน +2

    Hi bro, how to use this HID for control game?? I want to used for DIY steering wheel

  • @zz3709
    @zz3709 ปีที่แล้ว +1

    @~3:07: Wouldn't you need to change the HID_EPIN_SIZE (from 4) to 8? ...since the keyboard report struct is 8 bytes?

  • @jetraid
    @jetraid 3 ปีที่แล้ว +1

    Awesome as ever, I learn a lot with your videos. Theres a way to make a multiple HID descriptor, Windows have 32 buttons joystick limitation and y need more than that, could be posible with 1 STM shown as 2 or more joysticks?

    • @68HC060
      @68HC060 3 ปีที่แล้ว +1

      I think the way you could do this, is to open more endpoints.
      For instance, one microcontroller using one USB connection may show up as a HID device on one set of endpoints, while the same microcontroller on the same USB connection may show up as a storage device on another set of endpoints.
      You should be able to make several sets of endpoints, so you should be able to have several joysticks.
      Please don't ask me how to do this, because I've never done it myself; I've only seen such things implemented by others.
      Note: ST-Link v2 and later show up as storage device while it's also a 'programming adapter' that works with for instance OpenOCD - some programming adapters work both as programming adapters and USB-to-UART adapters.

  • @Nicolas__08
    @Nicolas__08 ปีที่แล้ว +2

    Hello Sir, Thank you for this excellent video. But I still need your help a bit. I have a problem when I connect the card to the PC. I get the message Unknown USB device(Device Descriptor Request Failed) . What should I do to solve this problem?

  • @usmanhaider7238
    @usmanhaider7238 ปีที่แล้ว

    1- How to press multimedia keys?
    2- Some keys are not working like 0x67 (Keypad =) and multimedia keys?
    Great work. 👍👍

    • @m1geo
      @m1geo ปีที่แล้ว

      Did you solve this? I wanted to make an STM32 that would next/previous track, and control volume?

  • @lukaszM46
    @lukaszM46 2 ปีที่แล้ว

    does it matter if i use F103C8T6 or F103C6T6? will the programming steps be the same?

  • @iliazark1
    @iliazark1 3 ปีที่แล้ว

    Letters worked fine for me... But the media keys don't (volume up/dpwn, next/previous track etc.)... With a little research I found that I need to include this functionality to the device descriptor, but everything I've tried so far (either making my own or finding online a premade descriptor), either does not work or leads to a "driver error" on the host machine... Could you make a video on how to make your own descriptor and implement it in a simple project like the one in this video?

  • @undefined365
    @undefined365 5 หลายเดือนก่อน

    Just wants to know can I make full size keyboard by this chip?

  • @jesustecnoman2514
    @jesustecnoman2514 8 หลายเดือนก่อน

    can you to do a joystick hid usb for pc? thank you!!

  • @sezerkaya3573
    @sezerkaya3573 ปีที่แล้ว

    thanks for video but
    ı have a problem with keyboard hid. ı did remote control with stm32 transceiver nrf24. my problems that receiver true receiving incoming data but too much text. problems that

  • @v24blog46
    @v24blog46 4 หลายเดือนก่อน

    how to receiver data this project thanks.

  • @alibarakat1056
    @alibarakat1056 3 ปีที่แล้ว +1

    can you link a joystick hid descriptor? or a link for it ? also if mouse in the FS array is 0x02 and keyboard is 0x01, what is the hex number related to joystick ?
    thanks

    • @ControllersTech
      @ControllersTech  3 ปีที่แล้ว +1

      here you go
      controllerstech.com/wp-content/uploads/2020/09/joystk.h
      I think you need to use custom HID for joystick.

  • @arjun64461
    @arjun64461 3 ปีที่แล้ว

    Nice video. Is it possible to make one for lcd menu selection with up down left right using keypad and 20x4 lcd display? please

    • @ControllersTech
      @ControllersTech  3 ปีที่แล้ว

      I'll try that.. but i am planning it with nokia lcd.. maybe you can use the same logic for the 20x4

    • @arjun64461
      @arjun64461 3 ปีที่แล้ว

      @@ControllersTech yeah ok. atleast if i can get the necessary functions and all required then i can give it a shot. Can you please tell me when you will be planning to release that?

    • @ControllersTech
      @ControllersTech  3 ปีที่แล้ว

      I haven't even started working on it yet. Ao it will take some time..

  • @moazabdeljalil
    @moazabdeljalil 2 หลายเดือนก่อน

    Is it possible to make it as a Gamepad?

  • @meghakajave9463
    @meghakajave9463 11 หลายเดือนก่อน

    I found issue with this code is that even I restricted to send key data for 10 times in while loop,it continues sending keydata indefinitely.

  • @koobine
    @koobine 2 ปีที่แล้ว

    hi, not sure if you're still answering but would this work for a F401RE board? i followed your tutorial exactly, except for some small differences in the initial clock setup. however, when i flashed the code to the board, it does not seem to get recognized as a usb device, nor does it print anything to the computer. any insight on the matter? thanks!

    • @ControllersTech
      @ControllersTech  2 ปีที่แล้ว

      All the USB related videos needs user USB port. The nucleo f401 comes with 1 USB port by default and that's for the ST link.
      If you want to use the USB, you need to solder a new port to your board. You can see towards the bottom, there is space given to connect it.

    • @matanjagiz4248
      @matanjagiz4248 2 ปีที่แล้ว

      resistors on usb data lines, and no 63, but 61 in constant

  • @user-rz5zv9ue1s
    @user-rz5zv9ue1s ปีที่แล้ว

    я не программист)) у меня вопрос такой: можно ли скачать ваш код и просто изменит некоторые данные и просто вставит? и чудо у меня свой клавиатура?

  • @ThaoNguyen-mt4qg
    @ThaoNguyen-mt4qg ปีที่แล้ว

    Can the stm32F103 c6c6 kit be used?

  • @korotkevichov
    @korotkevichov 3 ปีที่แล้ว

    Медиа как сделать? Тут нехватка библиотек под это.

  • @utsavsuha
    @utsavsuha ปีที่แล้ว

    Hello , my code is not running as yours, the key is getting typed continuously without any delay. Can you please guide?

    • @Hobarubi
      @Hobarubi ปีที่แล้ว

      Please check "define HID_EPIN_SIZE 0x04" in usbd_hid.h It has to be at least more than 8. I set it to 0x40 (64) which worked fine for me. Before the change I had the same behaviour as you described.

  • @abulqosimmuhiddinov7204
    @abulqosimmuhiddinov7204 3 ปีที่แล้ว +1

    I have a problem :).
    change HID_MOUSE_ReportDesc to Descriptor
    but I can't use; because Windows 10 STM32 Human Interface driver error!

    • @ControllersTech
      @ControllersTech  3 ปีที่แล้ว

      Try with another usb.. or keep trying by unplug and plug back..

    • @pearl1353
      @pearl1353 3 ปีที่แล้ว +3

      i've got the same issue :( the cable is fine

  • @user-bv8iq8rc9j
    @user-bv8iq8rc9j 3 ปีที่แล้ว

    Sir, I have two errors on the lines of "USBD_HID_SendReport(&hUsbDeviceFS, &keyboardhid, sizeof(keyboardhid)); ". It says that "../Core/Src/main.c(163): error: #167: argument of type "keyboardHID *" is incompatible with parameter of type "uint8_t *" USBD_HID_SendReport(&hUsbDeviceFS, &keyboardhid, sizeof(keyboardhid)); ". Can you help me please?

    • @ControllersTech
      @ControllersTech  3 ปีที่แล้ว

      Check the other comments. I have answered it
      First try typecast (uint8_t *) &keyboardhid
      If doesn't work then do that another solution

  • @deadall127
    @deadall127 3 ปีที่แล้ว

    any hint about how to get the led indicator status?

    • @ControllersTech
      @ControllersTech  3 ปีที่แล้ว

      Led indicator for ?

    • @deadall127
      @deadall127 3 ปีที่แล้ว

      @@ControllersTech in the keyboard hid, you know the caps lock, num lock and scroll lock. if I'm not mistaken it's an out endpoint that we need to listen to, but I'm not sure how to do that (or even if it's doable) with that usbd library.
      I managed to send keystrokes with my stm32f072 tho, it's amazing ^^

    • @ControllersTech
      @ControllersTech  3 ปีที่แล้ว

      Well i don't know about it but you can check out that pdf, if any combination gives you the caps lock and all

  • @vinaysidawadkar3511
    @vinaysidawadkar3511 ปีที่แล้ว

    My HID keyboard is not detecting on pc. I tried everything wat u shown.

    • @ControllersTech
      @ControllersTech  ปีที่แล้ว +2

      Make sure the USB cable supports data transfer.

  • @user-bv8iq8rc9j
    @user-bv8iq8rc9j 3 ปีที่แล้ว +2

    1 Dislike from a Keyboard Manufacturer :D

  • @cyhill86
    @cyhill86 3 ปีที่แล้ว +2

    STM CubeIDE says that i am not connect ST-Link...

  • @PungKitchen
    @PungKitchen 3 ปีที่แล้ว

    It posible to control wheel sir?

    • @ControllersTech
      @ControllersTech  3 ปีที่แล้ว +1

      Wheel is in the mouse applications..
      Yes we can use the wheel.. check out that video

    • @PungKitchen
      @PungKitchen 3 ปีที่แล้ว

      @@ControllersTech okee sir, some wheel with GUI software to calibrate the wheel, its include hire??

    • @ControllersTech
      @ControllersTech  3 ปีที่แล้ว +1

      There is no gui software.. you can calibrate using the code itself..

    • @PungKitchen
      @PungKitchen 3 ปีที่แล้ว

      @@ControllersTech it is posible read potensiometer?

    • @ControllersTech
      @ControllersTech  3 ปีที่แล้ว +1

      Are you trying to use potentiometer as the wheel ?

  • @naredelectronics576
    @naredelectronics576 3 ปีที่แล้ว

    I got these two errors. How can I solve that?
    ../Src/main.c(119): error: #167: argument of type "keyboardHID *" is incompatible with parameter of type "uint8_t *"
    USBD_HID_SendReport(&hUsbDeviceFS,&keyboardhid,sizeof(keyboardhid));
    ../Src/main.c(122): error: #167: argument of type "keyboardHID *" is incompatible with parameter of type "uint8_t *"
    USBD_HID_SendReport(&hUsbDeviceFS,&keyboardhid,sizeof(keyboardhid));
    ../Src/main.c: 0 warnings, 2 errors

    • @ControllersTech
      @ControllersTech  3 ปีที่แล้ว

      make an array for the keyboard values
      uint8_t keyboardHid[8] = {0,0,0,0,0,0,0,0};
      and update the values just like i did in the structure, but use keyboardHID[0], or [1], or [2] for the modifier, reserved, keycode1, etc

  • @majinkeyboards
    @majinkeyboards 3 ปีที่แล้ว

    ahh man this is not in arduino ide.. I wish you could make an ino file. I already flashed my stm to work with windows usb.

    • @ControllersTech
      @ControllersTech  3 ปีที่แล้ว +1

      Neeever gonna happen.. 😏

    • @majinkeyboards
      @majinkeyboards 3 ปีที่แล้ว

      @@ControllersTech I guess I will just Learn the C language then

    • @ControllersTech
      @ControllersTech  3 ปีที่แล้ว

      You can do Arduino without learning C ?

    • @majinkeyboards
      @majinkeyboards 3 ปีที่แล้ว

      @@ControllersTech I have been using the Arduino IDE only bro. If that IDE uses C then yes.

  • @brianblasius
    @brianblasius 2 ปีที่แล้ว

    Hello. I tried using your code on my stm32f1 bluepill but there's still the "unknown USB device (Device descriptor Request Failed)" warning. How can I solve this issue and get the device recognized?

    • @ControllersTech
      @ControllersTech  2 ปีที่แล้ว +1

      What windows are you running ?

    • @brianblasius
      @brianblasius 2 ปีที่แล้ว

      @@ControllersTech Thanks for your quick reply, I'm using windows 10

    • @ControllersTech
      @ControllersTech  2 ปีที่แล้ว +1

      I didn't had any problems with win 10. Try to run the code first and then connect with the computer. Check the device manager also, could be an issue with windows device signature verification.

    • @brianblasius
      @brianblasius 2 ปีที่แล้ว +1

      @@ControllersTech I have tried this but not working. I tried a new bluepill board, a different port, a different usb cable, a different laptop but still not working. This is so strange!

    • @matanjagiz4248
      @matanjagiz4248 2 ปีที่แล้ว +1

      @@ControllersTech i got the same problem...