cancel
Showing results for 
Search instead for 
Did you mean: 

STM32072B-EVAL + STM32Cube: unmodified USB VCP example not recognised properly

sseveelavanan9
Associate II
Posted on January 30, 2017 at 19:21

I'm using this example

STM32Cube_FW_F0_V1.7.0\Projects\STM32072B_EVAL\Applications\USB_Device\CDC_Standalone

Which should simply present a VCP in Windows/Linux, after the drivers are installed (for Windows): 

http://www.st.com/en/development-tools/stsw-stm32102.html

 

For the setup, I do the following

- ''For power supply from USB (CN4) to STM32072B-EVAL only, JP19 is set..'' - from

http://www.st.com/content/ccc/resource/technical/document/user_manual/63/18/cb/de/57/a6/45/17/DM00104135.pdf/files/DM00104135.pdf/jcr:content/translations/en.DM00104135.pdf

- link TX / RX for loop-back using jumpers (but not important I just want the device to be recognised for now)

- connect a standard USB cable from CN4 USB port to my computer. The cable is fine, as I also use this one connected to CN13 for programming via ST-Link.

I get this unhappy message0690X00000606BxQAI.png

I checked to see if what recognised by Ubuntu / Linux. It is not

Am I missing something?

#cdc #stm32 #usb #vcp
1 ACCEPTED SOLUTION

Accepted Solutions
Posted on February 01, 2017 at 17:33

Hey Chendy. Ok, downloaded a fresh copy of the same source code -> imported the CDC_EXAMPLE project -> compiled and tested on our same target board (STM32F072-EVAL). Also initially noted the yellow bang (screens are attached) and reviewed the following important steps:

1) be sure that the USB cable for the ST/LINK is connected - this powers the kit

2) then dock the cable for the USB interface to perform the CDC emulation. Also right-click the current yellow bang mark and select UNINSTALL AND check the box to delete the driver. This will force a fresh start for your device driver links.

3) Install the VCP driver using the installer package supplied with the 1.4.0 VCP driver package (yours appears to be the same but included in our download as well).

4) A compiled HEX file is also posted in this download for your testing.

Curious to hear about your results.

BTW - Any chance you a virus protection s/w running in the background that may be halting this installation ?? Known to happen and be sure you have admin rights.

https://axxonshare.s3.amazonaws.com/STM32F072-EVAL/STM32F072-EVAL_CDC_EXAMPLE.zip

Update:

1) We are on Win7 x64 - have not yet tested on Windows 8.x nor 10. According to the readme - should work fine on Windows 8.x

2) Tested with the power jumper for CN4 - works fine using a single cable to power the eval kit.

View solution in original post

17 REPLIES 17
Jennifer D
Associate II
Posted on January 30, 2017 at 21:26

Hi, did you find the soln to this problem? 

Imen.D
ST Employee
Posted on January 30, 2017 at 22:24

Hel

lo,

Maybe the problem is due to heap and stack memory sizes defined in startup file.

Try to increase the heap and stack size and p

lease keep me updated on the progress.

Regards

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Jennifer D
Associate II
Posted on January 30, 2017 at 22:34

Back again.

Imen D is right. For those in IAR the heap and stack sizes are sorta hidden.

Project ->Options ->Linker and then edit the linker configuration.

Change 200->2000

400->4000

This worked for me! I am so excited I have been working on this for over a week.

-Jen

EDIT: I am attaching the PDF that helped me out

________________

Attachments :

Data exchange between STM32F411 and PC using USB.pdf : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hyxw&d=%2Fa%2F0X0000000bEU%2F7lvhMVuDIiZFx_j98IXzhFSfhsOYzVvbwy0rD0kHNLk&asPdf=false
Posted on January 30, 2017 at 23:27

Hi

flowersnlyrics

‌,

I'm happy to see

that my suggestion has been useful for you and

your problem is resolved

I want to thank youfor sharing your experience in the attached pdf, this will be helpful forusers forum.

Thanks

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Posted on January 31, 2017 at 13:16

Hi,

So no luck for me...

I have increased the stack size 400 to 2500 (the max before non-compile), heap 200 to 2000. I cant increase the stack to 4000 (as per Jennifer D's tip) - it doesn't compile after this 2500.

Im using the free STM32 provide Keil offer. Could this somehow play a part? Is there a chance it is compilation size limited?

With these settings still same: not recognised. 

Also the 4 leds (ld1, ld2, ld3, ld4) are all flashing about about 2hz (incase that helps debug)

Any chance somebody at ST could get this working on the ST32F072-EVAL?

Thanks

Posted on January 31, 2017 at 14:13

Hi,

In my case (simple USB CDC project I made myself on a Nucleo-64 board), Linux would not enumerate the device.

The solution was the trick on p. 7 of the PDF referenced by Jennifer : edit usbd_conf.c and change

hpcd_USB_OTG_FS.Init.vbus_sensing_enable = ENABLE;

to :

hpcd_USB_OTG_FS.Init.vbus_sensing_enable = DISABLE;

Yet, I did disable VBUS sensing in CubeMX. Is it a bug in the code generation ?

I'm using CubeMX v4.18.0 (last version v4.19 won't work at all).

Posted on January 31, 2017 at 15:53

I've also tried to do this:

The solution was the trick on p. 7 of the PDF referenced by Jennifer : edit usbd_conf.c and change

hpcd_USB_OTG_FS.Init.vbus_sensing_enable = ENABLE;

to :

hpcd_USB_OTG_FS.Init.vbus_sensing_enable = DISABLE;

but this line or similar doesn't seem present in the version of usbd_conf.c in my project folder. I also did a grep search for that string in the project folder - nothing found for 'vbus'.

(file from)

STM32Cube_FW_F0_V1.7.0\Projects\STM32072B_EVAL\Applications\USB_Device\CDC_Standalone\Src\usbd_conf.c

Mon2
Senior III
Posted on February 01, 2017 at 05:19

Hi Chendy. I think we recall your name from the XMOS forum:) We have the same STM32F072-EVAL board in the lab and did get the full CDC_EXAMPLE (supplied by ST) working.

See AN4735: STM32Cube firmware examples for STM32F0 Series -> page

The supplied code (not Cube generated) works fine - we have tested against a SiLabs USB bridge to confirm the assorted baud rates and they did sync fine with each other (CMOS to CMOS wiring).

Are you using the 256k license from ST ?

https://community.st.com/0D50X00009XkW4oSAF

Mon2
Senior III
Posted on February 01, 2017 at 12:10

Hey Chendy. Let us review the same procedure upon reaching the office. Up a bit early here and will be in the office in about 4 hours from now. At the very least, we should be able to generate a compiled binary for you to test.

Any reason why you cannot use the CDC_EXAMPLE for the STM32F072-EVAL ? It is complete and will perform even better than the STMCube generated code. That is, if you wish to alter the baud rates or line settings of the virtual UART, the STMCube code will not allow for this and is left as an exercise for the reader.

I would think that the compiler you have is fine for this example but again will confirm details once reaching the office. In the meantime, just import the complete project created for your (rather expensive) STM32F072-EVAL board. We brought in this same tool just for the CDC_EXAMPLE code so we can study how it works. Very nice to be able to just import -> compile -> test (without issues).