谷动谷力
标题: NXP Zigbee JN516X JN517x JN518X 用vsCode studio 环境开发编译 [打印本页]
作者: sunsili 时间: 2023-4-9 20:31
标题: NXP Zigbee JN516X JN517x JN518X 用vsCode studio 环境开发编译
NXP Zigbee JN516X JN517x JN518X 用vsCode studio 环境开发编译
前言
官方推荐是用Beyond IDE开发,不方便,搭建开发环境,安装插件基本不是成功的。
i have a problem to install the plugin Zbee pro configuration editor
with sdk JN-4141
the version of beyond studio is : Build 1308
sdk jn 4170 is : Build Number 1745
I'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]
以上摘自NXP社区,碰到这样问题的用户非常多, 我也碰到, 于是想到用VSCODE。
准备
安装visual code studio(microsoft官网下载, 安装过程过于简单不再赘述)
安装EIDE插件
下载SKD(JN516x---JN-SW4170,Jn517x---JN-SW-4270) 安装后, 复制到NXP_JN工作目录(比如E:\bstudio_nxp\workspace),不用要中文, 路径不能太深。
具体方法,请参考:【ZigBee 系列】|NXP-JN5169 ZigBee 3.0 开发环境搭建及编译-谷动谷力 (sunsili.com)
下载NXP Zigeeb工程源码示例
( 参考: NXP Zigbee JN5169 软件开发流程-SDK下载 及 AN 介绍与 ..., 有链接 下载 相关的例程)
如下:
Coordinator:
适合应用场景:网关。
JN-AN-1216-Zigbee-3-0-IoT-ControlBridge
JN-AN-1217-Zigbee-3-0-Base-Device
Router:
适合应用场景:长供电应用,例如各类灯应用、插座。
JN-AN-1218-Zigbee-3-0-Light-Bulb
JN-AN-1217-Zigbee-3-0-Base-Device
End Device:
适合应用场景:低功耗休眠应用、各类传感器应用、开关控制器,例如温湿度传感器、烟雾报警器等。
JN-AN-1219-Zigbee-3-0-Controller-and-Switch
JN-AN-1220-Zigbee-3-0-Sensors
JN-AN-1217-Zigbee-3-0-Base-Device
Test Code:
适用于测试射频参数,功耗等硬件指标。
JN-AN-1172-JN516x-Customer-Module-Evaluation-Tool
更多内容请参阅:NXP Zigbee JN5169 软件开发流程-SDK 及 AN 介绍与选择-谷动谷力 (sunsili.com)
实战操作
解压 源码JN-AN-1219\JN-AN-1219-Zigbee-3-0-Controller-and-Switch到NXP_JN工作目录(比如E:\bstudio_nxp\workspace),不用要中文, 路径不能太深。与在刚才SDK存放在同一目录。方便修改Makefile SDK 相对路径。
在“资源资源管理器” -右键“用vsCode打开”
或用vsCode“文件”-“打开文件夹” 打开JN-AN-1219\JN-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 -j8(8线程,只要电脑支持线程多,比IDE编译快多了)
复制代码
作者: 鸣涧 时间: 2024-4-14 12:26
JN-AN-1907... Makefiles配置
- TARGET = JN-AN-1907-Zigbee-Valve-Controller-JN5169
- DEV_TYPE = ValveController
- # Note: Target name must be the same as the subfolder name
- ##############################################################################
- #User definable make parameters that may be overwritten from the command line
- # Default target device is the JN5148
- JENNIC_CHIP ?= JN5169
- ##############################################################################
- # Default DK2 development kit target hardware
- JENNIC_PCB ?= DEVKIT4
- ##############################################################################
- # Select the network stack (e.g. MAC, ZBPRO)
- JENNIC_STACK ?= MAC
- ##############################################################################
- # Debug options define DEBUG for HW debug
- #DEBUG ?=HW
- #
- #
- # Define which UART to use for debug
- DEBUG_PORT ?= UART1
- ##############################################################################
- # Define TRACE to use with DBG module
- TRACE ?= 1
- ##############################################################################
- # Define configuration
- ifeq ($(FLOW_CONTROL), NO_FLOW_CONTROL)
- CFLAGS += -DENABLE_NO_FLOW_CONTROL
- BIN_SUFFIX = _NO_FLOW_CTRL
- endif
- ifeq ($(FLOW_CONTROL), HW_FLOW_CONTROL)
- CFLAGS += -DENABLE_HW_FLOW_CONTROL
- BIN_SUFFIX = _HW_FLOW_CTRL
- endif
- ifeq ($(FLOW_CONTROL), HW_SW_FLOW_CONTROL)
- CFLAGS += -DENABLE_HW_SW_FLOW_CONTROL
- BIN_SUFFIX = _HW_SW_FLOW_CTRL
- endif
- ##############################################################################
- ##############################################################################
- ##############################################################################
- # Path definitions
- # Select definitions for either single or multiple targets
- # Use if application directory contains multiple targets
- SDK_BASE_DIR = $(abspath ../../../sdk/JN-SW-4163)
- LZSTACK_BASE_DIR = $(abspath ../../..)
- APP_BASE = $(abspath ../..)
- APP_BLD_DIR = $(APP_BASE)/$(DEV_TYPE)/Build
- APP_SRC_DIR = $(APP_BASE)/$(DEV_TYPE)/Source
- APP_COMMON_SRC_DIR = $(APP_BASE)/Common/Source
- JENOS_DIR = $(LZSTACK_BASE_DIR)/LZStackV5/JenOS
- STACK_DIR = $(LZSTACK_BASE_DIR)/LZStackV5/stack
- STACK_MAC_DIR = $(LZSTACK_BASE_DIR)/LZStackV5/stack/mac
- STACK_NWK_DIR = $(LZSTACK_BASE_DIR)/LZStackV5/stack/nwk
- STACK_ZDO_DIR = $(LZSTACK_BASE_DIR)/LZStackV5/stack/zdo
- STACK_APS_DIR = $(LZSTACK_BASE_DIR)/LZStackV5/stack/aps
- STACK_COMMON_DIR = $(LZSTACK_BASE_DIR)/LZStackV5/common
复制代码
欢迎光临 谷动谷力 (http://bbs.sunsili.com/) |
Powered by Discuz! X3.2 |