移植GPS到8810机器(coolpad)

本文档在broadcom21553平台代码上编译GPS deamon(glgps) 和so文件,并将两个文件移植到8810机器上,

并使其定位成功

GPS SDK:spreadtrum_T8810android_android2_3_2.18.11.130823

编译平台:broadcom21553 2.3.12

 

以下为相关步骤(都以实验验证成功,仅供参考):
一,要修改的文件:

1,
Broadcom21553/vendor/brcm/config/ buildspec.bcm21553_acar10DSRef(该文件为整体编译android代码时的config配置),
在开始编译后,会将里面的配置写到android根目录:buildspec.mk
具体方法为:
在buildspec.bcm21553_acar10DSRef中加入:2.18.11.130823/vendor/broadcom/gps/customers/spreadtrum/Makefile.spreadtrumT8810android.mak文件中的config选项:
内容如下:
CONFIG_HAL_SERIAL_TYPE=/dev/i2c-1
CONFIG_HAL_CMD=yes
CONFIG_HAL_CMD_FILE=/data/gps/glgpsctrl
CONFIG_HAL_LTO=yes
CONFIG_HAL_LTO_DIR=/data/gps/
CONFIG_HAL_LTO_FILE=lto.dat
CONFIG_HAL_NMEA_PIPE=yes
CONFIG_HAL_NMEA_FILE=/data/gps/gpspipe
CONFIG_HAL_NV=yes
CONFIG_HAL_NV_DIR=/data/gps/
CONFIG_HAL_NV_FILE=gldata.sto
CONFIG_HAL_RRC=no
#CONFIG_HAL_NO_GPIO=yes
CONFIG_HAL_GPIO_SYSFS=yes
CONFIG_HAL_CATCH_SIGNALS=yes
CONFIG_HAL_LCS_API=yes
#CONFIG_HAL_LOG_ANDROID=yes
CONFIG_HAL_TIME_MONOTONIC=yes
CONFIG_HAL_HAVE_TIMEOUT_EVENT=yes
CONFIG_HAL_I2C_DEV=yes
CONFIG_HAL_SMBUS_I2C=yes
CONFIG_HAL_INIT_CUSTOM=yes
CONFIG_HAL_SUPL=true
ENABLE_TLS=yes
#LTO_LICENSEE=brcmdev
# Enable CMCC Supl log
CONFIG_HAL_SUPLLOG=yes

TARGET_RELEASE_CFLAGS=-O2 -fno-strict-aliasing

二,加入库文件:
2.18.11.130823/vendor/broadcom/gps/customers/spreadtrum/glhal/T8810android/lib/libglhal_spreadtrumT8810android.a
2.18.11.130823/vendor/broadcom/gps/customers/spreadtrum/glhal_supllog/lib/libglhal_supllog_spreadtrumT8810android.a
2.18.11.130823/vendor/broadcom/gps/customers/spreadtrum/gllbs_distr/lib/libgllbs_spreadtrumT8810android.a
2.18.11.130823/vendor/broadcom/gps/customers/spreadtrum/gll_distr/lib/libgll_spreadtrumT8810android.a
2.18.11.130823/vendor/broadcom/gps/customers/spreadtrum/glnet_distr/lib/libglnet_spreadtrumT8810android.a
2.18.11.130823/vendor/broadcom/gps/customers/spreadtrum/gltools_distr/lib/libgltools_spreadtrumT8810android.a
将以上的库文件拷贝到:
Broadcom21553/prebuilt/android-arm/gps/
为了不报编译错误:将库重命名,比如:libglhal_spreadtrumT8810android.a改为:libglhal.a(其他类似)
并修改Android.mk文件(内容如下):
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := libgll.a
LOCAL_MODULE := libgll
LOCAL_MODULE_CLASS := STATIC_LIBRARIES
LOCAL_MODULE_TAGS := user
LOCAL_MODULE_SUFFIX := .a
include $(BUILD_PREBUILT)

 include $(CLEAR_VARS)
LOCAL_SRC_FILES := libglnet.a
LOCAL_MODULE := libglnet
LOCAL_MODULE_CLASS := STATIC_LIBRARIES
LOCAL_MODULE_TAGS := user
LOCAL_MODULE_SUFFIX := .a
include $(BUILD_PREBUILT)

