Flash基础入门:通过UBI文件系统烧写flash
小标 2018-07-23 来源 : 阅读 2569 评论 0

摘要:本文主要向大家介绍了Flash基础入门的通过UBI文件系统烧写flash,通过具体的内容向大家展现,希望对大家学习Flash基础入门有所帮助。

本文主要向大家介绍了Flash基础入门的通过UBI文件系统烧写flash,通过具体的内容向大家展现,希望对大家学习Flash基础入门有所帮助。

appfs文件太大,虽然可以在uboot通过tftp传输来烧写。但是同样也可以通过ubi文件系统来做这件事情。

Nand分区划分如下:
device nand0 <nx_2017>, # parts = 4
 #: name                size            offset          mask_flags
 0: kernel              0x00a00000      0x00100000      0
 1: root                0x00f00000      0x00a00000      0
 2: appfs               0x05000000      0x01900000      0
 3: datac               0x01700000      0x06900000      0

 

板子配置nfs启动以后,先将分区格式化:
# ubiformat /dev/mtd2 -y

ubiformat: mtd2 (nand), size 83886080 bytes (80.0 MiB), 640 eraseblocks of 131072 bytes (128.0 KiB), min. I/O size 2048 bytes
libscan: scanning eraseblock 639 -- 100 % complete
ubiformat: 511 eraseblocks have valid erase counter, mean value is 0
ubiformat: 129 eraseblocks are supposedly empty
ubiformat: warning!: only 511 of 640 eraseblocks have valid erase counter
ubiformat: mean erase counter 0 will be used for the rest of eraseblock
ubiformat: use erase counter 0 for all eraseblocks
ubiformat: formatting eraseblock 639 -- 100 % complete

然后将这个分区attach到ubi文件系统中:
# ubiattach /dev/ubi_ctrl -m 2


UBI: attaching mtd2 to ubi0
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:    126976 bytes
UBI: smallest flash I/O unit:    2048
UBI: VID header offset:          2048 (aligned 2048)
UBI: data offset:                4096
UBI: attached mtd2 to ubi0
UBI: MTD device name:            "appfs"
UBI: MTD device size:            80 MiB
UBI: number of good PEBs:        640
UBI: number of bad PEBs:         0
UBI: max. allowed volumes:       128
UBI: wear-leveling threshold:    4096
UBI: number of internal volumes: 1
UBI: number of user volumes:     0
UBI: available PEBs:             630
UBI: total number of reserved PEBs: 10
UBI: number of PEBs reserved for bad PEB handling: 6
UBI: max/mean erase counter: 0/0
UBI: image sequence number: 1404847517
UBI: background thread "ubi_bgt0d" started, PID 695
UBI device number 0, total 640 LEBs (81264640 bytes, 77.5 MiB), available 630 LEBs (79994880 bytes, 76.3 MiB), LEB size 126976 bytes (124.0 KiB)

然后创建一个volume,名字为你的mtd分区名
# ubimkvol /dev/ubi0 -N appfs -m


Set volume size to 79994880
Volume ID 0, size 630 LEBs (79994880 bytes, 76.3 MiB), LEB size 126976 bytes (124.0 KiB), dynamic, name "appfs", alignment 1

然后mount这个volume到指定位置
# mount -t ubifs ubi0:appfs /mnt/

本文由职坐标整理并发布,希望对同学们有所帮助。了解更多详情请关注职坐标常用软件Flash频道!

本文由 @小标 发布于职坐标。未经许可,禁止转载。
喜欢 | 0 不喜欢 | 1
看完这篇文章有何感觉?已经有1人表态,0%的人喜欢 快给朋友分享吧~
评论(0)
后参与评论

您输入的评论内容中包含违禁敏感词

我知道了

助您圆梦职场 匹配合适岗位
验证码手机号,获得海同独家IT培训资料
选择就业方向:
人工智能物联网
大数据开发/分析
人工智能Python
Java全栈开发
WEB前端+H5

请输入正确的手机号码

请输入正确的验证码

获取验证码

您今天的短信下发次数太多了,明天再试试吧!

提交

我们会在第一时间安排职业规划师联系您!

您也可以联系我们的职业规划师咨询:

小职老师的微信号:z_zhizuobiao
小职老师的微信号:z_zhizuobiao

版权所有 职坐标-一站式IT培训就业服务领导者 沪ICP备13042190号-4
上海海同信息科技有限公司 Copyright ©2015 www.zhizuobiao.com,All Rights Reserved.
 沪公网安备 31011502005948号    

©2015 www.zhizuobiao.com All Rights Reserved

208小时内训课程