交叉编译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数据。

相关推荐
w-w0w-w6 小时前
SQL注入
网络·数据库·sql
tianyuanwo7 小时前
NetBox 数据库详解:当“关系型数据库”被装进一个网络运维的领域模型里
运维·数据库·netbox
一条泥憨鱼7 小时前
【计算机网络】短连接、长连接与连接池:从 TCP 握手到池化复用的完整链路
网络·数据库·网络协议·tcp/ip·计算机网络
IvorySQL7 小时前
深入 PostgreSQL WAL:从崩溃恢复到逻辑复制
数据库·postgresql
幽灵诶8 小时前
Mysql(基于测试的学习)
数据库·mysql
砚底藏山河8 小时前
python量化自定义周期 K 线合成
java·开发语言·数据库·python·金融
宇宙无敌暴龙战士6669 小时前
MySQL 8 库表操作学习笔记:SQL 基础、库表管理、约束与用户授权全流程
数据库·sql·mysql·学习笔记·后端开发
猿究院_夏燊9 小时前
MySQL 的四种隔离级别
java·数据库·mysql
say_fall9 小时前
【Linux系统编程】Ext 文件系统:磁盘与存储、文件与目录、现代计算机究竟如何寻找文件
linux·运维·服务器·数据库·c++
共享家952710 小时前
408 操作系统第一章
服务器·数据库·windows