**已关闭。**此问题为not about programming or software development。它目前不接受回答。
这个问题似乎与a specific programming problem, a software algorithm, or software tools primarily used by programmers无关。如果您认为该问题与another Stack Exchange site上的主题相符,您可以发表评论,说明在何处可以回答该问题。
14小时前关门了。
Improve this question的
我想通过fw_setenv
命令更改Linux中的u-boot环境变量。当我尝试通过fw_printenv
打印环境变量时,没有错误或警告,它工作正常。然而,当我尝试更改这些变量时,我得到了一个错误:“无法打开/dev/mtd 4:权限被拒绝”。我的设置如下:
在DTS中:
nor@0,0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "cfi-flash";
reg=<0x0 0x0 0x1000000>;
bank-width = <2>;
device-width = <1>;
partition@0 {
/* This location must not be altered */
/* 256KB for Vitesse 7385 Switch firmware */
reg=<0x0 0x00040000>;
label="NOR Vitesse-7385 Firmware";
read-only;
};
partition@40000 {
/* 256KB for DTB Image */
reg=<0x00040000 0x00040000>;
label = "NOR DTB Image";
};
partition@80000 {
/* 3.5 MB for Linux Kernel Image */
reg = <0x00080000 0x00380000>;
label = "NOR Linux Kernel Image";
};
partition@400000 {
/* 11MB for JFFS2 based Root file System */
reg=<0x00400000 0x00b00000>;
label = "NOR JFFS2 Root File System";
};
partition@f20000 {
/* 8KB for u-boot Environment Variables */
reg=<0x00f20000 0x00002000>;
label = "NOR U-Boot Environment Variable";
};
partition@f40000 {
/* This location must not be altered */
/* 512KB for u-boot Bootloader Image */
reg=<0x00f40000 0x000C0000>;
label = "NOR U-Boot Image";
};
字符串
};
在Linux中:
mtd0: 00040000 00020000 "NOR Vitesse-7385 Firmware"
mtd1: 00040000 00020000 "NOR DTB Image"
mtd2: 00380000 00020000 "NOR Linux Kernel Image"
mtd3: 00b00000 00020000 "NOR JFFS2 Root File System"
mtd4: 00002000 00020000 "NOR U-Boot Environment Variable"
mtd5: 000c0000 00020000 "NOR U-Boot Image"
型
这些配置中有什么问题?谢谢你的帮助..
1条答案
按热度按时间qjp7pelc1#
字符串
分区大小为8 kb,但闪存擦除大小为128 kb。分区必须在擦除/写入块边界上开始和结束才能写入。