当前位置:网站首页>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。
边栏推荐
- 学习笔记:原码, 反码, 补码
- D. Rating compression (thinking + double pointer)
- Pt onnx ncnn conversion problem record (followed by yolov5 training)
- QT program beautification of the use of style sheets, QT uses pictures as the background and transparency of controls, QT custom button styles
- Alibaba cloud redis development specification
- 【独立站建设】shopify卖家:学会这几点,网上商店销量翻倍!
- Remember a laravel problem script @php artist package:discover handling the post autoload dump event returned with
- 6 + 1 skills of Software Test Engineer
- Phoenix中常用shell操作
- Qt程序美化之样式表的使用方法,Qt使用图片作为背景与控件透明化,Qt自定义按钮样式
猜你喜欢

Zhinai buys melons (DP backpack)
![[independent station construction] Shopify seller: learn these points and double the sales volume of online stores!](/img/52/8c1520db38ffa8927e975b6f244a65.png)
[independent station construction] Shopify seller: learn these points and double the sales volume of online stores!

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

Digital transformation behind the reshaping growth of catering chain stores

Pt onnx ncnn conversion problem record (followed by yolov5 training)

D. Rating compression (thinking + double pointer)

flutter 下 grpc list没有Setter 方法 ,如何使用相关属性

DialogRPT-Dialog Ranking Pretrained Transformers

pt-onnx-ncnn转换的问题记录(接yolov5训练)
![[Verilog digital system design (Xia Yuwen) 4 ----- basic concepts of Verilog syntax 2]](/img/fe/746ecaf4123072cca59d7510e9796c.png)
[Verilog digital system design (Xia Yuwen) 4 ----- basic concepts of Verilog syntax 2]
随机推荐
Worthington木瓜蛋白酶丨从纯化的蛋白聚糖生产糖肽(附文献)
Qt程序美化之样式表的使用方法,Qt使用图片作为背景与控件透明化,Qt自定义按钮样式
DialogRPT-Dialog Ranking Pretrained Transformers
推荐系统-协同过滤在Spark中的实现
How to display numbers / English time in Excel
Redis cluster construction (based on 6.x)
Leetcode/ numbers that appear only once
G. Count the trains (thought set + two points)
一种MCU事件型驱动C框架
Guys, the flinksql datahub source table has a field timestamp 16 bits, which is written to ora
【深入浅出玩转FPGA学习11----Testbench书写技巧2】
Turn: do the right thing efficiently
MPLS知识点
npm ERR! code ETIMEDOUTnpm ERR! syscall connectnpm ERR! errno ETIMEDOUTnpm ERR! network request t
NFT access tool premint was hacked and lost more than 370000 US dollars
Installing and using R in Anaconda
The detailed knowledge summary of MySQL can be collected
excel中怎么显示数字/英文时间
【2021】【论文笔记】红外及THz下的细胞膜生物效应——效应是现象,作用是机理——THz对医学的好处
6 + 1 skills of Software Test Engineer