I'm writing a program using the STmicroelectronics STM32_USB_Device_Library. I'd like to make this program open source, preferably under a GPL license, though I might consider MIT or BSD. This program is written by me on my lonesome, so there's no restrictions regarding my employer or other parties.

However, the STM32_USB_Device_Library is covered by the SLA0044 license. This license has a very specific clause against subjecting this software to any "Open Source Terms":

  1. No use, reproduction or redistribution of this software partially or totally may be done in any manner that would subject this software to any Open Source Terms. “Open Source Terms” shall mean any open source license which requires as part of distribution of software that the source code of such software is distributed therewith or otherwise made available, or open source license that substantially complies with the Open Source definition specified at www.opensource.org and any other comparable open source license such as for example GNU General Public License (GPL), Eclipse Public License (EPL), Apache Software License, BSD license or MIT license.

I fear that this clause might at least be (L)GPL-incompatible, as those licenses enforce some "open source terms" upon the final binary (that being the requirement to release the source code), but I'm not sure if that's what this clause means. There's also the following clause, which specifically denies the GPL's freedom 0, that might cause similar compatibility issues:

  1. This software or any part thereof, including modifications and/or derivative works of this software, must be used and execute solely and exclusively on or in combination with a microcontroller or microprocessor device manufactured by or for STMicroelectronics.

In practice, assuming I'm fine with applying clause 4 to the resulting binary, what does this mean? Can I release my (L)GPL-licensed project (or program using (L)GPL libraries) using this library? Is there any difference between GPL and LGPL in this scenario? What about if I were to license my code to MIT or any other more permissive license? Can I ship this library's source with the program sources?

1 Answer 1


The SLA0044 is a zero-cost licence; it permits redistribution and use without payment, but it doesn't give users most of the freedoms associated with free software. It is also, as you have pointed out, aggressively keen to stay that way.

As I read it, you can't meaningfully release your code under GPL, since your code requires the library to build into a binary. You can say you're doing so, but since you are forbidden to permit your users to exercise their advertised rights to use the resulting program for any purpose, or to redistribute its Complete Corresponding Source under GPL, you won't in fact be doing so. It would simply be confusing, and should be avoided.

A non-copyleft free licence (BSD, Apache, MIT) or a per-file copyleft licence (MPL) would probably be OK to distribute your code under, alongside the library, but you still have to be extremely clear with your users that there's a poison pill embedded in it, in the form of this non-free library. I think you would do better to distribute your code free and clear under one of the licences above, without the library, and include a big pointer to the library and tell people they need to download it themselves. Make it clear why.

I can only speculate why the manufacturers have chosen to license their library in this way, but if it's an essential component of any software for this chip, and if there's no free software equivalent, it seems to me that the chip is unsuitable for free software, and should be avoided.

  • Thankfully, the library isn't required to make this manufacturer's chips function, as the basic hardware-abstraction libraries are BSD-3-Clause, and the hardware registers required to implement your own are well-documented. This USB device library is separate and just greatly simplifies the process of implementing the required portions of the USB protocol. I'll consider writing my own USB library, but since redistribution and modification is allowed, this might do for now. I will likely be using other (L)GPL libraries, but knowing they're not per-se incompatbile puts my doubts to rest. Thanks!
    – mid_kid
    Commented Sep 30, 2021 at 15:07
  • Oh, I forgot. Can you try to explain what "subjection to open source terms" would mean in this legal text, then? If it's not the use of the library within open source code, what does it mean? (Do I have to edit my question for this?)
    – mid_kid
    Commented Sep 30, 2021 at 15:11
  • 3
    You won't be able to use other GPL libraries, since that would oblige you to release the whole work under GPL, which you cannot do; LGPL should be OK, though. I cannot be sure what the phrase you quote means, but I suspect they're explicitly forbidding the distribution of their library under any kind of open-source licence (most specifically, under any licence lacking the prohibition in s4); they wouldn't be the first hardware vendor to be terrified that their nice software would be used on Chinese clones, thus depriving them of a sale.
    – MadHatter
    Commented Sep 30, 2021 at 15:25
  • Are you sure LGPL is OK? There's no practical way to achieve shared linking on a microcontroller, as you're expected to flash the program memory as a whole (which is read-only, and ususally magnitudes bigger than the available RAM), unless you write your own elaborate mechanism, so it should be assumed to not be an option. Your answer also states that GPL can't "meaningfully" be used in combination with it, not that it can't be used at all. Maybe it could be clarified.
    – mid_kid
    Commented Sep 30, 2021 at 15:50
  • 1
    Your original question posited a binary compiled from your original code, plus the non-free STM32_USB_Device_Library; my point about GPL related to the license for your code only. You then in a comment suggest that you are linking in other freely-licensed libraries in addition, and I responded to that off the cuff; if you want to ask in more detail about that, I'd suggest a new question. LGPL allows for static linking, provided you provide a (non-free) compiled version of your code + STM library, suitable for relinking to another version of the LGPL'ed libraries.
    – MadHatter
    Commented Sep 30, 2021 at 19:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.