Skip to content
PlatformIO build environment for the NXP JN516x ZigBee SoC
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Unofficial PlatformIO support for NXP's Jennic ZigBee family of chips (JN516x)

Requires NXP BeyondStudio Toolchain & The Jennic ZigBee SDK. Note that most of the SDK is pre-compiled and closed-source, but the PlatformIO buildscript handles linking the correct libraries and compiling the open source parts.

This has only been tested on the JN5168 platform with the ZLL DimmableLight example!!

Non-ZLL ZigBee samples may or may not build, though I have replicated most of the build logic.


Download Packages from NXP

Extract packages into PlatformIO home

  1. Extract JN-SW-4141_BeyondStudio/sdk/Tools/ba-elf-ba2-r36379/ into $PIOHOME/packages/toolchain-nxp-beyondstudio

  2. Add package.json:

    "description": "NXP BeyondStudio",
    "name": "toolchain-nxp-beyondstudio",
    "system": [
    "url": "",
    "version": "1.0.36379"
  1. Extract JN-SW-4168_SDK into $PIOHOME/packages/framework-jennic

  2. Add package.json:

    "name": "framework-jennic",
    "description": "Jennic ZigBee SDK for JN51xx chips",
    "url": "",
    "version": "1.0.1620"
  1. Extract JN-SW-4107 JN51xx Production Flash Programmer v1614 into $PIOHOME/packages/tool-jn51prog

  2. Add package.json:

    "description": "NXP Flash Programmer for Jennic JN51xx chips",
    "name": "tool-nxp-jn51prog",
    "system": [
    "url": "",
    "version": "1.0.0"

Building sample ZLL project

Download sample from:

ZigBee Light Link Solution Application Note (JN-AN-1171)

Add platformio.ini to the project root:

default_envs = dimmable-light
src_dir = # (Workspace Root)
include_dir = # (Workspace Root)

platform = nxp-jennic
framework = jennic
board = jn5168-generic

# Extra build flags required for configuring the platform
conf_target = Light_DimmableLight
conf_zps    = Common\Source\app.zpscfg
conf_os     = Common_Light\Source\App_ZLL_Light_JN516x.oscfgdiag

# Select files to compile
src_filter =

# Flags applied only to project source files (not SDK)
src_build_flags =

build_flags =
    -I./Light_DimmableLight/Source  # ZCL SDK needs zcl_options.h
    -DDR1175  # DriverBulb driver
#    -DRGB  # For RGB targets

Add your encryption keys 😉

Common_Light/Source/zpr_light_node.c : s_au8ZllLnkKeyArray[]
Common_Light/Source/app_light_commission_task.c : sMasterKey[], ZLL_SUPPORTED_KEYS
Common_Controller/Source/app_remote_comission_task.c : sMasterKey[], ZLL_SUPPORTED_KEYS

Compile with PlatformIO:

> pio run
PLATFORM: NXP Jennic ZigBee Platform 1.0.1620 > JN5168 Generic Module
HARDWARE: JN5168 32KB RAM, 256KB Flash
 - framework-jennic 1.0.1620 
 - tool-nxp-jn51prog 1.0.0
 - toolchain-nxp-beyondstudio 1.0.36379
Conf Target: Light_DimmableLight
Conf ZPS:    $PROJECT_SRC_DIR\Common\Source\app.zpscfg
Conf OS:     $PROJECT_SRC_DIR\Common_Light\Source\App_ZLL_Light_JN516x.oscfgdiag
JENNIC_MAC:   MiniMacShim
LIBS:    ['Aes', 'HardwareApi', 'MicroSpecific', 'Boot', 'Recal', 'BoardLib', 'DBG', 'MiniMac', 'MiniMacShim', 'MMAC', 'ZPSAPL']


Building .pio\build\dimmable-light\firmware.bin
RAM:   [========  ]  77.7% (used 25460 bytes from 32768 bytes)
Flash: [======    ]  59.9% (used 157121 bytes from 262144 bytes)


pio -t upload

Hardware Configuration:

Pin Description
VDD 3.3V
RST# Pull low to reset
PRG# Hold low while resetting to enter bootloader
D13 DimmableLight PWM Output

Proof - connected to HomeAssistant via Zigbee2Mqtt!


This project is not affiliated with NXP in any way. It is an unofficial port of the provided makefiles, and I provide no guarantee that it will work correctly.

Inspired by the great work by PeeVeeOne

You can’t perform that action at this time.