2012-06-22 08:47 AM
I have recently downloaded the latest USB libraries which include a virtual comms port project. However all the examples use the ''Eval'' boards which include an LCD etc. rather than the Discovery board which does not. I am trying to edit the configurations and files in IAR to work with the Discovery board but as a relative beginner at this, it is proving difficult. Is there an ST project for a VCP which will run on the Discovery board?
Tony2012-06-22 09:42 AM
Answering my own post - I downloaded jlc.jlsilicon's VCP code as posted previously and got the hex file into the board with st-link. I downloaded the ST VCP driver code for windows, but it did not recognise the USB VID/PID. I was able to change the .inf file to the VID/PID used by jlsilicon's code - namely 0304/E457, and the driver installed OK. I was then able to use Hyperterminal to play with the board - thank you Mr jlsilicon.
Its quite a miracle really, since I am doing this on a Macbook running Parallels so the USB has to get to Windows XP through several extra layers. The LED on/off controls all work OK, and the ADC reading pops up.I now have to work out how to modify the code because this is what I want to do to change ADC parameters and as I posted previously I had problems with the different usbd files. Having now been pointed to the latest USB libraries by Clive1, I may be able to get my own compiling to work. Current problem is I am using IAR EWARM, so I have to recreate the environment which jlc.jlsilicon used - any help most welcome.Tony2012-06-22 10:03 AM
I'll take a look, as this fits into my development strategy. I can't help you with the IAR stuff, but I have culled the eval board projects into Keil and Yagarto and removed all the LCD and EEPROM junk. To this point I've done the MSC example for both the F4, and my F2 target, and worked with JLC on getting a workable binary from the GNU/GCC chains. Most critically the linker script, and startup files.
The GNU/GCC model is to dump all the .C/.H files from the library into a single directory, remove the source files not needed and then making the whole thing. The model with Keil, and presumably IAR, is to build a project which adds files and groups, and cherry picks the library files from their own directory tree locations. To take local copies of the stm32fxxx_whatever_eval.c/h files and hatchet out the unnecessary includes, and variables/structures contained there-in. With Keil, I cloned the eval board project as a starting point, deleted unwanted files both within the project and from the disc, removed all the obvious #include and references, and then built iteratively to catch other references. I can certainly see this as being overwhelming for a beginner, because you have to break so much, and then try to glue it back together.2012-10-28 02:23 PM
Hello abbey.tony,
I am working on VCP Port as well but not able to find any reference code for STM32F4Discovery Board. The link to jlc.jlsilicon's VCP code is broken. So can you send me your code as a reference? I would really appreciate that.2012-10-28 05:51 PM
This is my VCP STM32F4-Discovery port for Yagarto (GNU/GCC)
https://docs.google.com/open?id=0B7OY5pub_GfIdnREeExyRWNXbFE
I have a Keil port too, and I'd consider a IAR EWARM one if someone bought me a license. ST provide example code within their USB firmware for the STM32xx-EVAL series boards, these are reasonably easy to port to other boards and tool chains for those with familiarity with their tools.2012-10-29 06:22 PM
Clive, Thank for sharing your code. I have added your files into my Keil project but still the windows doesn't recognize any virtual com port. I have the driver 1.3.1 installed on my PC. I can see 4 LEDs blinking but it doesn't initialize the com port. I have attached my whole project if you want to look at it.
________________ Attachments : Test_Codes.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HzZM&d=%2Fa%2F0X0000000bNi%2F24lBe.nfcVt_TGHGWskKSkFQgkk19kDqsAzi_PyPGnc&asPdf=false2012-10-30 07:32 AM
Yikes, that's a bit of a monster.
The defines don't appear to be correct. Defines : USE_STDPERIPH_DRIVER,STM32F4XX,USE_STM32F4_DISCOVERY,USE_USB_OTG_FS,HSE_VALUE=8000000 Target : Use MicroLIB : Checked, Floating Point Hardware : Not Used This is my VCP STM32F4-Discovery port for Keilhttps://docs.google.com/open?id=0B7OY5pub_GfIeVpqZXZLWEVrNWc
2012-11-01 08:44 AM
Clive, Thanks really appreciate it ... The USB is working now.
Thanks Again2012-11-18 01:49 PM
2012-11-18 02:59 PM
You should be able to configure the baud rate when you first initialize the ports, but you do not want to let USB/VCP side of things reconfigure the port, so you can ignore requests from the PC to set a specific/different rate.
Without knowing exactly what you added it's hard to know.