cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F3 Discovery USB driver in Windows

nygaard
Associate II
Posted on January 21, 2014 at 14:54

Hi,

I am playing around with STM32F3 Discovery and have finally got everything up and running in Eclipse wiht arm plugin and everything. BUT the user USB annoys me. I am aware that many others have have asked for something similar, but since I was not satisfied with any anwser I could find on this thing called the Internet. I will try to explain the problem again and hopefully meet an expert here.

Basically everything is set up like in the ST-Demo example. I have just added som USB-stuf and state like:

 while (UserButtonPressed == 0x03) {

    STM_EVAL_LEDOn(LED5);

    if (bDeviceState == CONFIGURED) {

    STM_EVAL_LEDOn(LED6);

    CDC_Receive_DATA();

    /* Check to see if we have data yet */

    if (Receive_length  != 0)

    {

    STM_EVAL_LEDOn(LED3);

    int i;

    for (i = 0; i < Receive_length; i++) {

    localBuffer[i] = Receive_Buffer[i];

    }

    CDC_Send_DATA(localBuffer, Receive_length);

    Receive_length = 0;

    }

    }

    }

In Windows 7 (have tried it on Win 7 Enterprise x64 and Pro x64) the device gets recognized as a STM32 Virtual COM Port, which should be okay. But there is no drivers for this thing?! And yeees, I have installed the drivers from: http://www.st.com/web/en/catalog/tools/PF257938

But it seems to have no effect. The simple ''LED-handshake-indicator'' - yes, I call it that :-)

Shows that the device never gets configured.

The story is different if I plug it in a Linux computer. Now the device gets recognized as a SGS Thomson Microelectronics joystick - WTF?! But now the device gets configured and starts to receive data... But still... it is seen as a joystick?! And I would like the windows driver to work. Why isn't there a way just to download the *.inf and possible *.dlls for this device from STs site?!

What is wrong here?!?

Please help...

Kind regards,

Michael

#vcp #stm32 #usb #discovery #usart #stm32
9 REPLIES 9
chen
Associate II
Posted on January 21, 2014 at 15:12

Hi

''The story is different if I plug it in a Linux computer. Now the device gets recognized as a SGS Thomson Microelectronics joystick - WTF?''

That means the host has recognised it as a Human Interface Device (HID). This is not a Communications Device Class (CDC) - CDC is what is used for the VCP.

''And I would like the windows driver to work. Why isn't there a way just to download the *.inf and possible *.dlls for this device from STs site?!''

I believe that when working as a joystick - it relies on the built in HID driver from MS.

''In Windows 7 (have tried it on Win 7 Enterprise x64 and Pro x64) the device gets recognized as a STM32 Virtual COM Port,''

I have had the STM32F4_Discovery demo working as HID and CDC on Windows7 with  no problems.

''Basically everything is set up like in the ST-Demo example. I have just added som USB-stuf and state like: .....''

Does it work as the original demo?

nygaard
Associate II
Posted on January 21, 2014 at 15:28

Se response in text below after each ->

chen
Associate II
Posted on January 21, 2014 at 15:40

''

Does it work as the original demo?

-> Well the overall file structure is the same, but ofcause the main is not identical to the demo. It has been changed to look like: http://www.pezzino.ch/stm32f3-discovery-usb-virtual-com-port/ ''

Well then it is YOUR code. Get the demo working first. Prove that the STM32F3 Discovery board and the host work together ( either as HID or VCP or both).

Once this is working - start looking at the demo code and work from there.

The code you posted does not look right at all!

nygaard
Associate II
Posted on January 22, 2014 at 09:04

Okay... point taken...

I have now fitted the USB example from: STM32F3-Discovery_FW_V1.1.0\Project\Peripheral_Examples\USB_Example

It should now act like an HID-device, but I still get the same STM32 Virtual COM Port, and no valid driver... :-(

The funny thing is, that I am getting handshake during boot on the same computer. My guess is that something is wrong in Windows. Any idea?

nygaard
Associate II
Posted on January 22, 2014 at 09:54

Okay... I got the HID to work! Restart, windows in test mode and clear clear clear driver.

I can't find a VCP example fra ST. Du you have one?!

Kind regards,

Michael

chen
Associate II
Posted on January 22, 2014 at 13:03

Hi

Sorry for the delay, the ST web site has been playing up.

http://www.st.com/web/en/catalog/tools/PF258157

nygaard
Associate II
Posted on January 22, 2014 at 15:12

Thanks...

Have you tried to import these projects in Eclipse with the CDT pluging and GNU Tools ARM Embedded compiler as toolchain. It should be fairly easy since e.g. TrueSTUDIO is based on Eclipse. But I keep getting this error:

Description Resource Path Location Type

make: *** No rule to make target `STM32303C-EVAL.elf', needed by `all'. Stop      STM32303C-EVAL C/C++ Problem

And I cannot change the builder setup in any way that will make it go away. 

Michael

chen
Associate II
Posted on January 22, 2014 at 15:44

Hi

''Have you tried to import these projects in Eclipse with the CDT pluging and GNU Tools ARM Embedded compiler as toolchain.''

Sorry no I have not.

''It should be fairly easy since e.g. TrueSTUDIO is based on Eclipse. ''

Yes, I use Atollic (and it is truely BAD).

I have also used CodeWarrior (another Eclipse based IDE) and I hated that too!

''And I cannot change the builder setup in any way that will make it go away. ''

Sorry, I rely on the tool vendor to provide working tools, I am a professional engineer doing this for a living.

nygaard
Associate II
Posted on January 24, 2014 at 10:44

Okay.. Too bad :-(

Now I have tried to convert the TrueSTUDIO project for my toochain at it seems reasonable to me. But sadly it is not working. I get A LOT of errors, but perhaps they can all be solved by an expert. 

ALL the errors is about the USART, some examples:

Description Resource Path Location Type

'USART_IT_RXNE' undeclared (first use in this function) hw_config.c /USB_VCP_MNP/src ine 328 C/C++ Problem

'ID1' undeclared (first use in this function) hw_config.c /USB_VCP_MNP/src line 529 C/C++ Problem

'ID2' undeclared (first use in this function) hw_config.c /USB_VCP_MNP/src line 530 C/C++ Problem

'ID3' undeclared (first use in this function) hw_config.c /USB_VCP_MNP/src line 531 C/C++ Problem

'USART_HardwareFlowControl_None' undeclared (first use in this function) hw_config.c /USB_VCP_MNP/src line 321 C/C++ Problem

'USART_FLAG_TXE' undeclared (first use in this function) hw_config.c /USB_VCP_MNP/src line 430 C/C++ Problem

'USART_HardwareFlowControl_None' undeclared (first use in this function) hw_config.c /USB_VCP_MNP/src line 406 C/C++ Problem

Every error is related to the hw_config.c file except one:

Description Resource Path Location Type

unknown type name 'USART_InitTypeDef' stm32303c_eval.h /USB_VCP_MNP/src line 407 C/C++ Problem

And identical error is occuring in the hw_config.c

Hopefully all these errors can be solved with knowledge about the framework. I have for several hours tried to cross reference the include and source files and compared various ST-versions of the ''same files'' in code compare software - but without any luck. 

So please help... I am feeling so close to my preliminary goal here :-S

Kind regards,

Michael