[STM32GENERIC] USB HOST - KEYBOARD INTERFACE STM32F407

Discussions about the STM32generic core
Post Reply
KHODIDAS11
Posts: 6
Joined: Sun Aug 20, 2017 4:35 pm

[STM32GENERIC] USB HOST - KEYBOARD INTERFACE STM32F407

Post by KHODIDAS11 » Sun Aug 20, 2017 4:51 pm

HI,

I have done stm32f407vet with arduino successfully, also done USBserial , and read serial data from usb and transmits to another serial port of boad. Now i want to interface USB keyborad to black stm32f407, and key value is to be transmited serially to pc. Please help

User avatar
RogerClark
Posts: 6917
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: USB KEYBOARD INTERFACE STM32F407 ARDUINO

Post by RogerClark » Sun Aug 20, 2017 9:30 pm

You require USB host functionality.

This is not available in the LibMaple F4 core, but it may be available in the STM's official core.
http://www.githubcom/stm32duino

Even if it's not written yet for that core, you best bet would be write it yourself using the STM official core or the STM32GENERIC core, as both of these use STM's HAL, so you should be able to use example HAL code from elsewhere on the web.

KHODIDAS11
Posts: 6
Joined: Sun Aug 20, 2017 4:35 pm

Re: USB KEYBOARD INTERFACE STM32F407 ARDUINO

Post by KHODIDAS11 » Mon Aug 21, 2017 5:13 am

I am using STM32F407 generic, not Libmapple. If you can help.

User avatar
RogerClark
Posts: 6917
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: USB KEYBOARD INTERFACE STM32F407 ARDUINO

Post by RogerClark » Mon Aug 21, 2017 5:23 am

I've moved the thread to STM32 Generic, as this is now specific to that core.

Perhaps Daniel or one of the other guys using his core can advise on how to approach this

danieleff
Posts: 336
Joined: Thu Sep 01, 2016 8:52 pm
Location: Hungary
Contact:

Re: [STM32GENERIC] USB HOST - KEYBOARD INTERFACE STM32F407

Post by danieleff » Wed Aug 23, 2017 3:22 pm

Sorry but there is currently no USB keyboard functionality in STM32GENERIC.

If anyone cares to implement:
  • The ST low level code has to be put into STM32\cores\arduino\usb\hid from <download ST firmware>\Middlewares\ST\STM32_USB_Device_Library\Class\HID
  • Add descriptors to usbd_desc.c
  • Change usbd_conf_*.c USBD_LL_Init()
  • Add initialization to USBDevice.cpp for HID
  • Implement Keyboard.cpp + Mouse.cpp on top of the lowel level code.
  • Add menu item
  • Anything I forgot
By the way it will still be only keyboard + mouse together, but not composite (cannot use serialusb + hid for example).

Post Reply