STM32F7, HAL CDC
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-09-26 2:52 PM
Posted on September 26, 2016 at 23:52
I'm looking at bringing up a VCP on an STM32F7 using the Nulceo-F746ZG development board.
Now, after running the CubeMX tools it seems all the magic is happening in the CDC_Receive_FS and CDC_Transmit_FS functions in the generated usbd_cdc_if.c file. Just to be sure that this basic example is working, I added ''CDC_Transmit_FS(Buf, *Len);'' just before the return in CDC_Receive_FS. The purpose is to have a simple loop-back so I can load up a terminal and see the bytes go back and forth. Now, when I load up Device Manager, I can see ''STMicroelectronics STLink Virutal COM Port (COM8)''.When I open a terminal program and target COM8, nothing is returned. This method in doing a loop-back should work, right? Or could it be non-functional because a transmit call is in the receive function?
This discussion is locked. Please start a new topic to ask your question.
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-09-27 4:03 AM
Posted on September 27, 2016 at 13:03
Hi traud.jason,
Try to follow the CDC-Standalone'' example in at this path: STM32Cube_FW_F7_V1.4.0\Projects\STM32756G_EVAL\Applications\USB_Device\CDC_Standalone Also this gives you general guidelines on this. -Hannibal-Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-10-02 10:00 AM
Posted on October 02, 2016 at 19:00 It would be nice if the CubeMX examples actually were CubeMX examples. They do not use CubeMX generated frameworks. In any event, your problem is probably on the receive side since ST does not document this well enough for anyone to figure out. First you should just put a transmit of a string (like Hello World) in a loop with a delay to verify you can output characters. This will probably work. On the input side, you need to manage the input buffer to get any input to process. I make a couple of small edits to the usbd_if.c file and then include my own usb support file, usb.c and usb.h, which I have attached to this post. Hopefully it will help. It creates a circular buffer on the receive side and enables you to access input from the usb port. Good luck, Aaron
________________
Attachments : usb.c : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HthR&d=%2Fa%2F0X0000000aVu%2FFbMe288i1ROoxMmmuIdfgpEte0TN5Ka8XCXuotUrFZ8&asPdf=falseusb.h : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Htqm&d=%2Fa%2F0X0000000aXr%2FGYPOQXVhaEkXwYP.ZpJxLIQNQakFRM6oU9F1p_upvx4&asPdf=falseusbd_cdc_if.c : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Htqd&d=%2Fa%2F0X0000000aXo%2FkFVkyCaL6mCl4FXSO2_g6._e4egUJSW1fh5OmA8L58c&asPdf=false
