Using Keil uvision 5, I was finally able to get my device ( stm32f429) to emulate two Virtual Com Port in Windows successfully ( USB composite device), I can open two hyper terminal session with one VCP port each, and I can exchange data between them without problem. I use RTE to enable 1 USB device and 2 CDC Device class.
Now I want to do the same thing but in Host CDC mode, so I connected my device ( stm32f429 ) to an stm32F7 discovery board via FS usb connector. My problem is that in the new created project, I can't or I don't know how to enable 2 HOST CDC class using RTE manager.
If I use only one CDC device on the stm32f4 side, I'm able to communicate with it without problem, but when using 2 CDC device( on the F4 side) here I don't know how to do the stm32F7 side !
any advice would be greatly appreciated. thank you.
here some source code:
main.c:
/*------------------------------------------------------------------------------ * USB Host Thread *----------------------------------------------------------------------------*/ void USBH_Thread (void const *arg) { static bool con = false; int stat=0; stat = USBH_Initialize (0); /* Initialize USB Host 0 */ stat = USBH_CDC_ACM_GetDeviceStatus(0); while( stat!=usbOK) // Get error 0x21 "usbDeviceError", device dos not exist! { stat=USBH_CDC_ACM_GetDeviceStatus(0); osDelay (100); LED_On(0); osDelay (100); LED_Off(0); }
USBH_Config_CDC.h
//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- // <h>USB Host: Communication Device Class (CDC) // <o> Number of concurrent CDC Devices in system <0-3> #define USBH_CDC_NUM 2 // <h>OS Resources Settings // These settings are used to optimize usage of OS resources. // <o>CDC Interrupt In Pipe (modem and error status reception) handling Thread Stack Size <64-65536> #define USBH_CDC_INT_IN_THREAD_STACK_SIZE 512 // CDC Interrupt In Pipe handling Thread Priority #define USBH_CDC_INT_IN_THREAD_PRIORITY osPriorityAboveNormal
This will not quite go that simple.
For composited device you will have to use custom class on USB Host, documentation can be found here: www.keil.com/.../group__usbh__custom_functions.html