Live data from Hacker News

STM32 Blue Pill as an Hid USB Keyboard

instructables.com

11–20 of 34 posts

Re: STM32 Blue Pill as an Hid USB Keyboard

#11
post #2

The F103 microcontroller on the blue pill is the epicenter of price hiking during the semiconductor shortage. I've seen prices upwards of 35 USD for each chip. It was more expensive to get one of these chip than to get a Raspberry Pi. I think it is better to use the Nucleo series of evaluation boards from ST now as they have first party support from ST.

Jeez, I paid 1/3 of that for my black pills, and they're objectively better in every metric.

Re: STM32 Blue Pill as an Hid USB Keyboard

#13
post #11
post #2

The F103 microcontroller on the blue pill is the epicenter of price hiking during the semiconductor shortage. I've seen prices upwards of 35 USD for each chip. It was more expensive to get one of these chip than to get a Raspberry Pi. I think it is better to use the Nucleo series of evaluation boards from ST now as they have first party support from ST.

Jeez, I paid 1/3 of that for my black pills, and they're objectively better in every metric.

Those jumped up in price about the same time. Hell, I saw fly by night operations buying up black pill boards just to pull the SoCs off to sell as sketch second sourced chips.

Re: STM32 Blue Pill as an Hid USB Keyboard

#14
post #2

The F103 microcontroller on the blue pill is the epicenter of price hiking during the semiconductor shortage. I've seen prices upwards of 35 USD for each chip. It was more expensive to get one of these chip than to get a Raspberry Pi. I think it is better to use the Nucleo series of evaluation boards from ST now as they have first party support from ST.

Don't the Pis still go for 100 a pop or has that finally normalized now?

Re: STM32 Blue Pill as an Hid USB Keyboard

#16
post #3

Can someone explain what this is actual for? Is this just a tutorial for creating your own DIY USB client device?

Windows HID interface is very flexible IIRC, and even added I2C support to the HID module or something... in Windows 8 or so? I don't know all the details, but as I understand it, you don't necessarily need a USB License ($5000/year membership fee) to have a microcontroller running USB-HID across Windows. Though I haven't figured out all the details of how all the mechanics work, its still interesting to work through…

Windows will try to use the VendorID/ProductID pair on the device to look up which driver to load, but if there isn't any then a regular USB-HID device will default to using the generic HID driver.

You'd get assigned a VendorID if you have a USB license: That is a USB-IF thing, not a Microsoft thing. Then each licensee gets to assign its own ProductIDs.

There is no authentication in the core USB protocol: A device can declare any VendorID. Major microcontroller board manufacturers such as Sparkfun and PJRC provide specific VendorID/ProductIDs to be used by DIY projects using their boards ... but I've seen some of those being reused by other boards. I have also seen the VendorID 0xf055 used by free open source firmware.

Re: STM32 Blue Pill as an Hid USB Keyboard

#17
post #2

The F103 microcontroller on the blue pill is the epicenter of price hiking during the semiconductor shortage. I've seen prices upwards of 35 USD for each chip. It was more expensive to get one of these chip than to get a Raspberry Pi. I think it is better to use the Nucleo series of evaluation boards from ST now as they have first party support from ST.

Don't the Pis still go for 100 a pop or has that finally normalized now?

I just bought a 4G 4B for $75 Canadian. More expensive than before the pandemic, but not outrageous. Of course, once you add a case, PSU, cables, etc, you are over $100 again.

Re: STM32 Blue Pill as an Hid USB Keyboard

#18
post #3

Can someone explain what this is actual for? Is this just a tutorial for creating your own DIY USB client device?

Blue Pills and Black Pills are popular with the DIY mechanical keyboard crowd as the brains of a keyboard circuit. The Arduino Pro Micro is also popular. I imagine that nowadays people also use the Raspberry Pi RP2040.

The common feature among these boards is that they have relatively full-featured USB client support in hardware. This is different from other hobbyist embedded boards, such as most Arduinos, for example, which have only a USB virtual serial interface via a discrete chip for the purpose of uploading and debugging firmware. So if you can make the board look like a USB keyboard, and it has enough I/O to handle a matrix of keyboard switches, then with the right firmware like QMK, you've got yourself the building blocks of a custom keyboard.

My info is stale as of the start of the pandemic, when I gave up my mechanical-keyboard hobby and pivoted to DSLR-based videoconferencing.

Re: STM32 Blue Pill as an Hid USB Keyboard

#19
post #10
post #4

Earlier quoted context omitted.

One example might be bridging an old dumb keyboard into working as a usb keyboard.

Could it also be used to bridge a BT keyboard to USB for the semi-rare cases where having a wired keyboard is necessary (BIOS access, boot loader, login screen etc.)? I expected this type of product to exist, but couldn't really find a good one after a cursory look.

In principle, yes, but you'd need something additional to act as a Bluetooth host. You'd probably be better off using a part that can do both, like an ESP32.

Re: STM32 Blue Pill as an Hid USB Keyboard

#20
post #10
post #4

Earlier quoted context omitted.

One example might be bridging an old dumb keyboard into working as a usb keyboard.

Could it also be used to bridge a BT keyboard to USB for the semi-rare cases where having a wired keyboard is necessary (BIOS access, boot loader, login screen etc.)? I expected this type of product to exist, but couldn't really find a good one after a cursory look.

I don’t know of an off-the-shelf way to implement what you want. There’s a usb-usb converter in QMK which allows you to add QMK features to any keyboard, but QMK does not have Bluetooth support. ZMK is designed for Bluetooth but doesn’t seem to have anything like QMK’s protocol converters (tho I might have looked in the wrong place).

You might be able to DIY it with a Raspberry Pi Pico W, by gluing together the picow_bt_example_hid_host_demo and tinyusb_dev_hid_multiple_interface examples from https://github.com/raspberrypi/pico-examples

Post reply on HN