Results 1 to 9 of 9

Thread: Qt5 & STM32F407 Discovery Board

  1. #1
    Join Date
    Mar 2015
    Posts
    5
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Unhappy Qt5 & STM32F407 Discovery Board

    Hi,
    I would like to know, if someone did a Qt Gui for the discovery STM32F407 Board and can help me. I want to do a USB OTG FS communication between PC and the microcontroller. With Coocox IDE I could build an example to push the blau Botton and activate/disactivate a LED. Now I would like to show it in the GUI, but I don't find an easy example, where I can start to understand how to do it.

    I start with a Qt5 in Windows 8.1. I saw in Internet I have to install for example libus-win32. I could downloaded it, and try to use Zadig to install it, but I do not have the Vendor/Product ID (I found 4 examples with 4 different numbers)..... For this reason I can not install it. That is the first problem. Someone could help me???
    I copied the file libusb0.dll in C:\Windows\System32 and the file libusb0.sys in C:\Windows\System32\drivers.
    Then I try to use an example in Qt C++ with the file usbd_cdc_ucp.c, but the example was not completed and of course I got a lot of errors.

    I only want to understad how I can get a communication between PC (GUI Qt) <-> STM32F4.
    Thank you in advance for your help.
    Regards
    Vero

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qt5 & STM32F407 Discovery Board

    Which programming language did you use before, which libraries did that use?

    Cheers,
    _

  3. #3
    Join Date
    Mar 2015
    Posts
    5
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qt5 & STM32F407 Discovery Board

    Hi anda_skoa,
    I do not understand your question. I am beginner and I do not find some information about it.
    This will be my first project with usb libraries.
    Regards
    Vero

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qt5 & STM32F407 Discovery Board

    You wrote that you already had a working solution using some IDE.

    Depending on what language was used there the same libraries and maybe even code could potentially be used with Qt as well.

    Cheers,
    _

  5. #5
    Join Date
    Mar 2015
    Posts
    5
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qt5 & STM32F407 Discovery Board

    Hi again,
    I programm all in C++. In the Coocox program I use some USB libraries to communicate with the USB. If the PC (through the GUI) send for example 0x33, the orange LED on the Discovery Board switch on/off. The MCU works like a VCP and I tested with Hercules (http://www.hw-group.com/products/hercules/index_es.html) and the serial communication works fine.

    I also could install the libusb-win32 in Windows 8.1. I see my MCU in manager device

    I only need to do the part of the GUI in Qt. I found an example in youtube. The person, who did this example, uses threads and I can not see all the code: https://www.youtube.com/watch?v=EoE8QPeApxk

    Do you know a tutorial about USB communication with libusb-win32 for Qt5, or an small example where I can learn how to do it?
    I want to send for example the 0x33 to activate the led or receive some data for a sensor through the MCU.

    Thank you for your help!!!!

    Cheers
    Vero

  6. #6
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qt5 & STM32F407 Discovery Board

    Why not use the libraries for which you already have a working solution?

    Any specific reason you want to reimplement the USB communication manually?

    Cheers,
    _

  7. #7
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt5 & STM32F407 Discovery Board

    Qt is not a magic - Qt is C++ library. So take Qt and "some USB libraries" and all.

  8. #8
    Join Date
    Mar 2015
    Posts
    5
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Talking Re: Qt5 & STM32F407 Discovery Board

    After 3 weeks reading about USB communication, doing Qt tutorials and understanding some examples with libusb library, I finally got the USB communication PC <-> MCU. In the PC I use Qt to do my GUI and in the MCU (STM32F4) I use Coocox. Qt and Coocox are open source software.

    For the beginners like me, some tips:

    - Qt course from VoidRealms in Youtube: https://youtu.be/6KtOzh0StTc
    He has more than 100 video-tutorials. I learnt a lot with this videos!!!!!

    - Some examples using libusb and Qt (thanks google to help me to translate them):
    1. Japanese tutorial about libusb-win32 and Qt: http://www.cnblogs.com/lknlfy/tag/US...D%A6%E4%B9%A0/
    2. Russian tutorial also about libusb-win32 and Qt. You can download the files and see how they read signals from MCU: http://we.easyelectronics.ru/khomin/...n-proekta.html
    3. Example "STM32 LibUSB & Qt example" in youtube. It is only to understand the concept, but you do not have all the code: https://youtu.be/EoE8QPeApxk
    4. The example from the libusb-win32 library, bulk.c.

    - About USB Theory, there are a lot of information in Internet. My recommendation:
    1. Embedded USB, a brief tutorial: http://www.computer-solutions.co.uk/...b_tutorial.htm
    2. USB made simple: http://www.usbmadesimple.co.uk/
    3. USB in a NutShell: http://www.beyondlogic.org/usbnutshell/usb1.shtml
    4. USB Standard Site: http://www.usb.org/home

    - I've got a couple of books from the library (sorry, in German):
    1 . Messen und Steuern, USB und C++ (with some Qt examples)
    2. USB 2.0, Handbuch für Entwickler.

    Note:
    @anka_skoa. Thanks for your help. The problem was, I did not know, how to implement the libraries with a USB solution. But now I know how to do it. You can close the post.
    @Lesiok , I know Qt is not a magic. I only needed some help to start with it, because I am a beginner not an advanced user like you

    Regards,
    Vero

  9. #9
    Join Date
    Mar 2015
    Posts
    5
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qt5 & STM32F407 Discovery Board

    Hi Lesiok,
    I know Qt is not a magic, but I am a beginner and not an advanced user like you. I only needed some help to understand how Qt is working with the USB libraries.
    Now I got it, after 3 weeks looking for the information in internet, doing some Qt video tutorials and reading some USB communication books.
    I would like to tell you thank you, but you were not helping me.

    USB communication is not easy and there are not a lot of examples for the beginners like me. The USB 2.0 specification has 650 pages!!!!
    There are also not information how to get working the USB libraries inside Qt.

    My recommendations to help someone are:

    - Video-Tutorials in youtube to learn Qt: https://youtu.be/6KtOzh0StTc

    - Examples to work with Qt and libusb (thanks google to help me to translate them!!!):
    1. Japanese tutorial: http://www.cnblogs.com/lknlfy/tag/US...D%A6%E4%B9%A0/
    2. Russian tutorial with Code: http://we.easyelectronics.ru/khomin/...n-proekta.html
    3. Video example STM32, libusb & Qt (it is not complete, because you do not have all the code. But you can have the idea, how is working): https://youtu.be/EoE8QPeApxk

    - Internet USB Information:
    1. USB made simple: http://www.usbmadesimple.co.uk/
    2. Embedded USB - a brief tutorial : http://www.computer-solutions.co.uk/...b_tutorial.htm
    3. USB in a Nutshell: http://www.beyondlogic.org/usbnutshell/usb1.shtml

    - I read some german books about USB:
    1. Messen und Steuern mit USB und C++ (with some Qt examples).
    2. USB 2.0, Handbuch für Entwickler.

    Regards
    Vero

Similar Threads

  1. single board computer embeddede board, mini2440v2, sky2440v2
    By wujianwen in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 2nd November 2016, 07:29
  2. Discovery of printers in the network?
    By surwassu in forum Newbie
    Replies: 27
    Last Post: 27th May 2011, 10:27
  3. Discovery correct Language on all OS
    By patrik08 in forum Qt Programming
    Replies: 5
    Last Post: 25th February 2007, 19:27
  4. QSqlField discovery auto_increment int value
    By patrik08 in forum Qt Programming
    Replies: 6
    Last Post: 3rd December 2006, 11:19

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.