NXP Zigbee JN516X JN517x JN518X 用vsCode studio 环境开发编译
前言
官方推荐是用Beyond IDE开发,不方便,搭建开发环境,安装插件基本不是成功的。
i have a problem to install the plugin Zbee pro configuration editorwith sdk JN-4141
the version of beyond studio is : Build 1308sdk jn 4170 is : Build Number 1745I've reinstalled it twice in the default path and on D drive, and it still doesn't work.when i install the plugin (ZB pro configuration edition 2.0.0), i have the message error :Cannot complete the install because one or more required items could not be found.Software being installed: NXP ZBPro Configuration Editor 2.0.0 (com.jennic.sdk.zbpro.external.feature.feature.group 2.0.0)
Missing requirement: ZBPro Config Edit Support 2.0.0 (com.jennic.zps.configeditor.edit 2.0.0) requires 'bundle org.eclipse.emf.edit 0.0.0' but it could not be found
Cannot satisfy dependency:
From: NXP ZBPro Configuration Editor 2.0.0 (com.jennic.sdk.zbpro.external.feature.feature.group 2.0.0)
To: com.jennic.zps.configeditor.edit [2.0.0]
准备
安装visual code studio(microsoft官网下载, 安装过程过于简单不再赘述)
安装EIDE插件
下载SKD(JN516x---JN-SW4170,Jn517x---JN-SW-4270) 安装后, 复制到NXP_JN工作目录(比如E:bstudio_nxpworkspace),不用要中文, 路径不能太深。
具体方法,请参考:【ZigBee 系列】|NXP-JN5169 ZigBee 3.0 开发环境搭建及编译-谷动谷力 (sunsili.com)
下载NXP Zigeeb工程源码示例
( 参考: NXP Zigbee JN5169 软件开发流程-SDK下载 及 AN 介绍与 ..., 有链接 下载 相关的例程)
如下:
更多内容请参阅:NXP Zigbee JN5169 软件开发流程-SDK 及 AN 介绍与选择-谷动谷力 (sunsili.com)
实战操作
解压 源码JN-AN-1219JN-AN-1219-Zigbee-3-0-Controller-and-Switch到NXP_JN工作目录(比如E:bstudio_nxpworkspace),不用要中文, 路径不能太深。与在刚才SDK存放在同一目录。方便修改Makefile SDK 相对路径。
在“资源资源管理器” -右键“用vsCode打开”
或用vsCode“文件”-“打开文件夹” 打开JN-AN-1219JN-AN-1219-Zigbee-3-0-Controller-and-Switch文件夹
打开Eide msys bash 终端
到子工程目录下的build 下
输入命令:
make JENNIC_CHIP=JN5169 JENNIC_CHIP_FAMILY=JN516x REMOTE=ColorSceneController DR=DR1199 TRACE=1 all
或修改Makefile
#User definable make parameters that may be overwritten from the command line
选择芯片型号系列 板型 SDK
# Default target device is the JN5179
JENNIC_CHIP ?= JN5179 #芯片型号
JENNIC_CHIP_FAMILY ?= JN517x #系列
ifeq ($(JENNIC_CHIP_FAMILY),JN517x)
ENDIAN ?= LITTLE_ENDIAN
endif
ifeq ($(JENNIC_CHIP_FAMILY),JN516x)
JENNIC_SDK ?= JN-SW-4170
JENNIC_PCB ?= DEVKIT4
else
ifeq ($(JENNIC_CHIP_FAMILY),JN517x)
JENNIC_SDK ?= JN-SW-4270
JENNIC_PCB ?= DEVKIT5
endif
修改工程名(目标)# Application target name
TARGET = EH_Switch #工程名
CFLAGS += -DPDM_USER_SUPPLIED_ID
CFLAGS += -DPDM_NO_RTOS
CFLAGS += -DEH_Switch
PDM_BUILD_TYPE = _EEPROM
CFLAGS += -DPDM$(PDM_BUILD_TYPE)
修改Makefile
定位好SDK、工程路径(没配置好,编译会报错)
# Use if application directory contains single target
SDK_BASE_DIR = $(abspath ../../../../sdk/$(JENNIC_SDK))
APP_BASE = $(abspath ..)
APP_BLD_DIR = $(APP_BASE)/Build
APP_SRC_DIR = $(APP_BASE)/Source
APP_COMMON_SRC_DIR = $(APP_BASE)/../Common/Source
MMAC_DIR = $(APP_BASE)/../../Components/MMAC/Include
LIB_DIR = $(APP_BASE)/../Components/Library
ZIGBEE_COMMON_SRC = $(COMPONENTS_BASE_DIR)/ZigbeeCommon/Source
make clean
编译前先clean
make clean
编译
make -j8(8线程,只要电脑支持线程多,比IDE编译快多了)