include $(CLEAR_VARS)
LOCAL_SRC_FILES := libgllbs.a
LOCAL_MODULE := libgllbs
LOCAL_MODULE_CLASS := STATIC_LIBRARIES
LOCAL_MODULE_TAGS := user
LOCAL_MODULE_SUFFIX := .a
include $(BUILD_PREBUILT)

include $(CLEAR_VARS)
LOCAL_SRC_FILES := libgltools.a
LOCAL_MODULE := libgltools
LOCAL_MODULE_CLASS := STATIC_LIBRARIES
LOCAL_MODULE_TAGS := user
LOCAL_MODULE_SUFFIX := .a
include $(BUILD_PREBUILT)

include $(CLEAR_VARS)
LOCAL_SRC_FILES :=  libglhal_supllog.a
LOCAL_MODULE :=  libglhal_supllog
LOCAL_MODULE_CLASS := STATIC_LIBRARIES
LOCAL_MODULE_TAGS := user
LOCAL_MODULE_SUFFIX := .a
include $(BUILD_PREBUILT)

ifeq ($(CONFIG_BRCM_AGPS_PKCS15_ENABLE),true)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := libpkcs15codec.a
LOCAL_MODULE := libpkcs15codec
LOCAL_MODULE_CLASS := STATIC_LIBRARIES
LOCAL_MODULE_TAGS := user
LOCAL_MODULE_SUFFIX := .a
include $(BUILD_PREBUILT)

endif #CONFIG_BRCM_AGPS_PKCS15_ENABLE

三,拷贝gps源码:
将2.18.11.130823/vendor/broadcom/gps/下的 allPartners/拷贝到Broadcom21553/hardware/broadcom/gps/并修改权限为755

四,重新编译:
1,如果出现:
build/core/base_rules.mk:166: *** hardware/broadcom/gps/allPartners/deliverables/cbee_gen/unix/../../../..: MODULE.TARGET.STATIC_LIBRARIES.libgll already defined by prebuilt/android-arm/gps。 停止。

解决办法:
cd hardware/broadcom/gps/allPartners/deliverables/
rm -rf cbee_gen/

2,如果出现:
build/core/base_rules.mk:166: *** hardware/broadcom/gps/allPartners/deliverables/glhal/unix/../../../..: MODULE.TARGET.STATIC_LIBRARIES.brcmgpslcsapi already defined by hardware/broadcom/gps/allPartners/deliverables/middleware_connectors/unix/Android/gps_jni。 停止。

解决办法:
cd hardware/broadcom/gps/allPartners/deliverables/middleware_connectors/unix/Android/gps_jni
vi Android.mk
将LOCAL_MODULE := brcmgpslcsapi
修改为:LOCAL_MODULE := brcmlcsapi

3,若出现:
make: *** 没有规则可以创建“out/target/product/bcm21553/obj/EXECUTABLES/testclient_intermediates/LINKED/testclient”需要的目标“out/target/product/bcm21553/obj/STATIC_LIBRARIES/libgpslcsapi_intermediates/libgpslcsapi.a”。 停止。
make: *** 正在等待未完成的任务....
解决办法:
rm -rf allPartners\deliverables\middleware_connectors\unix\lcsapi\test_ril

五,成功编译以后:
将out/target/product/brcm21553/下面的system/bin/glgps和system/lib/hw/gps.brcm.so adb push进8810机器进行验证即可
注意:
1,  在push之前要将机器中的两个文件都删除
2,  将so文件改名字为gps.sprdbp.so


六,进行定位验证:
从开启apk到定位成功花了8分钟22秒。附件为相应log。
。。。
12:15:45.790 &549625E GL_NMEA[0][$QZGSA,A,3,,,,,,,,,,,,,6.6,4.7,4.6*2F
12:15:45.790 &549625E GL_NMEA[0][$PGLOR,0,FIX,502.3*27
12:15:45.790 TTFF=08:22
12:15:45.790 $549625I TTFF @ <gps_time WeekNum="1690" TowMs="274558589"/>
12:15:45.790 &549625E GL_NMEA[0][$GPRMC,041543.59,A,3150.492930,N,11716.600326,E,000.0,,300512,,,A*7D
。。。

你可能感兴趣的:(平台)