要在Androidq下编译efr32mg21,花了2天时间,分享下
拿到源码后,先在linux的环境下编译成功

sudo apt-get install libreadline-dev
sudo apt-get install libncurses5-dev
cd app/builder/Z3GatewayHost
make clean
make

编译成功后,把源码放在external/efr32mg21/下,结构如下

参考app/builder/Z3GatewayHost/Makefile,创建Android.bp文件,内容如下

// Copyright (C) 2018 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.cc_binary {name: "efr32mg21",include_dirs: ["external/efr32mg21/protocol/zigbee/app/framework","external/efr32mg21/protocol/zigbee/app/framework/../..","external/efr32mg21/protocol/zigbee/app/framework/../../stack","external/efr32mg21/protocol/zigbee/app/framework/../util","external/efr32mg21/protocol/zigbee/app/framework/../util/common","external/efr32mg21/protocol/zigbee/app/framework/../util/ezsp","external/efr32mg21/protocol/zigbee/app/framework/../util/serial","external/efr32mg21/protocol/zigbee/app/framework/../util/zigbee-framework","external/efr32mg21/protocol/zigbee/app/framework/cli","external/efr32mg21/protocol/zigbee/app/framework/include","external/efr32mg21/protocol/zigbee/app/framework/security","external/efr32mg21/protocol/zigbee/app/framework/util","external/efr32mg21/platform/base/hal","external/efr32mg21/platform/base/hal/plugin","external/efr32mg21/platform/base/hal/..","external/efr32mg21/platform/base/hal/micro/generic","external/efr32mg21/platform/base/hal/micro/unix/host","external/efr32mg21/platform/base/hal/micro/unix/host/board","external/efr32mg21/util/plugin/plugin-common/mbedtls","external/efr32mg21/util/third_party/mbedtls","external/efr32mg21/util/third_party/mbedtls/include","external/efr32mg21/util/third_party/mbedtls/include/mbedtls","external/efr32mg21/util/third_party/mbedtls/sl_crypto/include","external/efr32mg21/app/builder/Z3GatewayHost",],cflags: ["-Wno-unused-parameter","-Wno-missing-braces","-Wno-unused-function","-Wno-unused-variable","-Wno-date-time","-Wno-uninitialized","-DUNIX","-DUNIX_HOST","-DPHY_NULL","-DCONFIGURATION_HEADER=\"util/config.h\"","-DEZSP_HOST","-DGATEWAY_APP","-DZA_GENERATED_HEADER=\"Z3GatewayHost.h\"","-DATTRIBUTE_STORAGE_CONFIGURATION=\"Z3GatewayHost_endpoint_config.h\"","-DPLATFORM_HEADER=\"micro/unix/compiler/gcc.h\"","-DBOARD_HOST","-DBOARD_HEADER=\"Z3GatewayHost_board.h\"","-DEM_AF_TEST_HARNESS_CODE","-DEM_AF_LINK_M","-DEM_AF_LINK_PTHREAD","-DEMBER_AF_API_EMBER_TYPES=\"stack/include/ember-types.h\"","-DEMBER_AF_API_DEBUG_PRINT=\"app/framework/util/print.h\"","-DEMBER_AF_API_AF_HEADER=\"app/framework/include/af.h\"","-DEMBER_AF_API_AF_SECURITY_HEADER=\"app/framework/security/af-security.h\"","-DEMBER_AF_API_NEIGHBOR_HEADER=\"stack/include/stack-info.h\"","-DEMBER_STACK_ZIGBEE","-DEZSP_ASH","-DMBEDTLS_CONFIG_FILE=\"mbedtls-config-generated.h\"","-DFNDELAY=\"O_NDELAY\"","-DNO_READLINE",],srcs: ["app/builder/Z3GatewayHost/znet-bookkeeping.c","app/builder/Z3GatewayHost/call-command-handler.c","app/builder/Z3GatewayHost/callback-stub.c","app/builder/Z3GatewayHost/stack-handler-stub.c","app/builder/Z3GatewayHost/znet-cli.c","app/builder/Z3GatewayHost/Z3GatewayHost_callbacks.c","protocol/zigbee/app/framework/../util/common/library.c","protocol/zigbee/app/framework/../util/serial/command-interpreter2.c","protocol/zigbee/app/framework/../util/zigbee-framework/zigbee-device-common.c","protocol/zigbee/app/framework/../util/zigbee-framework/zigbee-device-host.c","protocol/zigbee/app/framework/../../stack/framework/event-control.c","platform/base/hal/micro/generic/led-stub.c","platform/base/hal/micro/generic/mem-util.c","platform/base/hal/plugin/antenna-stub/antenna-stub.c","platform/base/hal/plugin/buzzer-stub/buzzer-stub.c","protocol/zigbee/app/framework/plugin/address-table/address-table.c","protocol/zigbee/app/framework/plugin/address-table/address-table-cli.c","protocol/zigbee/app/framework/plugin/basic/basic.c","protocol/zigbee/app/framework/plugin/color-control-server/color-control-server.c","protocol/zigbee/app/framework/plugin/concentrator/concentrator-support.c","protocol/zigbee/app/framework/plugin/concentrator/concentrator-support-cli.c","protocol/zigbee/app/framework/plugin/counters/counters-cli.c","protocol/zigbee/app/framework/plugin/counters/counters-ota-host.c","protocol/zigbee/app/framework/plugin/counters/counters-host.c","protocol/zigbee/app/framework/plugin/ezmode-commissioning/ez-mode.c","protocol/zigbee/app/framework/plugin/ezmode-commissioning/ez-mode-cli.c","protocol/zigbee/app/util/ezsp/ezsp-callbacks.c","protocol/zigbee/app/util/ezsp/ezsp-enum-decode.c","protocol/zigbee/app/util/ezsp/ezsp-frame-utilities.c","protocol/zigbee/app/util/ezsp/ezsp.c","protocol/zigbee/app/ezsp-host/ezsp-host-io.c","protocol/zigbee/app/ezsp-host/ezsp-host-queues.c","protocol/zigbee/app/ezsp-host/ezsp-host-ui.c","protocol/zigbee/app/util/ezsp/serial-interface-uart.c","protocol/zigbee/app/ezsp-host/ash/ash-host-ui.c","protocol/zigbee/app/ezsp-host/ash/ash-host.c","platform/base/hal/micro/generic/ash-common.c","protocol/zigbee/app/framework/plugin-host/file-descriptor-dispatch/file-descriptor-dispatch.c","protocol/zigbee/app/framework/plugin-host/gateway/gateway-support.c","protocol/zigbee/app/framework/plugin-host/gateway/backchannel-support.c","protocol/zigbee/app/framework/plugin-host/gateway/gateway-support-cli.c","protocol/zigbee/app/framework/plugin/green-power-client/green-power-client.c","protocol/zigbee/app/framework/plugin/green-power-client/green-power-client-cli.c","protocol/zigbee/app/framework/plugin/green-power-common/green-power-common.c","protocol/zigbee/stack/gp/gp-util.c","protocol/zigbee/app/framework/plugin/heartbeat/heartbeat.c","protocol/zigbee/app/framework/plugin/ias-zone-client/ias-zone-client.c","protocol/zigbee/app/framework/plugin/ias-zone-client/ias-zone-client-cli.c","protocol/zigbee/app/framework/plugin/identify/identify.c","protocol/zigbee/app/framework/plugin/identify/identify-cli.c","protocol/zigbee/app/framework/plugin/identify-feedback/identify-feedback.c","protocol/zigbee/app/framework/plugin/level-control/level-control.c","util/plugin/plugin-common/linked-list/linked-list.c","util/third_party/mbedtls/library/aes.c","util/third_party/mbedtls/library/aesni.c","util/third_party/mbedtls/library/arc4.c","util/third_party/mbedtls/library/asn1parse.c","util/third_party/mbedtls/library/asn1write.c","util/third_party/mbedtls/library/base64.c","util/third_party/mbedtls/library/bignum.c","util/third_party/mbedtls/library/blowfish.c","util/third_party/mbedtls/library/camellia.c","util/third_party/mbedtls/library/ccm.c","util/third_party/mbedtls/library/certs.c","util/third_party/mbedtls/library/cipher.c","util/third_party/mbedtls/library/cipher_wrap.c","util/third_party/mbedtls/library/cmac.c","util/third_party/mbedtls/library/ctr_drbg.c","util/third_party/mbedtls/library/debug.c","util/third_party/mbedtls/library/des.c","util/third_party/mbedtls/library/dhm.c","util/third_party/mbedtls/library/ecdh.c","util/third_party/mbedtls/library/ecdsa.c","util/third_party/mbedtls/library/ecjpake.c","util/third_party/mbedtls/library/ecp.c","util/third_party/mbedtls/library/ecp_curves.c","util/third_party/mbedtls/library/entropy.c","util/third_party/mbedtls/library/entropy_poll.c","util/third_party/mbedtls/library/error.c","util/third_party/mbedtls/library/gcm.c","util/third_party/mbedtls/library/havege.c","util/third_party/mbedtls/library/hmac_drbg.c","util/third_party/mbedtls/library/md.c","util/third_party/mbedtls/library/md2.c","util/third_party/mbedtls/library/md4.c","util/third_party/mbedtls/library/md5.c","util/third_party/mbedtls/library/md_wrap.c","util/third_party/mbedtls/library/memory_buffer_alloc.c","util/third_party/mbedtls/library/net_sockets.c","util/third_party/mbedtls/library/oid.c","util/third_party/mbedtls/library/padlock.c","util/third_party/mbedtls/library/pem.c","util/third_party/mbedtls/library/pk.c","util/third_party/mbedtls/library/pk_wrap.c","util/third_party/mbedtls/library/pkcs11.c","util/third_party/mbedtls/library/pkcs12.c","util/third_party/mbedtls/library/pkcs5.c","util/third_party/mbedtls/library/pkparse.c","util/third_party/mbedtls/library/pkwrite.c","util/third_party/mbedtls/library/ripemd160.c","util/third_party/mbedtls/library/rsa.c","util/third_party/mbedtls/library/rsa_internal.c","util/third_party/mbedtls/library/sha1.c","util/third_party/mbedtls/library/sha256.c","util/third_party/mbedtls/library/sha512.c","util/third_party/mbedtls/library/ssl_cache.c","util/third_party/mbedtls/library/ssl_ciphersuites.c","util/third_party/mbedtls/library/ssl_cli.c","util/third_party/mbedtls/library/ssl_cookie.c","util/third_party/mbedtls/library/ssl_srv.c","util/third_party/mbedtls/library/ssl_ticket.c","util/third_party/mbedtls/library/ssl_tls.c","util/third_party/mbedtls/library/threading.c","util/third_party/mbedtls/library/timing.c","util/third_party/mbedtls/library/version.c","util/third_party/mbedtls/library/version_features.c","util/third_party/mbedtls/library/x509.c","util/third_party/mbedtls/library/x509_create.c","util/third_party/mbedtls/library/x509_crl.c","util/third_party/mbedtls/library/x509_crt.c","util/third_party/mbedtls/library/x509_csr.c","util/third_party/mbedtls/library/x509write_crt.c","util/third_party/mbedtls/library/x509write_csr.c","util/third_party/mbedtls/library/xtea.c","protocol/zigbee/app/framework/plugin-host/ncp-configuration/ncp-configuration.c","protocol/zigbee/app/framework/plugin/network-creator/network-creator.c","protocol/zigbee/app/framework/plugin/network-creator/network-creator-cli.c","protocol/zigbee/app/framework/plugin/network-creator-security/network-creator-security.c","protocol/zigbee/app/framework/plugin/network-creator-security/network-creator-security-cli.c","protocol/zigbee/app/framework/plugin/network-steering/network-steering.c","protocol/zigbee/app/framework/plugin/network-steering/network-steering-cli.c","protocol/zigbee/app/framework/plugin/network-steering/network-steering-v2.c","protocol/zigbee/app/framework/plugin/network-steering/network-steering-host.c","protocol/zigbee/app/framework/plugin/on-off/on-off.c","protocol/zigbee/app/framework/plugin/ota-common/ota-common.c","protocol/zigbee/app/framework/plugin/ota-server/ota-server.c","protocol/zigbee/app/framework/plugin/ota-server/ota-server-page-request.c","protocol/zigbee/app/framework/plugin/ota-server/ota-server-cli.c","protocol/zigbee/app/framework/plugin/ota-server/ota-server-dynamic-block-period.c","protocol/zigbee/app/framework/plugin/ota-server-policy/ota-server-policy.c","protocol/zigbee/app/framework/plugin/ota-storage-common/ota-storage-common.c","protocol/zigbee/app/framework/plugin/ota-storage-common/ota-storage-common-cli.c","protocol/zigbee/app/framework/plugin/ota-storage-posix-filesystem/ota-storage-linux.c","protocol/zigbee/app/framework/plugin/poll-control-client/poll-control-client.c","protocol/zigbee/app/framework/plugin/poll-control-client/poll-control-client-cli.c","protocol/zigbee/app/framework/plugin/reporting/reporting.c","protocol/zigbee/app/framework/plugin/reporting/reporting-cli.c","protocol/zigbee/app/framework/plugin/reporting/reporting-default-configuration.c","protocol/zigbee/app/framework/plugin/scan-dispatch/scan-dispatch.c","protocol/zigbee/app/util/ezsp/secure-ezsp-stub.c","protocol/zigbee/app/framework/plugin/simple-main/simple-main.c","protocol/zigbee/app/framework/plugin/simple-metering-client/simple-metering-client.c","protocol/zigbee/app/framework/plugin/simple-metering-client/simple-metering-client-cli.c","protocol/zigbee/app/framework/plugin/stack-diagnostics/stack-diagnostics.c","protocol/zigbee/app/framework/plugin/test-harness/test-harness.c","protocol/zigbee/app/framework/plugin/test-harness/read-write-attributes.c","protocol/zigbee/app/framework/plugin/test-harness/test-harness-host.c","protocol/zigbee/app/framework/plugin/time-server/time-server.c","protocol/zigbee/app/framework/plugin/trust-center-nwk-key-update-broadcast/trust-center-nwk-key-update-broadcast.c","protocol/zigbee/app/framework/plugin/trust-center-nwk-key-update-periodic/trust-center-nwk-key-update-periodic.c","protocol/zigbee/app/framework/plugin/trust-center-nwk-key-update-unicast/trust-center-nwk-key-update-unicast.c","platform/base/hal/micro/generic/crc.c","platform/base/hal/micro/generic/endian.c","platform/base/hal/micro/generic/random.c","platform/base/hal/micro/generic/system-timer.c","platform/base/hal/micro/unix/host/micro.c","platform/base/hal/micro/unix/host/token-def-unix.c","platform/base/hal/micro/unix/host/token.c","platform/base/hal/plugin/serial/ember-printf-convert.c","protocol/zigbee/app/util/serial/linux-serial.c","protocol/zigbee/app/framework/plugin/update-tc-link-key/update-tc-link-key.c","protocol/zigbee/app/framework/plugin/update-tc-link-key/update-tc-link-key-cli.c","protocol/zigbee/app/framework/cli/core-cli.c","protocol/zigbee/app/framework/cli/network-cli.c","protocol/zigbee/app/framework/cli/option-cli.c","protocol/zigbee/app/framework/cli/plugin-cli.c","protocol/zigbee/app/framework/cli/security-cli.c","protocol/zigbee/app/framework/cli/zcl-cli.c","protocol/zigbee/app/framework/cli/zdo-cli.c","protocol/zigbee/app/framework/security/af-node.c","protocol/zigbee/app/framework/security/af-security-common.c","protocol/zigbee/app/framework/security/af-trust-center.c","protocol/zigbee/app/framework/security/crypto-state.c","protocol/zigbee/app/framework/util/af-event.c","protocol/zigbee/app/framework/util/af-main-common.c","protocol/zigbee/app/framework/util/attribute-size.c","protocol/zigbee/app/framework/util/attribute-storage.c","protocol/zigbee/app/framework/util/attribute-table.c","protocol/zigbee/app/framework/util/client-api.c","protocol/zigbee/app/framework/util/message.c","protocol/zigbee/app/framework/util/multi-network.c","protocol/zigbee/app/framework/util/print.c","protocol/zigbee/app/framework/util/print-formatter.c","protocol/zigbee/app/framework/util/process-cluster-message.c","protocol/zigbee/app/framework/util/process-global-message.c","protocol/zigbee/app/framework/util/service-discovery-common.c","protocol/zigbee/app/framework/util/time-util.c","protocol/zigbee/app/framework/util/util.c","protocol/zigbee/app/framework/util/af-main-host.c","protocol/zigbee/app/framework/util/service-discovery-host.c",],
}

