当前位置:网站首页>Ti AM335X工控模块使用beaglebone(bbb)的Debian系统
Ti AM335X工控模块使用beaglebone(bbb)的Debian系统
2022-07-26 01:58:00 【szembed】
本内容的验证使用的盈鹏飞嵌入式CoM-335x核心模块及评估板EAC-335X,CoM-335X核心模块是
Beaglebone black的最小系统,产品介绍如下:



一、下载BBB的Debian系统镜像
下载地址:http://elinux.org/Beagleboard:BeagleBoneBlack_Debian#Debian_Releases

根据EMMC或者TF卡的大小,选择合适的镜像下载。需要注意的是,2G的镜像烧写到TF卡后只有一个EXT4格式的根文件系统分区,但4G的镜像有一个FAT32格式的启动分区和一个EXT4格式的根文件系统分区。
下载的Debian文件系统镜像,未必符合实际的运行环境,在此指的是当中的Linux内核驱动模块(modules)可能与我们期待的不同(Linux内核版本与镜像中的不一致,驱动模块功能不符合等)。因此,
需要添加当前内核模块。有编译环境为buildroot与Linux两种情况,以下分别介绍。
1、buildroot编译环境
buildroot全编译或重编译Linux后,驱动模块默认安装路径为:output/target/lib/modules/ ,只需把该目录下的目录复制到Debian镜像中即可。下载的Debian rootfs是一个镜像文件,先挂载,再复制驱动模块。
① 解压镜像
host$ unxz bone-debian-9.1-lxqt-armhf-2017-08-31-4gb.img.xz
② 挂载镜像
若直接挂载会提示文件系统类型不符,挂载失败:

使用file查看镜像信息,是否有起始块信息:

上图中起始扇区为8192,每个扇区大小为512 byte,即起始地址为: 8192 * 512 = 4194304 byte 。挂载时指定起始地址:
# sudo mount -o loop,offset=4194304 bone-debian-9.1-lxqt-armhf-2017-08-31-4gb.img /media/
③ 复制驱动模块
host$ sudo cp -r output/target/lib/modules/4.14.67/ /media/lib/modules/
host$ ls /media/lib/modules/4.14.67/
④ 打包rootfs
host$ cd /media/
host$ sudo tar -cf ~/com335x-debian-9.1-rootfs.tar *
host$ sudo umount /media
2、Linux编译环境
① 安装驱动模块
使用Linux BSP编译完成后,需要安装驱动模块,以安装到debian_rootfs为例:
host$ export INSTALL_MOD_PATH=debian_rootfs
host$ make ARCH=arm modules_install
删除生成模块中的链接文件,然后复制到Debian镜像/lib/modules/目录,Debian镜像解压参考buildroot编译环境。
host$ rm -rf debian_rootfs/lib/modules/4.14.67-g7795948/build
host$ rm -rf debian_rootfs/lib/modules/4.14.67-g7795948/source
注:最好指定安装路径,默认路径为/,若不指定安装路径且使用权限root执行,则安装到宿主机。
② 解压与挂载镜像
参考buildroot编译环境的示例。
③ 复制驱动模块
host$ cp -r debian_rootfs/lib/modules/4.14.67-g7795948/ /media/lib/modules/
host$ ls /media/lib/modules/4.14.67-g7795948/
④ 打包rootfs
参考buildroot编译环境的示例。
最后,特别说明一点。使用git管理的Linux BSP,编译的镜像发行版本随git commit ID而变化。若Linux 内核镜像升级,则也需要修改或替换Debian的驱动模块。频繁升级Linux给Debian带来不便,解决此问题可修改 scripts/setlocalversion 文件:
将 47行:if test -z "$(git rev-parse --show-cdup 2>/dev/null)" &&
改为:if test -n "$(git rev-parse --show-cdup 2>/dev/null)" &&

