Composite USB device support
Moderators: David Barker, Jerry Messina
-
- Swordfish Developer
- Posts: 1473
- Joined: Fri Jan 30, 2009 6:27 pm
- Location: US
Composite USB device support
I recently needed a USB device that supported both HID and CDC classes (known as a "composite device").
While it ended up "doable" with the current USBv14 library, there were a number of changes I had to make to both the HID and CDC files to get it to work, and it's a bit of a kludge.
I've been thinking about updating the library to incorporate some of the features/fixes of the current Mchip one (which is up to v2.8 or v2.9 now), but I thought I'd get some feedback before I bothered doing that. The new library would make it easier to support things like composite devices, event callbacks, etc, but it's bound to be larger code-wise. I'd try to make as much of it optional as I can, but I know it'll be bigger. Is that an issue with most folks?
In addition to Composite devices, I'd like to be able to add things like a Mass Storage Driver and possibly a few others, and the structure of the current code just doesn't lend itself to that.
Would there be any interest? Any other features?
While it ended up "doable" with the current USBv14 library, there were a number of changes I had to make to both the HID and CDC files to get it to work, and it's a bit of a kludge.
I've been thinking about updating the library to incorporate some of the features/fixes of the current Mchip one (which is up to v2.8 or v2.9 now), but I thought I'd get some feedback before I bothered doing that. The new library would make it easier to support things like composite devices, event callbacks, etc, but it's bound to be larger code-wise. I'd try to make as much of it optional as I can, but I know it'll be bigger. Is that an issue with most folks?
In addition to Composite devices, I'd like to be able to add things like a Mass Storage Driver and possibly a few others, and the structure of the current code just doesn't lend itself to that.
Would there be any interest? Any other features?
- Senacharim
- Posts: 139
- Joined: Tue Aug 10, 2010 5:19 pm
- Location: Ventura, CA
- Senacharim
- Posts: 139
- Joined: Tue Aug 10, 2010 5:19 pm
- Location: Ventura, CA
Jerry, I've been interested in a USB bootloader for awhile now. Not sure if this fits in with your plans. Even better would be a mass storage class bootloader, where the new firmware would be loaded if a new hex file was present. I haven't had the resources (mainly time) to look into either of these.
-
- Swordfish Developer
- Posts: 1473
- Joined: Fri Jan 30, 2009 6:27 pm
- Location: US
Ryan -
There's a USB bootloader in the current package.
It's a HID bootloader based on the ones from the Microchip libraries... I just combined all the different source packages into one and ported it over to SF so that you don't have to use C18 in case you have to make changes for your chip.
You can use the Mchip bootloader PC app, or I included a slightly modified version of that as well (MS Visual C++ 2010 Express)
There's a USB bootloader in the current package.
It's a HID bootloader based on the ones from the Microchip libraries... I just combined all the different source packages into one and ported it over to SF so that you don't have to use C18 in case you have to make changes for your chip.
You can use the Mchip bootloader PC app, or I included a slightly modified version of that as well (MS Visual C++ 2010 Express)
- David Barker
- Swordfish Developer
- Posts: 1214
- Joined: Tue Oct 03, 2006 7:01 pm
- Location: Saltburn by the Sea, UK
- Contact:
Just to add where I am at with this...
I'm not a big fan of CDC. The MS drivers are a little weak and I prefer to avoid CDC whenever I can when designing a project. That said, I can of course see the value of CDC for many projects and designs. However, I try and use HID as much as possible and therefore value a 'focused' HID implementation.
Mass storage sounds really interesting though!
I'm not a big fan of CDC. The MS drivers are a little weak and I prefer to avoid CDC whenever I can when designing a project. That said, I can of course see the value of CDC for many projects and designs. However, I try and use HID as much as possible and therefore value a 'focused' HID implementation.
Mass storage sounds really interesting though!
-
- Swordfish Developer
- Posts: 1473
- Joined: Fri Jan 30, 2009 6:27 pm
- Location: US
Thanks for all the input so far.
I've been use HID more often too, so I'll make sure it stays reasonable to use. I'm thinking most of the changes can be optional, so hopefully no real impact if you don't want/need them.
As far as Mass storage goes, what kind of storage would folks like to see? SD card? External SPI flash? Internal flash?
I just got a number of projects dumped in my lap the other day (when it rains, it pours). It'll probably be a while until I get a chance to actually work on this, so keep the ideas coming.
I've been use HID more often too, so I'll make sure it stays reasonable to use. I'm thinking most of the changes can be optional, so hopefully no real impact if you don't want/need them.
As far as Mass storage goes, what kind of storage would folks like to see? SD card? External SPI flash? Internal flash?
I just got a number of projects dumped in my lap the other day (when it rains, it pours). It'll probably be a while until I get a chance to actually work on this, so keep the ideas coming.
- David Barker
- Swordfish Developer
- Posts: 1214
- Joined: Tue Oct 03, 2006 7:01 pm
- Location: Saltburn by the Sea, UK
- Contact:
> As far as Mass storage goes, what kind of storage would folks like
> to see? SD card? External SPI flash? Internal flash?
I suppose if the actual storage medium was sufficiently decoupled from the USB then it would leave options open? However, I guess anything would suffice - for me, transferring large data sets over USB at good data rates (anything above HID would be great!
> I just got a number of projects dumped in my lap the other day...
I know that feeling!!! Been busy myself over the last month or so on some very interesting stuff, but sure is good when you get some time to play again
> to see? SD card? External SPI flash? Internal flash?
I suppose if the actual storage medium was sufficiently decoupled from the USB then it would leave options open? However, I guess anything would suffice - for me, transferring large data sets over USB at good data rates (anything above HID would be great!
> I just got a number of projects dumped in my lap the other day...
I know that feeling!!! Been busy myself over the last month or so on some very interesting stuff, but sure is good when you get some time to play again