cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to rewrite drivers for USB CDC?

matic
Associate III
Posted on May 25, 2016 at 22:54

Hi.

Quite often I need USB CDC driver which could be found in Cube Middleware package for communication between PC and uC. It works, but there is a big mess in those functions. I wonder, if it is possible to rewrite my own drivers, with register based code, which could probably be a lot smaller, more transparent and perhaps also faster. Does anyone have any experience with that? USB peripheral looks quite complicated to me. Much more than SPI or USART.

Thanks

#usb
1 REPLY 1
TDK
Guru
Posted on May 26, 2016 at 02:01

Of course.  The only limits are the limits of your coding abilities.

You'll obviously need to weigh the benefit of having a ''nice'' library over one that ''looks quite complicated'' but works and see if it's worth your time.  I would recommend actually using the library that already exists before embarking on your own coding journey.  You may learn something in the interim on why it's implemented the way it is.

You may find that USB is just inherently more complex than that of UART and SPI, hence the additional complexity.

You can consider writing a wrapper library that handles the interface with the more complicated USB functions and just exposes a cleaner interface you're looking for.

If you feel a post has answered your question, please click "Accept as Solution".