linux_libnfc-nci 指令编译过程

本文介绍了libnfc_nci_linux编译时configure能支持的选项,包括配置、安装目录、程序名称、系统类型、可选特性和可选包等方面的选项,还给出了环境变量的影响。此外,还展示了官方文档给出的交叉编译命令示例。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

一、查看编译configure 能支持的选项:./configure --help


root@nicholas-virtual-machine:/home/nicholas/linux_libnfc-nci# ./configure --help
`configure' configures libnfc_nci_linux 1.0 to adapt to many kinds of systems.

Usage: ./configure [OPTION]... [VAR=VALUE]...

To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE.  See below for descriptions of some of the useful variables.

Defaults for the options are specified in brackets.

Configuration:
  -h, --help              display this help and exit
      --help=short        display options specific to this package
      --help=recursive    display the short help of all the included packages
  -V, --version           display version information and exit
  -q, --quiet, --silent   do not print `checking ...' messages
      --cache-file=FILE   cache test results in FILE [disabled]
  -C, --config-cache      alias for `--cache-file=config.cache'
  -n, --no-create         do not create output files
      --srcdir=DIR        find the sources in DIR [configure dir or `..']

Installation directories:
  --prefix=PREFIX         install architecture-independent files in PREFIX
                          [/usr/local]
  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
                          [PREFIX]

