cancel
Showing results for 
Search instead for 
Did you mean: 

Newbie looking for help to make a Windows game device

Peirof
Associate II

Hi, its my first post

Let me introduce myself, my name is Manuel, I am from Spain (English is not my native language) and I have joined the forum looking for help.

 

My profile is that of a maker with very little programming experience (an AI maker). AI helped me a lot to make the programs

 

I’m migrating a project from Arduino to an STM32 Blackpill; I managed to get it working on Arduino.

Sim racing pedals

The pedals are a potentiometer (for the accelerator) and a loaded cell (for the brake).

 

Well, what I thought would be the hardest thing to do—getting the STM32 Blackpill to “read” those sensors—I’ve managed to do. I press buttons on the console and see the changes… but what was easy on Arduino—turning it into a game display for Windows—I’m not being able to do on the STM32… the libraries that Gemini recommends are either missing or don’t work…

 

I’m looking for help getting Windows to recognize my STM32 as a gaming device. I thought this part would be easier; the Blackpill model is supposed to communicate well with Windows via USB… but so far I haven’t been able to.

 

Can anyone recommend a resource to help me get Windows to recognize the STM32 Blackpill as a game device? Libraries, tutorials, anything.

 

Thanks in advance.

16 REPLIES 16
FBL
ST Employee

Hi @Peirof & welcome to ST community !

ST resources are dedicated to supporting genuine ST products (not black pill ...) . We are not committed to ensuring that clones/fakes work properly with the firmware we provide.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.




Best regards,
FBL
Ozone
Principal III

> ST resources are dedicated to supporting genuine ST products (not black pill ...) . We are not committed to ensuring that clones/fakes work properly with the firmware we provide.

I would be careful with beating (new) posters with the "fake chip" club over the head before you have any proof.

I have a few Blackpill boards as well, and everything works fine, including debugging with a ST-Link V3MINIE.

Ozone
Principal III

> Can anyone recommend a resource to help me get Windows to recognize the STM32 Blackpill as a game device? Libraries, tutorials, anything.

I think first you need to determine what kind of USB device your game(s) expect as input.
See a list of options e.g. here : https://en.wikipedia.org/wiki/USB#Device_classes
Probably either 00, 03 or 05 ("unspecified", HID or PID).
Then I would look for an appropriate example to use as starting point.
From my (superficial) point of view, the best option would be a device covered by a standard driver, e.g. from Microsoft.You probably would not want to write your own host driver, and get it through the MS signing procedure ...


I am not really experienced with USB stuff, though.

Andrew Neil
Super User

Welcome to the forum.

As you're already familiar with Arduino, note that there is an Arduino core for STM32:

https://www.stm32duino.com/

https://docs.arduino.cc/libraries/stm32duino-examples/

https://github.com/stm32duino

 

As already noted, the Black Pill is not an ST product, and adds a number of unknowns in your path.

 

Therefore, as a newbie, I would strongly suggest that you (at least) start with a genuine ST board; eg, the following have STM32F4s with USB:

NUCLEO-F412ZGNUCLEO-F413ZHNUCLEO-F439ZNUCLEO-F446ZE

via: https://www.st.com/en/evaluation-tools/stm32-nucleo-boards/products.html

These are fully supported by ST, have ready-to-go examples, and come complete with a built-in ST-Link.

 

Also, USB is quite advanced - not really a beginner's project.

It would be best to spend some time on the basics:

https://community.st.com/t5/stm32-mcus-products/for-better-learning-stm32-programming-and-debugging/m-p/719485/highlight/true#M260696

 

Some STM32 learning references:

https://community.st.com/t5/stm32-mcus-products/for-better-learning-stm32-programming-and-debugging/m-p/719468/highlight/true#M260690

 

Good luck!

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.
Vidar
Associate II

What are you trying to achieve exactly? Something local, that only your machine recognises it as a gaming device, or that any machine does it. Also which MCU are you using.

You need us to provide with more infos, also if you will build a client for your machine or not.


@Vidar wrote:

 which MCU are you using.


Black Pills are generally based on STM32F401 or F411, although it does seem that F103 "Black Pills" also exist:

https://stm32-base.org/boards/STM32F103C8T6-Black-Pill.html

 

@Peirof This is another risk with the "Pill" boards - there are many variations, and no guaranteed consistency of supply.

So, if you do use one, please post photos of the one you actually have, and give a link to where you bought it.

How to write your question to maximize your chances to find a solution

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

Werent there issues with blue pill boards a couple of years ago where the specifications of the product sheet didnt match the actual MCU?

 

Anyways, @Peirof you might come to the point where you question your sanity, and in those cases a proper device directly from ST can save you from paranoia that the hardware is faulty (I have been there). They arent that expensive also.


@Vidar wrote:

Werent there issues with blue pill boards a couple of years ago where the specifications of the product sheet didnt match the actual MCU?


Yes - that's what @FBL was getting at.

And this forum is awash with posts by people suffering from fake/clone F103 Blue Pills & ST-Links.

AIUI, the F4-based boards are more likely to be genuine.

 


@Vidar wrote:

a proper device directly from ST can save you from paranoia that the hardware is faulty


Indeed. And they have many other benefits, too - see my earlier post.

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

I have yet to find an STM32F103C binary program not working on a BluePill. I do not say that such programs don't exist, it's just it never happened to me to have a problem with a BluePill other than genuine ST ST-Link not willing to debug the non-genuine MCU sometimes present on BluePill. At the moment I work with 5 F103 BluePills and 3 F401 BlackPills, developing complex firmware with USB, ADC, SPI, UART, IAP Flash programming etc. At least 2 of my F103 BluePills likely have counterfeit MCUs. No problems at all.

I think the more likely causes of problems are illegal Asian ST-Link clones.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice