The Bluetooth stack implementation on FRDM-KL25Z evaluation kit demonstrates how a low-cost ARM Cortex M0+ board can support full Bluetooth connectivity via USB host. Freedom KL25Z from Freescale Semiconductor is widely used in evaluation kit development projects — and this Bluetooth stack implementation on FRDM-KL25Z evaluation kit guide covers USB Bluetooth host integration, 3-axis accelerometer streaming, and RGB LED PWM control in a single demo. Embien's Digital Transformation Services team applies this evaluation kit development expertise to accelerate embedded product development across IoT and industrial segments.
| In the demo, an Android application connects to the Bluetooth device on the FRDM board. After connection, the board transmits accelerometer readings to the app, which renders a 3D image of the board using OpenGLES. The app also drives the tri-color LED in varying colors using PWM. This guide covers the hardware setup and software implementation — customizable for IoT, academics, and other embedded applications built on development kits and sbc platforms. Embien's Semiconductor Development Support team brings deep SoC-level knowledge to development kits and sbc-based product development. |
Evaluation Kit Development: Hardware Setup
This Bluetooth stack implementation on FRDM-KL25Z evaluation kit relies on the board's USB OTG capability. A key step in any such evaluation kit development project is interfacing the Bluetooth USB dongle to the board. To enable use of low-cost devices, the demo uses USB Bluetooth dongles available in local stores for under 2 dollars — devices that typically use a CSR chipset module inside.
For connecting the dongle, follow the procedure outlined in this MCUOnEclipse blog. Another option is to modify header "J21" (refer sheet3 in Freedom KL25Z schematics, document number SCH-27556 or SPF-27556).
EVK Board: Accelerometer and LED Pin Mapping
On this evk board, the on-board MMA8451Q accelerometer is connected to the KL25 MCU via I2C0 on pins PTE24 and PTE25. The tri-color LED uses PWM outputs — Red LED to TPM2_CH0 (PTB18), Green to TPM2_CH1 (PTB19), and Blue to TPM0_CH1 (PTD1). Board power is supplied via the openSDA USB Mini-B connector "J7". This evk board pinout is summarized below:
| S.NO | Signal Name | Pin Number |
| 1 | I2C0_SDA | PTE25 |
| 2 | I2C0_SCL | PTE24 |
| 3 | Red LED | PTB18 |
| 4 | Green LED | PTB19 |
| 5 | Blue LED | PTD1 |
Software: Bluetooth Stack Layers
The firmware for this Bluetooth stack implementation on FRDM-KL25Z evaluation kit first initializes all hardware interfaces. The USB stack prepares the OTG controller for host operation, enumerates the attached device, and — once a valid Bluetooth dongle is detected — brings up the full stack: HCI, L2CAP, RFComm, and higher layers. Once a logical channel is established between the FRDM-KL25 and the dongle, data is transferred in a custom frame format.
Upon a change in accelerometer reading, the 3-axis data is read and sent to the Android application over Bluetooth with a header field prepended and footer appended. The application calculates position and renders the 3D board image using OpenGLES. On LED colour change commands from the user, data is sent in custom frame format to the board. The firmware decodes it and drives the three LED components at varying brightness values using PWM modulation.
Embedded IoT Solutions for Smart Devices
This demo is a practical example of embedded IoT solutions for smart devices: accelerometer data streams wirelessly over Bluetooth; the Android app provides bidirectional control and live visualization. The firmware architecture is modular and directly applicable as embedded IoT solutions for smart devices — including activity trackers, health monitors, and remote sensor nodes built on similar development kits and sbc platforms.
Demo
The demo of the Bluetooth stack implementation on FRDM-KL25Z evaluation kit — showing accelerometer-driven 3D visualization and PWM LED control — is available in the video below.
Source Code
All firmware needed to run this Bluetooth stack implementation on FRDM-KL25Z evaluation kit can be downloaded from our downloads page. With BLE increasingly used in IoT applications — activity trackers, health bands, and more — this evaluation kit development project demonstrates a fast path to Bluetooth-enabled products using low-cost USB dongles and ARM Cortex M0+ boards.
About Embien Technologies: Embien Technologies is a leading provider of embedded design services for the Semi-conductor, Industrial, Consumer and Health Care segments. Our extensive experience in working with wireless technologies like Bluetooth, Bluetooth Low Energy (Bluetooth Smart), RFID, ZigBee, WiFi etc enables us to provide solutions quickly at an unmatched quality and competitive price point. Feel free to contact us for any of your connectivity, OpenGL, mobile application or embedded product development requirements.