By default, `make install' will install all the files in
`/usr/local/bin', `/usr/local/lib' etc.  You can specify
an installation prefix other than `/usr/local' using `--prefix',
for instance `--prefix=$HOME'.

For better control, use the options below.

Fine tuning of the installation directories:
  --bindir=DIR            user executables [EPREFIX/bin]
  --sbindir=DIR           system admin executables [EPREFIX/sbin]
  --libexecdir=DIR        program executables [EPREFIX/libexec]
  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
  --libdir=DIR            object code libraries [EPREFIX/lib]
  --includedir=DIR        C header files [PREFIX/include]
  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
  --infodir=DIR           info documentation [DATAROOTDIR/info]
  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
  --mandir=DIR            man documentation [DATAROOTDIR/man]
  --docdir=DIR            documentation root
                          [DATAROOTDIR/doc/libnfc_nci_linux]
  --htmldir=DIR           html documentation [DOCDIR]
  --dvidir=DIR            dvi documentation [DOCDIR]
  --pdfdir=DIR            pdf documentation [DOCDIR]
  --psdir=DIR             ps documentation [DOCDIR]

Program names:
  --program-prefix=PREFIX            prepend PREFIX to installed program names
  --program-suffix=SUFFIX            append SUFFIX to installed program names
  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names

System types:
  --build=BUILD     configure for building on BUILD [guessed]
  --host=HOST       cross-compile to build programs to run on HOST [BUILD]

Optional Features:
  --disable-option-checking  ignore unrecognized --enable/--with options
  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  --enable-silent-rules   less verbose build output (undo: "make V=1")
  --disable-silent-rules  verbose build output (undo: "make V=0")
  --enable-dependency-tracking
                          do not reject slow dependency extractors
  --disable-dependency-tracking
                          speeds up one-time build
  --enable-shared[=PKGS]  build shared libraries [default=yes]
  --enable-static[=PKGS]  build static libraries [default=yes]
  --enable-fast-install[=PKGS]
                          optimize for fast installation [default=yes]
  --disable-libtool-lock  avoid locking (might break parallel builds)
  --enable-debug          whether to include debug symbols (default is no)
  --enable-llcp1_3    enable LLCP1.3 (secured P2P)
  --enable-abend    set TML to ABEND
  --enable-lpcusbsio set TML to LPCUSBSIO
  --enable-i2c    set TML to I2C
  --enable-alt    set TML to ALT

Optional Packages:
  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
  --with-pic[=PKGS]       try to use only PIC/non-PIC objects [default=use
                          both]
  --with-aix-soname=aix|svr4|both
                          shared library versioning (aka "SONAME") variant to
                          provide on AIX, [default=aix].
  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
  --with-sysroot[=DIR]    Search for dependent libraries within DIR (or the
                          compiler's sysroot if not specified).

Some influential environment variables:
  CXX         C++ compiler command
  CXXFLAGS    C++ compiler flags
  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
              nonstandard directory <lib dir>
  LIBS        libraries to pass to the linker, e.g. -l<library>
  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
              you have headers in a nonstandard directory <include dir>
  CC          C compiler command
  CFLAGS      C compiler flags
  LT_SYS_LIBRARY_PATH
              User-defined run-time library search path.
  CPP         C preprocessor
  CXXCPP      C++ preprocessor
  openssldir  openssl installation path
  PKG_CONFIG  path to pkg-config utility
  PKG_CONFIG_PATH
              directories to add to pkg-config's search path
  PKG_CONFIG_LIBDIR
              path overriding pkg-config's built-in search path
  UDEV_CFLAGS C compiler flags for UDEV, overriding pkg-config
  UDEV_LIBS   linker flags for UDEV, overriding pkg-config

Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.

Report bugs to the package provider.
root@nicholas-virtual-machine:/home/nicholas/linux_libnfc-nci# 

 

以下是官方文檔给出的编译选择:

下面要交差编译:

CXX=/usr/local/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++ CC=/usr/local/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-gcc  ./configure  --host=arm-linux-gnueabihf --enable-i2c --prefix=/usr/local/dzgnfc --build=x86_64-build_unknown-linux-gnu

<think>好的,我现在需要回答用户关于OpenHarmony与PN7150芯片的兼容性及开发文档的问题。首先,我需要仔细查看用户提供的引用内容,提取相关信息。 用户提供的引用[1]提到PN532模块的驱动安装覆盖了多个Windows版本,但用户的问题是关于OpenHarmony和PN7150的。引用[2]和[4]涉及Linux和Android系统下PN7150的驱动适配,特别是提到了GitHub仓库和代码修改。引用[3]则直接提到了RK3568 OpenHarmony3.2上适配PN7150的NFC驱动,修改了特定文件。 接下来,我需要整合这些信息。OpenHarmony的兼容性方面,引用[3]显示在RK3568平台上已成功适配PN7150,说明有一定兼容性。驱动开发部分,用户需要参考Linux驱动代码,并根据OpenHarmony的HDF框架进行调整,如引用[2]和[4]提到的修改设备树和源码。开发文档可能分散在GitHub仓库和厂商资料中,可能需要结合官方文档和社区资源。 用户可能需要知道具体步骤,比如如何获取驱动源码、修改设备树配置、调试方法等。同时,兼容性可能受内核版本和硬件影响,需要确认OpenHarmony版本是否支持PN7150的接口。此外,测试和社区资源也是开发过程中重要的部分。 最后,生成相关问题时要覆盖兼容性确认、驱动开发步骤、调试工具、应用场景等,帮助用户全面了解开发流程和可能遇到的问题。</think>关于OpenHarmony与PN7150芯片的开发适配,根据提供的参考资料,以下是关键信息汇总: ### 一、兼容性说明 1. **硬件支持** PN7150已成功适配于RK3568开发板的OpenHarmony 3.2系统[^3],表明该芯片在特定硬件平台上可实现基础通信功能。 *需注意:兼容性可能受具体硬件接口(如I2C总线速率)和OpenHarmony内核版本影响* 2. **驱动架构** 基于OpenHarmony的HDF(Hardware Driver Foundation)驱动框架开发,需实现NCI(NFC Controller Interface)协议适配层 --- ### 二、开发文档与驱动适配步骤 1. **驱动源码获取** - 参考NXP官方Linux驱动代码(如`nxp-pn5xx`目录结构[^2]) - OpenHarmony适配代码可查阅GitHub示例仓库[^4] 2. **关键修改点** ```c // 示例:修改设备树配置(dts文件) &i2c3 { pn7150: nfc@28 { compatible = "nxp,pn7150"; // 添加设备兼容标识 reg = <0x28>; // I2C地址配置 interrupt-gpios = <&gpio1 0 GPIO_ACTIVE_HIGH>; enable-gpios = <&gpio1 1 GPIO_ACTIVE_HIGH>; }; }; ``` *需同步修改`pn5xx_i2c.c`中的设备节点名称匹配逻辑[^2]* 3. **服务层适配** 修改`nfcc_nci_adapter.cpp`实现以下功能: - NFC控制器的初始化流程 - 数据收发的中断处理 - 低功耗模式切换 --- ### 三、调试与验证 1. **工具链要求** - 需配置OpenHarmony的交叉编译环境 - 使用`hdc`工具进行驱动模块部署 2. **测试方法** ```shell # 查看驱动加载状态 hilog | grep "NFC" # 发送NCI测试指令 hdc shell nfc_test -t 1 ``` --- ### 四、开发建议 1. **资源参考** - NXP官方文档《PN7150 User Manual》 - OpenHarmony HDF开发指南 - RK3568硬件设计手册(GPIO/I2C引脚分配) 2. **常见问题** - **I2C通信失败**:检查设备树中GPIO中断配置和时钟频率 - **标签识别异常**:调整RF参数配置文件`libnfc-nxp.conf` ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值