Nikolai Kozak

About
Contact Me

Designer and engineer interested in computational archaeology: recovering abandoned computing paradigms and rebuilding them with modern tools. 

Also a wooden boatbuilder. 

Former Recurser.

Currently ITP @ NYU 
e
First solid signs of life from the startup program.
The custom board for the DA14531 that was used in this project. It included a coin-cell battery module and a JST connector for ease of use.
This project started as a custom NRF52805 board, but its BGA arrangement proved too expensive to manufacture as a dev board.


SmartSnippets No More



Building an open-source development toolchain for the DA14531 BLE microcontroller, bypassing Renesas's proprietary IDE.

The Problem


The DA14531 is a capable Bluetooth Low Energy chip, but Renesas locks developers into their proprietary SmartSnippets Studio IDE - an Eclipse-based environment with hardcoded paths, Windows-centric tooling, and opaque build systems.

I needed to program this chip and didn't want to use their IDE.

The Journey


Phase 1: Understanding the Protocol
The DA14531 uses single-wire UART for programming — a half-duplex protocol where TX and RX share one line. Before writing any code, I needed to understand what the chip was saying.

Tools used:
- Rigol oscilloscope for signal capture
- Saleae logic analyzer for protocol decoding
- Arduino Zero for initial experiments

The chip sends a two-byte boot sequence, then waits for a response. Miss the timing window and it boots from internal memory instead.

Phase 2: Building the Passthrough
The goal was to create a serial passthrough that could relay data between my computer and the DA14531, handling the half-duplex protocol correctly.

The challenge was echo cancellation. In half-duplex mode, when you transmit, you also receive your own data. The passthrough needs to suppress this echo.

The solution was register-level UART control on an STM32 "Bluepill":

USART1->CR1 &= ~USART_CR1_RE;  // Disable receiver during transmit
HalfDuplexSerial.write(byte);
while (!(USART1->SR & USART_SR_TC));
USART1->CR1 |= USART_CR1_RE;   // Re-enable receiver

Phase 3: The Flashing Script
With hardware working, I wrote a Python script to handle the flashing protocol:
- XOR checksum calculation (the SDK documentation was wrong — they described sum, not XOR)
- Flow control with 64-byte chunks and 50ms delays
- Interactive port selection

After a few weeks of debugging, the first ACK (`0x06`) appeared in the logic analyzer.

Phase 4: Escaping the SDK
Renesas's SDK is a maze of Eclipse project files, absolute paths, and undocumented dependencies. Getting it to compile outside their IDE seemed unlikely.

The breakthrough was a community CMake template (`stawiski/da14531-cmake-template`) that properly wraps the SDK. With this foundation, I could build firmware from the command line.

Final result: 27KB firmware, compiled with ARM GCC, flashed via my Python script, running on the DA14531.

Technical Details


- Target: DA14531 (Renesas/Dialog BLE SoC)
- Passthrough: STM32F103 "Bluepill" with half-duplex UART
- Flashing: Custom Python script with flow control
- Build: CMake + ARM GCC 14.3
- Debug: Oscilloscope + Logic analyzer

Links


- DA14531 Datasheet: [Renesas](https://www.renesas.com/us/en/products/wireless-connectivity/bluetooth-low-energy/da14531-smartbond-tiny-module)
- CMake Template: [github.com/stawiski/da14531-cmake-template](https://github.com/stawiski/da14531-cmake-template)