交叉编译microcom ARM终端串口调试工具

        由于默认的busybox没有支持microcom工具,也没有提供源码,所以需要自己交叉编译microcom工具。

microcom工具

        https://packages.ubuntu.com/zh-cn/plucky/microcom

        下载ubuntu带的软件包microcom,下载microcom_2023.09.0.orig.tar.xz版本,

        设置编译链环境变量,配置./configure --host=arm-linux --build=x86_64-linux-gnu

        ./microcom -s 115200 -p /dev/ttyS1,发现不好用放弃。

busybox工具

        查看目标机的版本:BusyBox v1.34.1 () multi-call binary.

        下载busybox-1.34.1.tar.bz2版本,设置编译环境变量,设置默认配置:make defconfig

        查看配置CONFIG_MICROCOM=y是否已经选中,修改.config配置文件的编译链:

CONFIG_CROSS_COMPILER_PREFIX="aarch64-zxic-linux-"
CONFIG_SYSROOT="/home/wangyb/sda3/zm9300c-V2XR240060/toolchain/sysroots/aarch64-zxic-linux"

        make编译成功,

busybox: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, BuildID[sha1]=9dbb06951e6969491375cfe8fb89c80cf31f78c3, for GNU/Linux 3.14.0, stripped

        busybox修改名称为microcom,拷贝到目标机运行。

linux_genvict:root# ./microcom 
BusyBox v1.34.1 (2026-03-09 14:22:05 CST) multi-call binary.

Usage: microcom [-d DELAY_MS] [-t TIMEOUT_MS ] [-s SPEED] [-X] TTY

Copy bytes from stdin to TTY and from TTY to stdout

	-d DELAY	Wait up to DELAY ms for TTY output before sending
			every next byte to it
	-t TIMEOUT	Exit if both stdin and TTY are silent for TIMEOUT ms
	-s SPEED	Set serial line to SPEED
	-X		Disable special meaning of NUL and Ctrl-X from stdin
linux_genvict:root# 

        ./microcom -s 115200 /dev/ttyS1,可输出gnss模组的NMEA数据。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值