As a firmware developer, I’ve always been on the lookout for ways to streamline my workflow. Last year, when BLE projects started popping up in our portfolio, I knew we had to find a way to integrate Nordic’s nRF51822 chip into our existing Visual Studio-based simulation framework. The challenge was daunting, but the results have been nothing short of incredible!
The journey began with exploring the Nordic SDK’s ble_s110_serialization example. It was clear that the S110-Serialization approach was the way to go, but getting it to work seamlessly in Visual Studio required some creative problem-solving. Here’s a quick rundown of the hurdles we faced and how we overcame them:
- Target Includes Compatibility: The SDK lacked support for Visual Studio’s C-compiler. After some tweaking, we managed to align the hardware-related defines with our setup.
- C89 Compatibility: Visual Studio 2012 doesn’t support C99, so we had to adjust variable definitions in the S110-Serialization code to fit within C89 standards.
- Extending RPC Functionality: We identified missing S110 functions in the RPC code and added them, ensuring the SDK was prepared for future enhancements.
- Custom HCI/SLIP Implementation: The existing HCI code couldn’t handle immediate transmit feedback, so we developed our own solution to keep everything in sync.
- Dongle Reset Mechanism: Ensuring both ends reset simultaneously was crucial. We introduced a special SLIP sequence to trigger resets on the dongle.
The payoff? A fully functional BLE simulation environment where the SoftDevice commands are serialized and sent to the USB Dongle. The response times are impressive, and the system’s reliability has been top-notch.
I’d like to extend a heartfelt thank you to Nordic for their well-crafted SDK and the S110-RPC library. If there’s interest, we’d be happy to share more details or even collaborate on integrating some of these fixes into future SDK versions. It’s been an exciting journey, and I’m eager to see where this takes us next!