CDC Class added to USB Device Library!

General discussion on Libstock website & codes posted on this website.
Author
Message
erpay
Posts: 32
Joined: 11 Nov 2012 00:03

Re: CDC Class added to USB Device Library!

#16 Post by erpay » 11 Sep 2013 10:55

yzubek wrote:I have to connect a GPS on a PIC18F4550 using the CDC class. Is there any possibility to use this microcontroller as master?
You can change pic to a higher version which has master usb in it like pic24fj64gb002 or you can add a module which can behave as master like max 3421e

matrix
Posts: 203
Joined: 26 Jan 2006 07:21
Location: Bulgaria
Contact:

Re: CDC Class added to USB Device Library!

#17 Post by matrix » 05 Oct 2013 10:07

I have problems to get USB library working on STM32F207. Even examples. Any ideas what I'm missing?

matrix
Posts: 203
Joined: 26 Jan 2006 07:21
Location: Bulgaria
Contact:

Re: CDC Class added to USB Device Library!

#18 Post by matrix » 07 Oct 2013 12:26

Can anybody confirm this library works on STM32F207?
I only get Unknown device... with CDC and HID.

The old HID library works...

User avatar
milos.vicentijevic
Posts: 965
Joined: 23 Apr 2013 08:09

Re: CDC Class added to USB Device Library!

#19 Post by milos.vicentijevic » 07 Oct 2013 13:10

Hello Matrix,

I suggest you to check your Oscillator Settings. The easiest way to set it properly is to go to Edit Project and load Scheme called STM32F207VG_PLL_Int_Osc_16MHz_to_120MHz_USB.cfgsch . Then set your Oscillator Frequency [MHZ] value to 120Mhz and recompile your project. Please try this first and see what is going to happen.

Best Regards,
Milos Vicentijevic

matrix
Posts: 203
Joined: 26 Jan 2006 07:21
Location: Bulgaria
Contact:

Re: CDC Class added to USB Device Library!

#20 Post by matrix » 07 Oct 2013 13:36

The same result.
My MCU is STM32F207VE or ZE.

matrix
Posts: 203
Joined: 26 Jan 2006 07:21
Location: Bulgaria
Contact:

Re: CDC Class added to USB Device Library!

#21 Post by matrix » 07 Oct 2013 23:23

And another one question:

Can library be used with OTG HS on STM32F207, and is it possible to change the Vbus pin to custom?

User avatar
milos.vicentijevic
Posts: 965
Joined: 23 Apr 2013 08:09

Re: CDC Class added to USB Device Library!

#22 Post by milos.vicentijevic » 09 Oct 2013 14:47

Hello,

Theoretically it is possible to make OTG support by combining both libraries usb host/usb device but you will need to discover which type of device is plugged in. Please note that, currently supported chips for OTG are only ones with full speed module.

Vbus pin has alternative functions (if assigned) . List of this functions can be found here:

http://www.st.com/st-web-ui/static/acti ... 237391.pdf (page 44)

Best Regards,
Milos Vicentijevic

matrix
Posts: 203
Joined: 26 Jan 2006 07:21
Location: Bulgaria
Contact:

Re: CDC Class added to USB Device Library!

#23 Post by matrix » 09 Oct 2013 16:04

Hi Milos,

Did you mean, I must use both Host and Device libraries to get working usb on PORT B of STM32F207, but it will not work cos module is HS?

User avatar
milos.vicentijevic
Posts: 965
Joined: 23 Apr 2013 08:09

Re: CDC Class added to USB Device Library!

#24 Post by milos.vicentijevic » 10 Oct 2013 12:06

Hello,

yes, that is correct.

Best Regards,
Milos Vicentijevic

matrix
Posts: 203
Joined: 26 Jan 2006 07:21
Location: Bulgaria
Contact:

Re: CDC Class added to USB Device Library!

#25 Post by matrix » 10 Oct 2013 14:13

So, I got it working(STM32f207ZE, USBOTG_FS), but:

1. Add this line before init:

Code: Select all

GPIO_Alternate_Function_Enable(&_GPIO_MODULE_OTG_FS_PA89_10_11_12);
2. IMPORTANT: DO NOT TURN OFF COMPILER OPTIMIZATIONS!!!

Bandyt
Posts: 14
Joined: 25 Oct 2013 10:40

Re: CDC Class added to USB Device Library!

#26 Post by Bandyt » 25 Oct 2013 11:27

Hi,
I use F4Discovery board and try to run example (MikroC ARM)for VCP with loaded scheme ‘STM32F407VG_PLL_25_to_120MHz_USB’ but doesn’t work. Project is compiled fine, but when F4-board is in running mode, than Win7-x64 doesn’t recognized the USB device? I also try to install attached drivers from example folder ‘VCP driver’ but also no success (Win answer.- … your device is up to date). I also have installed native STM34F VCP driver and also no success. Have someone any idea, or maybe can share simple working example for F4Discovery or STM32F407VG with working VCP. (Everything else work proper, UART-FTDI, PWM, Interrupts, GPIO’s, etc. .. )

Thanks in advance.

Bandyt
Posts: 14
Joined: 25 Oct 2013 10:40

Re: CDC Class added to USB Device Library!

#27 Post by Bandyt » 25 Oct 2013 13:10

Hi there,

I have a small problem in MikroC Arm compiler. I try to run a VCP example on board F4Discovery with STM32F407VG mcu. For a starting point I used a project which can be founded in examples from USB library 1.1.0.0 and was dedicated for STM32F107VC. I simple load the scheme ‘STM32F407VG_PLL_25_to_120MHz_USB ‘ and compile the project, everything works fine. When the board start to running the virtual com port is not recognizable in WIN7x64, I get a message USB device is not recognizable... After that I try to install the drivers from attached VCPdriver folder from ME, but I get the message (Windows has determined that driver software for your device is up to date)- but still abide unknown device in Device Manager. I also try to install an original STM VPC driver but the same result.
Have someone any idea how to run this example with F4Discovery or STM32F407VG mcu, or can just share a working example with VCP property on the mentioned board, it would be much appreciated. I suspect on the wrong settings of CPU PLL and running frequency . Everything else works fine (UART-FTDI, GPIO’s, PWM’s etc…).

Thanks in advance

Sorry for the double topic :(

User avatar
milos.vicentijevic
Posts: 965
Joined: 23 Apr 2013 08:09

Re: CDC Class added to USB Device Library!

#28 Post by milos.vicentijevic » 28 Oct 2013 15:13

Hello,

this problem is probably because Discovery board has different value of external crystal resonator, so Scheme won't work correctly. Crystal used on our boards has value of 25Mhz.

Please try to use STM32F407VG_PLL_Int_Osc_16MHz_to_120MHz_USB.cfgsch scheme. Also when scheme loads,set input Oscillator Frequency [Mhz] value to 120.0 Mhz .

Best Regards,
Milos Vicentijevic

Bandyt
Posts: 14
Joined: 25 Oct 2013 10:40

Re: CDC Class added to USB Device Library!

#29 Post by Bandyt » 28 Oct 2013 20:53

Thanx Milos for the suggestion, but still no success, still appear -unknown device. If i select wrong settings of
frequency , PLL etc..the device stay unrecognizable. I think it's problem in WIN7- VPC drivers.

matrix
Posts: 203
Joined: 26 Jan 2006 07:21
Location: Bulgaria
Contact:

Re: CDC Class added to USB Device Library!

#30 Post by matrix » 29 Oct 2013 09:58

Hi,
If you have already installed VPC drivers you may have this problem. Try modify VID and PID in both source and driver.

Post Reply

Return to “Libstock Discussion”