2011-12-12 12:09 AM
Hi all,
I'm completely new to ARM and ST, having mainly used Microchips offering previously. Thinking it was time to branch out a bit and liking the look of the new ST stuff, I grabbed the new F4 Discovery board a few days ago. Anyway, I have got a few examples up and running and am beginning to find my way around the documentation and chip. The project I am planning to use the F4 in would require a generic USB OTG interface, so I am looking for any good examples/documentation for this.For example, with the PIC32 I used the Generic MCHPUSB, LibUSB and WinUSB drivers, so something along these lines which doesn't require writing a new driver would be useful.I read that there is an ST driver available in (page 72) which is also used for DFU. Since our project would require DFU this would fit well, but it doesn't actually mention the name of the driver in the document and I cannot find anything about it on ST's website. Could anyone point me in the right direction please? Any help would be much appreciated. Example firmware (I'm using Atolic for now) or documentation, relevant links from St's site, etc. I've not got to know my way around any of this yet so am probably missing plenty.Thanks. #usb-stm32f42011-12-16 07:45 PM
The driver is available in the firmware package. It in the Peripheral Drivers section. All the USB Drivers are available there. Good Luck
2012-01-11 05:43 AM
2012-01-11 10:01 PM
That's exactly what I am also looking for, best a bulk transfer test firmware for device mode (Just accepting bulk transfers with highest possible speed and then showing the transfer rate in some small Windows application window based on WinUSB (or LibUSB - thanks for this hint, I did not know it before), with the source code of this small Windows app available).
Unfortunately they only provide these standard driver examples like HID, MSC, CDC-VCP (I assume you got the ''STM32_F105-07_F2xx_USB-Host-Device_Lib_V2.0.0'' - you can download this somewhere from the ST homepage). Presumably they did not want to write a small Windows software themselves, so they rely on these standard drivers, but this makes it very cumbersome for anybody, who wants to use their USB for some customized data transfer. I found the CDC-VCP example quite useful - I got this running on STM32F4 Discovery now, so that it operates with HyperTerminal in an Echo mode. Just this is not suitable to test the transfer speed. This STM32F1-F2-LIB comes with full source code, but unfortunately does not contain a ''custom class''. The User manual UM1021 just has a brief paragraph 6.7.5 ''Adding a custom class''. So I think this is the way to go ... . If you have any results, I would be very interested.2012-01-16 02:08 AM
Update:
I just managed to get the example running on STM32F4 Discovery... Hello Bil I'm struggling to implement CDC-VCP on the STM32F4 Discovery. (And some others too, I guess.) Most of the time the application on the STM32F4 crashes when I connect USB and Windows states ''usb device not recognized...'' and ''Unknown Device'' respectively. Could you give some hints on how to port the VCP example (STM32_F105-07_F2xx_USB-Host-Device_Lib_V2.0.0) to the STM32F4? If you could share (parts of) your code this would be very nice. Thanks and Best regards, Raffael2012-01-22 10:51 PM
From: bil.til
Posted: Thursday, January 12, 2012 7:01 AM
Subject: STM32F4 Generic USB Advice
This STM32F1-F2-LIB comes with full source code, but unfortunately does not contain a ''custom class''. The User manual UM1021 just has a brief paragraph 6.7.5 ''Adding a custom class''. So I think this is the way to go ... . If you have any results, I would be very interested.
I read the part about the custom class and used what little there was to go on to alter the HID example accordingly. It worked fine with a small test program knocked together in C# using LibUSBs supplied library. I am working on other things currently (having problems with libraries :( see my latest post) but if you are still having problems and would like to see my project just let me know and I will dig it out and send it to you (also have a basic Visual Studio program - press button to toggle LED on discovery board)2012-01-23 01:20 AM
Wow, that would be great.
I meanwhile succeeded in porting the CDC example first the ST4Discovery in FS-Mode, then to Keil MCBSTM32F400 in FS-Mode, and then also to Keil MCBSTM32F400 in HS mode. Just to my disappointment the STMCDC.INF ''driver'' seems to be somehow linked to other software of STM, and I do not find this link. In the STMCDC.INF file I see only invocations of Standard / Microsoft drivers - so I have no idea why this driver gives a message as ''STMicroelectronics Virtual COM Port'', even after I customized all ''STM''-texts in the firmware and in the driver INF file. Even worse, it does not seem to allow to change VID/PID - after such a change, the INF will not work anymore (of course I also change the VID/PID also in the INF to the same value). Further if I keep the original VID/PID, then this driver does NOT work on some other ''virgin'' PC - I assume somehow this STMCDC.INF driver has some ''hidden bridge'' to any other drivers, which maybe are installed together with ST-LINK for ST4Discovery ... . So now I will skip any further work on the CDC, and I just last night decided to continue with this custom firmware class, and then use WINUSB, perhaps again first on ST4Discovery, then on Keil FS and finally (hopefully) on Keil HS. If you could show me your firmware code for the customs class, and possibly also a VB WINUSB application, this would save very much work for me.2012-01-23 12:31 PM
Okay, I attached the project structure, the main.c/h from it, the LibUSB device class and a (very) rough old app I altered slightly to test it. In the app, you click ''open USB'' then ''Single Shot'' to toggle the LED on the discovery board (none of the other buttons will do anything)
The toggle is simply coded directly into the receive routine in the LibUSB class (USBD_LibUSB_DataOut -normally of course you would pass to your main app) It's all a mess as I was rushing, as soon as I proved it worked I moved on. Hopefully you can make some sense of it though. The project was an adaptation of the Discovery demo, and all the files were linked so I couldn't just zip and post that. Instead I took the most important bits out. You should be able to start a project, add the USB libraries and drop the main/LibUSB in. Hope it helps a bit. ________________ Attachments : LibUSB.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HtXa&d=%2Fa%2F0X0000000aRU%2FLd8y8FCr1amiCdNqBwA7eZwPTOmc9Ub6zaqPx5ItZ2s&asPdf=falsemain.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HtXf&d=%2Fa%2F0X0000000aRV%2FETCnu0fO.L.ZlLtuKUP0zikGJ9OwM0uUksbD.gKoBNk&asPdf=falseSTM32_Custom_USB_Test.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HtXk&d=%2Fa%2F0X0000000aRX%2FNbnHzQebAgUb2AFx0Yi00CvOpGy2AYysBNxY58aSr1o&asPdf=falseSTM32_USB_Test.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HtXg&d=%2Fa%2F0X0000000aRW%2FJypyM2BXNlyrIV8WSMy5DReluEsHVFF99nSUEgDO2Mc&asPdf=false2012-11-12 01:16 PM