Skip to main content
Topic: microchip usb stack (Read 11134 times) previous topic - next topic

microchip usb stack

I noticed that many projects that are open source (different licences) leave out microchip libraries out of the code (bp uses usb lib but leaves it out, the similar issue can be seen in other project with fat/sd/usb and many other microchip libs). Looking at the headers in these sources from microchip I don't see why are the sources excluded from the projects? The only thing I see in the microchip licencing info is that those are not to be used on non microchip mcu-s, but since all this projects (BP for one) use microchip mcu (PIC24.. for e.g.) there should be no problem ?!

Anyone can shed some light on to this issue?

Re: microchip usb stack

Reply #1
I recall that the Microchip license for their USB Stack does not allow redistribution.  They probably figure that everyone can come to them for the sources.  I can't say that I have verified this restriction recently, though.  Probably worth checking on the main pages for the USB Stack at Microchip, and also in any Readme or License files in the package.  They might not spell out the full restrictions in every header.

The only problem here is that when Microchip updates their code, they don't seem to maintain the old source versions on their site.  This means that open source projects might get stale unless they are constantly updated to remain compatible with Microchip's latest.  Otherwise you might download an older open source project that won't build until you modify it.

Re: microchip usb stack

Reply #2
The big Microchip driver download (it's unified into FAT/USB/TCPIP/graphics now) has a 'click through' license, and there's a huge PDF with extra conditions too. Some have interpreted it the way you do, and one of the guys in the forum who is a lawyer actually spent some time looking at the licenses and arrived at the same conclusion.

However, when we released the first project, Microchip sent us a full-up cease and desist for posting a modified version of some of their source in a forum post. So maybe they are overzealous in enforcement, but we're a tiny operation and have no way to challenge it (nor would we want too). My preference is to put hardware out there that talented developers might be able to use to replace some of the proprietary stuff.

Just a side note: BPv3 doesn't use USB, only the BPv4 uses the Microchip USB stack, and that's only for testing. There probably won't be a v4 Bus Pirate until there is a distributable stack.
Got a question? Please ask in the forum for the fastest answers.

Re: microchip usb stack

Reply #3
Perhaps the key word from Microchip is 'modified'
If you altered their sample code, but left in their license header, then perhaps they only complained about the confusion that may cause because their name was on your code.

I wonder if you would get the same cease and desist if you posted the unmodified USB Stack in parallel to your own custom sources, such that the user would have to combine them on their own.  This would merely be an unmodified archival of the Microchip source.

I don't have all the details, but I think that you probably took one of their CDC or other device main files and altered it slightly, which might be the only problem.  Instead, if you write the main.c from scratch (it's a fairly small file in some respects), you might be safe.

For my clients, I provide sources where the Microchip files are in a separate directory from my own sources, and then I instruct them to download the USB Stack on their own.  The MPLAB project does not build unless both directories are there.  This also makes it very easy to swap out different versions of the USB Stack.

I am not a lawyer, so I'm really only guessing here based on past experience.  (and I did once get a cease and desist letter from a developer who's program I hacked - he was actually nice enough to contact me separately from the legal letter to say that he wasn't angry, but just needed a clear separation between his work and my work to protect himself)

Re: microchip usb stack

Reply #4
In those cases where a Microchip library is required, I think the best solution is to simply supply patch files against the Microchip library. At least one commercial operation does this.

The only downside is that Microchip do not maintain a comprehensive list of old library versions (despite some statements to the contrary on their website). I imagine though that you could always:

1) try your favourite search engine;
2) ask on a  forum;
3) request the version you need from Microchip support.

Re: microchip usb stack

Reply #5
[quote author="Trev"]In those cases where a Microchip library is required, I think the best solution is to simply supply patch files against the Microchip library. At least one commercial operation does this.[/quote]Just for reference purposes, who is that commercial developer?

Re: microchip usb stack

Reply #6
It's not just modified code, we cannot even host their installer that includes the click through license (even for old versions they no longer host). They were very clear, I asked about every possibility I could imagine. I don't even want to put out patches that might contain a bit of their copyright code in the -- lines.

They have every right to exercise their copyright that way. I'll just do my best to avoid their code whenever possible.
Got a question? Please ask in the forum for the fastest answers.

Re: microchip usb stack

Reply #7
[quote author="ian"]I asked about every possibility I could imagine.[/quote]Good to know.  Well, it's not good news, but at least you asked...

Re: microchip usb stack

Reply #8
[quote author="rsdio"]
Just for reference purposes, who is that commercial developer?
[/quote]