二、将镜像烧写到TF卡
下载完镜像后,可以在Ubuntu或者Windos系统下将镜像烧写到TF卡,但要注意的是,下载的镜像是经过压缩的xz格式的压缩包,因此,在两种系统下都需要先安装解压缩工具。
Ubuntu下的烧写
a、安装xz工具
$sudo apt-get install xz-utils
b、解压镜像包
$xz -d XX.img.xz
c、烧写部分,请参考https://help.ubuntu.com/community/Installation/FromImgFiles#Ubuntu
Windos下的烧写
详细步骤请参考http://beagleboard.org/getting-started#update,需要注意的是,7-zip工具可以按照实际情况安装,如已经安装了可解压xz格式的工具(如好压),则无需安装。
烧写完成后,无论哪种镜像,都会在TF卡里生成一个ext4格式的rootfs分区,里面存放的就是Debian系统。
三、EMMC烧写
根据前文所述,需要先将前一步骤烧写完成的TF卡里的rootfs分区里的文件拷贝出来,制作成压缩包,然后根据光盘提供的EMMC烧写相关手册,将系统烧写到EMMC。由于Windos下不能识别ext4格
式的分区,并且在Windos下操作根文件系统文件会导致一些文件的属性(如链接和权限属性)丢失,因此,以下步骤需要在Ubuntu下操作,并且是在root用户权限下的操作:
1、插入TF卡,一般自动挂载到/media目录下
2、将TF卡里rootfs分区所有文件拷贝出来,并制作成压缩包
#cp /media/rootfs/ ./ -a
#cd rootfs
#tar -zcvf rootfs.tar.gz ./*
执行完成后,生成rootfs.tar.gz文件,也可使用tar -cvf rootfs.tar ./*命令,生成tar格式的压缩包。至此,可根据光盘提供的EMMC烧写相关手册,将系统烧写到EMMC。
边栏推荐
- Niuke - bm39 serialized binary tree [hard]
- G. Count the trains (thought set + two points)
- Typora expiration solution, what if typora can't open
- [tips] what if you type with double quotation marks on the keyboard and the quotation marks disappear
- Zhinai buys melons (DP backpack)
- How to modify Oracle functions?
- SQLyog数据导入导出图文教程
- FFT用于估计插值后的图像重采样因子
- SQL manual blind injection and error reporting injection
- D. Rating compression (thinking + double pointer)
猜你喜欢

Create a future and enjoy extraordinary | gbase Nantah General Motors unveiled opengauss Developer Day 2022

Worthington papain - production of glycopeptides from purified proteoglycans (attached Literature)

P3166 number triangle (tolerance and exclusion +gcd)

E. Split into two sets

IP address of the network

pt-onnx-ncnn转换的问题记录(接yolov5训练)

How to use the pagoda panel to deploy the full stack project of node to the server

网络之二三层转发

【Verilog数字系统设计(夏宇闻)4-----Verilog语法的基本概念2】

推荐系统-协同过滤在Spark中的实现
随机推荐
Redis集群搭建(基于6.x)
Jupiter notebook reported an error: notebook validation failed: non unique cell ID '2a4xx6' detected
Installing and using R in Anaconda
flutter 下 grpc list没有Setter 方法 ,如何使用相关属性
E. Split into two sets
flink sql 如何配置打印insert实参日志呢
There is no setter method in grpc list under flutter. How to use related attributes
Implementation of recommendation system collaborative filtering in spark
The import and Export button of Damon database table is gray, and the DMP file cannot be imported
餐饮连锁门店重塑增长背后的数字化转型
Proto conversion dart | project uses protobuf | fluent uses grpc
DQN Pytorch示例
Guys, the flinksql datahub source table has a field timestamp 16 bits, which is written to ora
D - Dire Wolf (interval DP)
Mark and lightbulbs (thinking)
My Mysql to MySQL data table synchronization, only the code written in the first order will take effect, and the rest will not take effect. This may be
Go operation excel library excel use
Implementation of C iterator
Characteristics and determination of neuraminidase from Clostridium perfringens in Worthington
Study notes: original code, inverse code, complement code