Changing HID FriendlyName

Post here first, or if you can't find a relevant section!
X71
Posts: 20
Joined: Wed Oct 26, 2016 11:53 pm

Changing HID FriendlyName

Postby X71 » Tue Jan 03, 2017 2:24 am

Hi All,

Relative newbie here ...

Managed to get my F103VE setup as a game controller as per this thread http://www.stm32duino.com/viewtopic.php?f=48&t=1586&p=21699#p21699

How do I go about changing the controller name from "STM32DUINO" to something else?

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

Re: Changing HID FriendlyName

Postby danieleff » Tue Jan 03, 2017 6:28 am

There is no API for that currently.

You can change the name in system/staticlibstm32f1/source/usbd_desc.c on line `#define USBD_PRODUCT_STRING_FS`
After that, you must run `make` inside system/staticlibstm32f1/build_gcc/

X71
Posts: 20
Joined: Wed Oct 26, 2016 11:53 pm

Re: Changing HID FriendlyName

Postby X71 » Tue Jan 03, 2017 6:53 am

Ah ... Yeah I had already changed the string for USBD_PRODUCT_STRING_FS but every time I uploaded the sketch via the Arduino IDE it remained the same.

So I looked at "Makefile" in "system/staticlibstm32f1/build_gcc/" however it appears to be a batch (.bat) file, there's no "make".

So how does one run "make" - Is this done via command prompt or an IDE?

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

Re: Changing HID FriendlyName

Postby danieleff » Tue Jan 03, 2017 8:27 am

Run in command line.

If you are on linux, it already has make.
If on windows, I used mingw (or msys), rarely use it, and not at home right now, so don't remember. Compiling with makefiles on windows is a pain.

X71
Posts: 20
Joined: Wed Oct 26, 2016 11:53 pm

Re: Changing HID FriendlyName

Postby X71 » Tue Jan 03, 2017 10:28 am

Thanks @danieleff

Yeah I'm running Windows 10, I'll start here http://www.mingw.org/

X71
Posts: 20
Joined: Wed Oct 26, 2016 11:53 pm

Re: Changing HID FriendlyName

Postby X71 » Thu Jan 05, 2017 2:26 am

Ok finally got some time to look into mingw ... this is just a command line compiler correct? So what exactly am I supposed to "make" with the source code - .exe, .dll ?

All I see in /system/staticlibstm32f1/build_gcc/ is more make files, so I don't completely understand what the end result is here.

Is this process to re-build the driver or something that Arduino will use?

Forgive me if these are really stupid questions, I'm very new to all this. I've only written small standalone desktop applications (.exe) and I mostly code in SQL (I know it's a completely different realm to this), but I've never delved into programming hardware like this before.

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

Re: Changing HID FriendlyName

Postby danieleff » Thu Jan 05, 2017 6:10 am

It creates the variant/*/libstm32*.a static library files.
This is to speed up compilation in arduino IDE, so the rarely changing files are precompiled ahead of time.

I do this by installing MinGW (so long time ago), running `<MinGW>\msys\1.0\msys.bat` (this opens a command line), cd into .../system/staticlibstm32f1/build_gcc/ , type make, hit enter. I do not know if there is a better way.

X71
Posts: 20
Joined: Wed Oct 26, 2016 11:53 pm

Re: Changing HID FriendlyName

Postby X71 » Thu Jan 05, 2017 11:28 am

Ok I'll give this a try in the morning, thanks again.

X71
Posts: 20
Joined: Wed Oct 26, 2016 11:53 pm

Re: Changing HID FriendlyName

Postby X71 » Thu Jan 05, 2017 11:03 pm

Cheers @danielff ... It compiled with no errors! My device has been renamed in the "Devices and Printers" section of control panel in Windows, but the Controller is still called "STM32DUINO".

Another question I have is: Are there any limitations I need to cater for since the library is for a C8 but I'm running it on a F103VET6, do I loose access to any features on my board like the number of analogue pins, memory space etc?

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

Re: Changing HID FriendlyName

Postby danieleff » Fri Jan 06, 2017 8:34 am

X71 wrote:Cheers @danielff ... It compiled with no errors! My device has been renamed in the "Devices and Printers" section of control panel in Windows, but the Controller is still called "STM32DUINO".

Probably just windows remembering the name. Try using it on an other computer, or somehow uninstalling from the device manager.
X71 wrote:Another question I have is: Are there any limitations I need to cater for since the library is for a C8 but I'm running it on a F103VET6, do I loose access to any features on my board like the number of analogue pins, memory space etc?

Yes, it will have features of the C8. However it is not hard to create a new F1 board variant, write if you really need the extra pins/memory.


Return to “General discussion”

Who is online

Users browsing this forum: No registered users and 1 guest