然后mmm external/efr32mg21/ -j40进行编译,编译有报错,修改如下

运行后会报错,修改

运行结果如下

采用J-link仿真器与Simplicity Commander软件连接升级固件步骤

https://www.sekorm.com/news/69217622.html

注意芯片的复位脚不能被拉低,会引起无法下载

Androidq下编译efr32mg21相关推荐

  1. Windows 10下编译安装Hadoop2.6

    转自:https://www.linuxidc.com/Linux/2016-08/134131.htm Windows 10下安装Hadoop2.6,Windows10下编译64位Hadoop2.x ...

  2. linux mysql 5.6.22_LinuxCentOS6.0下编译安装MySQL5.6.22

    Linux CentOS6.5下编译安装MySQL 5.6.22[给力详细教程] 一.编译安装MySQL前的准备工作 安装编译源码所需的工具和库(安装过程注意有没出错) yum install gcc ...

  3. GDAL2.1.1库在Ubuntu14.04下编译时遇到的问题处理方法

    不用作任何调整,直接在Linux下编译GDAL2.1.1源码的步骤是: $ ./configure $ make $ make install 非常简单, 这样也能正常生成gdal动态库.静态库,如果 ...

  4. Windows下编译Chrome V8

    主要还是参考google的官方文档: How to Download and Build V8 Building on Windows 同时也参考了一些其它的中文博客: 脚本引擎小pk:SpiderM ...

  5. 在虚拟机linux环境下编译windows版adb fastboot

    原文出自:http://blog.chinaunix.net/uid-20546441-id-1746200.html 我根据虚拟机编译遇到的问题进行一些添加 [前提条件] Linux Android ...

  6. Ubuntu16下编译安装Open Babel2.4.1和python绑定

    上一篇介绍的是CentOS 7下编译安装Open Babel2.4.1和python绑定点击打开链接 一.Open Babel简介 Open Babel是一款开源自由软件,使用Open Babel可以 ...

  7. Linux下编译运行C程序

    代码变成可执行文件叫做编译(compile):先编译这个还是先编译那个这个(即编译的安排)叫做构建(build) 我们在Linux环境下编译C语言需要gcc. 1.配置GCC 刚装好的系统已经有GCC ...

  8. linux 保存编译log,(转)Linux下编译安装log4cxx

    一个项目的服务器端在Linux平台下,用到了开源日志库log4cxx,这个库是apache项目的一个子库.功能很不错.下面记录下它的编译和安装过程. 第一步安装apr-1.3.8,顺序不能错,它必须首 ...

  9. windows下编译leveldb

    前提条件,下载boost库并编译 boost库弄好后,就可以编译leveldb了 首先,下载leveldb-windows,这个github上有 一. 1文件->新建->从现有代码文件创建 ...

