Three serial com ports with CDC drivers

Discussions and support about ChibiOS/HAL, the MCU Hardware Abstraction Layer.
User avatar
sabdulqadir
Posts: 49
Joined: Fri Mar 23, 2018 7:29 pm
Has thanked: 13 times
Been thanked: 4 times

Three serial com ports with CDC drivers

Postby sabdulqadir » Thu Apr 29, 2021 5:57 am

Hi,
I was successful in getting three virtual com ports to work on my target stm32f723. I had to give up speed to do that though (because of double memcpy that comes with serial usb).
Now I am trying to mix and match, where out of three, I want two to use serial usb while one uses raw usbTransmit(). I am not able to get this to work. I see some data being transferred and then the debugger loses connection with the target. I am still looking into the stack to figure out where it breaks.

In the meanwhile, I thought ill ask here if anyone has attempted such and if this can even be done or not.

Thanks,
AQ

ChibiOS: v20.3.2

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: Three serial com ports with CDC drivers

Postby Giovanni » Thu Apr 29, 2021 7:17 am

Hi,

I never did that but it should be possible, in the USB callbacks you need to call the Serial_USB handlers or your "raw" handlers depending on the endpoint being handled.

Other source of potential problems is the device descriptor, that one is not exactly easy to get right.

Giovanni

User avatar
sabdulqadir
Posts: 49
Joined: Fri Mar 23, 2018 7:29 pm
Has thanked: 13 times
Been thanked: 4 times

Re: Three serial com ports with CDC drivers

Postby sabdulqadir » Wed May 05, 2021 5:09 am

Ok, got it to work, at least partially. No change in descriptors was needed so far.
Thanks for the help,
AQ


Return to “ChibiOS/HAL”

Who is online

Users browsing this forum: No registered users and 9 guests