Code: [Select]
trev@shadow [/tmp] $ unzip -l pic-web_revB_patch_V5_0.zip
Archive:  pic-web_revB_patch_V5_0.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  12-23-2009 17:45   PIC_WEB_RevB_Patch/patch/
      772  05-18-2009 08:33   PIC_WEB_RevB_Patch/patch/apply-patch.bat
  1451738  05-21-2009 09:01   PIC_WEB_RevB_Patch/patch/olimex-pic-web.patch
   112128  05-15-2007 00:19   PIC_WEB_RevB_Patch/patch/patch.exe
     3590  05-21-2009 09:06   PIC_WEB_RevB_Patch/patch/README.txt
        0  12-23-2009 17:45   PIC_WEB_RevB_Patch/pre-built/
    24576  01-22-2008 00:32   PIC_WEB_RevB_Patch/pre-built/Microchip Ethernet Discoverer.exe
    36337  05-21-2009 09:12   PIC_WEB_RevB_Patch/pre-built/MPFSImg2.bin
   341881  05-21-2009 08:28   PIC_WEB_RevB_Patch/pre-built/TCPIP Demo App-C18.hex
---------                     -------
  1971022                     9 files

Re: microchip usb stack

Reply #9
Thanks for the explanation. I went trough the licence many times and it does not show this, but who cares what's written if they are trigger light.. better to avoid their code then as you are trying to do :). The major reason I ask is that they don't keep backwards compatibility with their own code so for every version they put out you have to modify your code, and if you get one version, fix it and make your code work with it - it will not work as after few months the base you patched is no longer available ... I had no idea they have that state of mind, I will have to rethink use of PIC's in the future because of this, I'm not big fan of atmel but they do have this sorted out + fully working gcc compiler for both small 8bit mcu's all up to cortex cores ... TI is closed anyhow so only what comes with gcc is available and that's anyhow open source so with msp430 I also don't have a problem .. looks like my pic loving days are over

Re: microchip usb stack

Reply #10
Naaah, no need to stop loving PICs. :) Actually there are some open source projects being developed because of this situation. Remember, "Necessity is the mother of invention" :)

Hopefully Microchip will learn to support open-source community or they are doomed. There are many many makers-hackers-diy people out there.

Re: microchip usb stack

Reply #11
[quote author="tayken"]
Naaah, no need to stop loving PICs. :)
[/quote]

It is not easy, I have a pretty big stock of pic's at home, but from time to time I get *very* frustrated by some decisions microchip make. (just look at pk3 - they said they will provide stand alone gui over a year ago, maybe already 2 years ..)


[quote author="tayken"]
Actually there are some open source projects being developed because of this situation. Remember, "Necessity is the mother of invention" :)
[/quote]
toolchain is not open source (and the one they pushed recently ain't really out there yet) and still most projects are around "small" pic's.

[quote author="tayken"]
Hopefully Microchip will learn to support open-source community or they are doomed. There are many many makers-hackers-diy people out there.
[/quote]

yeah, they probably will, if bunch of ppl stop using it. problem is that there's no great alternative. I use msp430 a lot but they are all smd only and in those tiny packages I hate soldering but I use them more and more, atmel has good hardware but the community is "weird", I tend not to use devices where fanatics rule community... the "mine device is better then any other, I know that, no need to look at the other one" does not bring any confidence in decisions those open source projects made..

anyhow, we are waaaaaaaaaaaaaay of topic here, no intention to start a flame

Re: microchip usb stack

Reply #12
Take a look at XMOS and their license policy for the code and libraries (including a USB library and a TCP/IP stack) they provide for free ... along with Atmel's policy it's as open as it gets in the industry today ... their chips are a real alternative to PIC24, PIC32 and ARM MCUs... and beyond (alternative to FPGAs).

Re: microchip usb stack

Reply #13
[quote author="tayken"]
Actually there are some open source projects being developed because of this situation.
[/quote]

I got a little teaser, I just got my own usb stack running on pic18f4550.
Only enumeration right now, I need to implement a class driver as well.
I have started looking at cdc-acm (usbserial).
And the api is in fast flux so I'm not ready to share just yet.

But probably soon I'll share a first version. Intention is CC-0 as I'm doing it just to challenge myself.
The goal is to implement a bootloader based on the dfu class.

Re: microchip usb stack

Reply #14
[quote author="arhi"]I will have to rethink use of PIC's in the future because of this, I'm not big fan of atmel but they do have this sorted out + fully working gcc compiler for both small 8bit mcu's all up to cortex cores ...[/quote]The situation with the PIC is not perfect, but the AVR is far from perfect itself.  For commercial developers, the Microchip USB Stack license offers no problems at all.  In some respects, the USB hardware in the PIC is superior to the AVR (although probably not in every model), so the better performing hardware might be chosen over the more "open" hardware.
Quote
TI is closed anyhow so only what comes with gcc is available and that's anyhow open source so with msp430 I also don't have a problem .. looks like my pic loving days are over
TI is not completely closed when it comes to some of their processors.  The TMS320VC55xx has some open source DSP routines called dsplib, although I've never found any contributions to the code outside TI.

Many of your complaints are about open source tools, not open source libraries.  I think there is a huge difference between tools and firmware source.  While it would be ideal if all tools were open, or at least the compiler/linker, that's still less critical than having all of the library source that gets compiled into your device firmware.

I'm not trying to imply that your complaint is invalid, just that it's a different complaint than the issues with the Microchip USB Stack distribution license.