To add to bmargulies's answer you need to consider that firmware is a special breed of software.
Firmware, by it's definition, runs on special-purpose hardware. This hardware platform may have highly proprietary components (ASICs for example, or special sensors, etc). Firmware is very intimately aware of that hardware, and usually developed with access to very proprietary information such as:
- Confidential datasheets provided to the hardware manufacturer under an NDA.
- Encryption keys (for streaming data for example)
- Access to the full schematics of the device
- Knowledge of the data format for calibration tables, and how to apply them.
- Software and/or hardware patent licenses
One example would be a complex IC created by a third party vendor and used in the product. I have worked on systems where those chips are supplied with a combination of draconian license terms and a vendor-specific access key.
So, if you are trying to provide an open-source replacement for the existing firmware, you either need access to much of the same information - or to reverse engineer it. If you are trying to repurpose the hardware, you still need much of this information.
In which case, in order to create your own firmware, you are almost certainly going to breach the OEMs patents or copyrights, or those of various components on the target boards. You are also at risk from claims under the DMCA.
While the source lives in your private space, you are getting security through obscurity. The moment you publish your source, you potentially lay yourself open to lawsuits.
So, while it's possible to create and publish open source firmware for a proprietary platform, pragmatically it is so risky as to be highly improbable.