2010-06-09 10:46 PM
Multiple USB CDC (USB IAD). How?
#iad #cdc #stm32f103 #dual-cdc-with-stm32l152 #usb-cdc-duart2012-07-27 02:06 AM
Hello everyone,
I would also be interested to implement a FT2232 or FT4232 like functionality (DUART, QUART) with STM32.. an experienced developer told me he thinks it's impossible because there aren't enough endpoints.Any comments from the official STM32 support forum?Are there any pointers to source code and/or application notes that would suggest how to do this?Best regards,Michele2012-07-27 07:39 AM
> an experienced developer told me he thinks it's impossible because there aren't enough endpoints.
One CDC function requires 2 IN / 1 OUT endpoints (interrupt IN/ bulk IN/ bulk OUT), other than the default EP. Available endpoints of each STM32F family are, STM32F102/103 - FS Device core: 7 IN / 7 OUT STM32F105/107 - OTG_FS: 3 IN / 3 OUT STM32F2xx/4xx - OTG_FS: 3 IN / 3 OUT - OTG_HS: 5 IN / 5 OUT STM32F102/103 - 3x CDC composite STM32F105/107 - just one CDC STM32F2xx/4xx - 2x CDC composite on OTG_HS Starting from ST's example, it isn't so hard, to make them a CDC composite device, if you would know where and how to touch on the source code :) I can tell you where and how. Do you want to make one with me? Tsuneo2012-07-27 09:06 AM
Hello Tsuneo,
I could not hope for a better answer... I was reading your posts about Silabs and others and trying to understand what way to tackle the problem. The single CDC example works fine for me.I would surely want to do this with you and I would also be willing to do this open source if you think it's appropriate.I really need this functionality from my STM32F102/3xB.The only problem I see is the significance of my contribution compared to yours! I don't have much experience with STM32 and I use open source tools (CodeSourcery+Eclipse) to develop.. even though I am willing to spend a bit of money into a commercial suite if you think it's necessary.Please let me know how we can proceed from here. My email address is michele.bavaro at gmail.All the best,Michele2012-07-27 10:35 AM
I can tell you where and how. Do you want to make one with me?
It would be of general usefulness, I can see a couple of potential applications.2012-07-27 12:19 PM
2012-07-27 02:08 PM
2012-07-27 02:34 PM
I had to add :
#define CDC_V1_10 0x0110 #define USB_ENDPOINT_OUT(addr) ((addr) | 0x00) #define USB_ENDPOINT_IN(addr) ((addr) | 0x80) Keil is still choking on the following with a ''Error #146 Too many initializer values'' IAD_CDC_IF_DESC_SET( USB_CDC_CIF_NUM0, USB_CDC_DIF_NUM0, USB_ENDPOINT_IN(1), USB_ENDPOINT_OUT(2), USB_ENDPOINT_IN(2) ),2012-07-28 02:31 AM
2012-07-29 03:05 AM
Hi clive1,
Thanks to your interest to our project! mbavaro, The modification code on my above post is not enough. I made more change on more source files. I attached current version of source code to this post. The device appears as 3x CDC composite device on Windows successfully. Current development state is,- Descriptors and INF : finished
- Bulk IN/OUT endpoints : not touch yet - Class requests and interrupt EPs: not touch yet I'm testing this code on Olimex STM32-P I took STM3210B_EVAL option as the base setting. STM3210B_EVAL assigns PD9 for DISCONNECT port. Olimex STM32-P103 applies PC To make this difference, platform_config.h was modified as follows,platform_config.h
/* Define the STM32F10x hardware depending on the used evaluation board */ #ifdef USE_STM3210B_EVAL #ifdef OLIMEX_STM32_P103 #define USB_DISCONNECT GPIOC #define USB_DISCONNECT_PIN GPIO_Pin_11 #define RCC_APB2Periph_GPIO_DISCONNECT RCC_APB2Periph_GPIOC #else #define USB_DISCONNECT GPIOD #define USB_DISCONNECT_PIN GPIO_Pin_9 #define RCC_APB2Periph_GPIO_DISCONNECT RCC_APB2Periph_GPIOD #endif #define EVAL_COM1_IRQHandler USART1_IRQHandler Also, OLIMEX_STM32_P103 macro was added to Project > Options > C/C++ > Preprocessor Symbols: Define, over macros of original STM3210B_EVAL setting (I'm using Keil).USE_STDPERIPH_DRIVER, STM32F10X_MD, USE_STM3210B_EVAL, OLIMEX_STM32_P103
To fit DISCONNECT port to your board, you'll need similar modification. Tsuneo ________________ Attachments : Virtual_COM_Port_x3_r1.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I15i&d=%2Fa%2F0X0000000biF%2F2lC9XEy6QTQfHdTP77j3PvDzqPmzkXh..r8E2F0tNwM&asPdf=false