cancel
Showing results for 
Search instead for 
Did you mean: 

Composite USB example (2xCDC) for STM32F7

jmasriera
Associate II
Posted on October 27, 2016 at 11:08

Hi.

Based on chinzei.tsuneo's code in [DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Multiple%20USB%20CDC%20%28USB%20IAD%29.%20How&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&currentviews=10050]this post and the code generated by Cube application, I've done a composite USB application using IADs, that has 2 CDC devices.

The project is attached. The project is done in SW4ST32. I've testes on STM32F769I-DISCO board.

The application is very simple, everything that is received from one CDC is send by the other CDC.

If you find anything that is wrong please correct and post it.
4 REPLIES 4
Calypso 2021
Associate II
Posted on April 13, 2017 at 11:01

Hello.

I see that on the Win7 32-bit it causes to BSOD.

world04
Associate II
Posted on April 17, 2017 at 23:44

I am try to find an example that shows me how the cubeMX 20.x generated code of an freertos based application that supports an USB cdc vsp code. CubeMX generates the driver code and the serial port is visible in Win10 deives manager. This is mapped as com4 and a terminal program will open that port. It's possible for me to send from the F7 Disco-Board to the Host via that interface, but send a few characters back, the Disco Board stopped.

I had found a Stack size Issue - MXCube generates just 0x200 / 0x400 for stack and heap and this is not enought.

I had not found any vsp support routines or any other public declared Rx-Routine or VSP Route that could be read or write a string form or to the host.

Does anyone can help me or have an example solution where i can find the way i need to go to get them work?

All the documentation is had found relates to the older Std-Lib, not HAL.

Thanks in advance

Jupp

world04
Associate II
Posted on April 24, 2017 at 19:23

I had checked the posted example how the CDC handler works, who hocks-on the cubeMX V1.0 - 4.20.1 driver code.

A point that funny was is, that none  function is generated that capture the incomming or send data stream that was send or received by ro to the virtual serial port on the pc.

This exported support functions are simple and looks reliable, prevents overruns by using a fifo buffer for rx and tx operation. This is a good idea if an RTOS will be used. This is the first example that i had found using the actual HAL support routines and it looks very good. I will taste the routines in combination with HAL code and freeRTOS.

BTW: I had found several examples who uses the VSP HAL API's in an STM32F4 but the HAL driver support is different and not easy convertable.

Well, this sourcecode helps me to understand the working of the API that cubeMX generates as a HAL.

Torben  Nielsen
Associate II
Posted on July 25, 2017 at 17:21

Hello Jordi

When using Win7 only a single 

serial port is showing up in the Windows Device Manager. When connecting to Win10 both CDC interfaces shows up and they seems to work (only tested using TeraTerm). Do you have any idea why is not working using Win7 ?

Br

Torben