cancel
Showing results for 
Search instead for 
Did you mean: 

How to implement a GUI on PC to set application parameters for a STM32 via USB/USART

benjaminbrammer9
Associate II
Posted on December 20, 2016 at 15:02

Hey there!

I wanted to know if someone could help me on building up a GUI on a PC for usage with an STM32F303VET. I am new to this and I am not sure exactly on how to implement that.

So far I am reading the AN4323 on STemWin library, but I am not sure if this is only useful for LCDs on a product and not for GUI usage on a PC.

Basically I want to have a GUI when I connect my STM32F303VET with a host PC via USB and that I can program my application parameters via the GUI on the STM32. I think this might be a combination of a HID or CDC class USB device and the STemWin library. Also it would be nice to have a DFU class implemented, but I don't know if both are possible via one USB-port.

I would be happy if someone could help me with some starting points.

best regards

Benjamin

#cdc #stm32f303 #dfu #usb #gui #hid
8 REPLIES 8
Imen.D
ST Employee
Posted on December 22, 2016 at 14:06

Dear

Brammer.Benjamin

‌,

I Suggest you start with pre-configuredapplications within

http://www.st.com/content/st_com/en/products/embedded-software/mcus-embedded-software/stm32-embedded-software/stm32cube-embedded-software/stm32cubef3.html

package firmware.You may find USB projects in this folder as : STM32Cube_FW_F3_V1.6.0\Projects\STM32303C_EVAL\Applications\USB_Device

You can also get more details on the HID class referring to

http://www.st.com/content/ccc/resource/technical/document/user_manual/b8/5a/28/c2/cf/b6/47/d6/DM00105pdf/files/DM00105pdf/jcr:content/translations/en.DM00105pdf

(STM32Cube USB host library) and UM1734 user manual for more details on how to use the STM32Cube USb device library.

For using DFU on STM32, I recommend you

referring

to this

https://st-videos.s3.amazonaws.com/BOOTLOADER.mp4

andthe

http://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-programmers/stsw-stm32html

'Getting started with DfuSe USB device firmware upgrade STMicroelectronics extension'.

Hope this helps you

Best Regards

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Posted on December 23, 2016 at 15:02

Hey Imen,

thanks for your answer. And concerning the GUI, do you have any ideas?

Benjamin Brammer

Seb
ST Employee
Posted on December 23, 2016 at 18:44

It depends on the GUI user.

The simplest way would be to use Teraterm PC console configured with the right COM port.

This way using USART or USB/VCP can be addressed from the same tool.

If the protocol is simple, just transfer text strings and capture the LF character to process the string.

If you'd like to have a more advanced protocol mixing control and data messages, most connectivity modules (WiFi, Bluetooth, Cellular) use a scheme called 'AT command set' which is basically an escape header...

Developping an application on PC or Phone side would require some skills and maintainance.

Some web browsers support COM port communication (USB) such as Chrome and there is a trend for browsers to have possibility to access USB remote devices from the web page.

Hope this helps!

Posted on January 02, 2017 at 12:46

Hello Seb,

first of all, I wish you a happy new year!

Thanks for your answer. I want a really simple GUI where you only have some buttons to change some basic operation mode, and the possibility to enter numeric values to change a LO frequency given by a PLL which is configured via SPI through the STM32F303VET. Best would be over USB.

Would it be possible to also have a DFU button in the GUI, where the STM32 then resets and uses USB for DFU? That would be perfect. So that the STM32 can change between CDC or HID and DFU via the GUI. I know this will be quite complicated to handle the routines and USB stack initialization on the STM32 but in general this would be possible, or am I wrong?

best regards 

Benjamin

nichtgedacht
Senior
Posted on January 03, 2017 at 22:17

Hi Benjamin,

may be this can inspire you somehow.

https://github.com/nichtgedacht/mini-sys

 

Regards

Dieter

Posted on January 05, 2017 at 11:56

thanks for all the replies!

I definetely have some good starting points now.

best regards

Benjamin

Jnana Panuganti
Associate II
Posted on January 05, 2017 at 13:22

To make your life simpler, for starting you may want to take over a serial COM port from your GUI.

You can use a FTDI cable, suchs as in this link: 

http://www.ftdichip.com/Products/Cables/USBRS232.htm

 

You can then implement the PC side USB device driver, once you have the core GUI software and replace UART with USB communication.

You can implement the GUI in C# or Python. Both of them have built 'device drivers' for talking over serial port.

https://www.youtube.com/watch?v=W4NyevEQnCI

 
Posted on January 05, 2017 at 13:49

thanks. This might be a good idea for usage with a Nucleo-Board. But for my custom board I don't want so much interfaces. Ideally only the USB.