最新文章

  1. 安装软件包的三种方法、rpm包介绍、rpm工具用法、yum工具用法、yum搭建本地仓库...
  2. iOS多线程GCD 研究
  3. 详解python中的round()函数
  4. django时差8个小时问题
  5. 继承有几种方式,分别是什么,想要实现继承可以使用哪些方法
  6. Celery的实践指南
  7. HDU 1828:Picture(扫描线+线段树 矩形周长并)
  8. java 漏洞挖掘_Java反序列化漏洞的挖掘、攻击与防御
  9. 【ES】ES 如何在一个机器上同时模拟多个node
  10. Linux VMware 快照不准,VmWare Workstation 关于Linux 虚拟机快照或克隆后 识别不到网卡问题...
  11. perl查看文件,提取指定信息输出到文件
  12. mysql内容_mysql 的基本内容
  13. java 开发中常用的字符串工具类,StringUtil
  14. linux系统下的图书管理系统,LINUX下基于SOAP的图书管理系统的研究与实现
  15. GDI+学习及代码总结之------文本与字体
  16. vue项目生成二维码功能使用QRCode(接入微信和支付宝支付接口)
  17. python祝福,1024,用Python抽取你的专属祝福!
  18. 人生不过一场旅行,你路过我,我路过你
  19. booktest-17 自定义过滤器 模板标签没有除法和取余函数
  20. 【C语言】一文彻底理解指针,通俗易懂

热门文章

  1. u盘启动 联想一体机_联想一体机如何进入bios设置u盘启动_联想一体机设置U盘启动步骤...
  2. 手动解除fail2ban的ip
  3. C语言100题练习计划 32——猜数字游戏
  4. Echarts——旭日图
  5. RLC振荡原理与RC Snubber吸收电路
  6. js屏蔽手机的物理返回键
  7. 如何在webots中绘制运动轨迹
  8. Ubuntu系统配置共享打印机及Windows连接教程
  9. ANSYS 添加PCB板材料 FR-4
  10. 等额本息与等额本金,从财务管理的角度充分考虑货币时间价值,哪个对于购房人来说更划算?