Androidq下编译efr32mg21

本文详细介绍了在Androidq环境下编译efr32mg21的过程,包括必要的依赖安装、目录结构搭建、Android.bp文件配置及编译命令。同时,分享了编译过程中遇到的问题及解决方法。

要在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/prin
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值