A quick FYI for Apache Mynewt's 0.9 release...
http://mynewt.apache.org/
http://mynewt.apache.org/download/
Includes world's first open source (controller level) Bluetooth Low Energy stack for MCUs. The first ports were to Nordic Semiconductor's nRF52 and nRF51. Specific to the OS with BLE (4.2), the open source approach has obvious benefits to developers: access to source code; better debugging through setting breakpoints, avoiding stack smashes, no stolen interrupts, etc.; direct access to peripherals for granular power control; better, precise configurability of concurrent connections and flexibility across central and peripheral roles. The project aims to also have timely Bluetooth 5 support.
The OS is composable via a modern, Go-like build and package management tool. Components include secure boot loader, flash file system and TLV storage mechanisms, rich logging infrastructure, circular buffering schemes, and BLE! Scripting languages such as Javascript and Python are currently being worked.
The community welcomes your participation and feedback!