nand scrub使用方法
nandscrub的使用,在uboot里面使用可以删除标记的坏块,这样就把整个flash格式化了,我试着添加了参数,例如nandscrub0xc000000就是把从首地址...
nand scrub的使用,在uboot里面使用可以删除标记的坏块,这样就把整个flash格式化了,
我试着添加了参数,例如nand scrub 0xc000000 就是把从首地址为0xc000000,后面的格式化了
同理,我试了nand scrub 0xc000000 0x4000000,想把首地址为0xc000000,格式化长度为0x4000000,
结果失败了,如何能实现低格指定地址,大小的flash呢?谢谢! 展开
我试着添加了参数,例如nand scrub 0xc000000 就是把从首地址为0xc000000,后面的格式化了
同理,我试了nand scrub 0xc000000 0x4000000,想把首地址为0xc000000,格式化长度为0x4000000,
结果失败了,如何能实现低格指定地址,大小的flash呢?谢谢! 展开
展开全部
如果nand flash大小没问题,建议这样试试:
nand scrub -y 0xc000000 0x4000000
详情请查看u-boot中的cmd_nand.c文件中相关部分:
/*
* Syntax is:
* 0 1 2 3 4
* nand erase [clean] [off size]
*/
if (strncmp(cmd, "erase", 5) == 0 || strncmp(cmd, "scrub", 5) == 0) {
nand_erase_options_t opts;
/* "clean" at index 2 means request to write cleanmarker */
int clean = argc > 2 && !strcmp("clean", argv[2]);
int scrub_yes = argc > 2 && !strcmp("-y", argv[2]);
int o = (clean || scrub_yes) ? 3 : 2;
int scrub = !strncmp(cmd, "scrub", 5);
int spread = 0;
int args = 2;
const char *scrub_warn =
"Warning: "
"scrub option will erase all factory set bad blocks!\n"
" "
"There is no reliable way to recover them.\n"
" "
"Use this command only for testing purposes if you\n"
" "
"are sure of what you are doing!\n"
"\nReally scrub this NAND flash? <y/N>\n";
if (cmd[5] != 0) {
if (!strcmp(&cmd[5], ".spread")) {
spread = 1;
} else if (!strcmp(&cmd[5], ".part")) {
args = 1;
} else if (!strcmp(&cmd[5], ".chip")) {
args = 0;
} else {
goto usage;
}
}
/*
* Don't allow missing arguments to cause full chip/partition
* erases -- easy to do accidentally, e.g. with a misspelled
* variable name.
*/
if (argc != o + args)
goto usage;
printf("\nNAND %s: ", cmd);
/* skip first two or three arguments, look for offset and size */
if (arg_off_size(argc - o, argv + o, &dev, &off, &size) != 0)
return 1;
nand = &nand_info[dev];
memset(&opts, 0, sizeof(opts));
opts.offset = off;
opts.length = size;
opts.jffs2 = clean;
opts.quiet = quiet;
opts.spread = spread;
if (scrub) {
if (!scrub_yes)
puts(scrub_warn);
if (scrub_yes)
opts.scrub = 1;
else if (getc() == 'y') {
puts("y");
if (getc() == '\r')
opts.scrub = 1;
else {
puts("scrub aborted\n");
return -1;
}
} else {
puts("scrub aborted\n");
return -1;
}
}
ret = nand_erase_opts(nand, &opts);
printf("%s\n", ret ? "ERROR" : "OK");
return ret == 0 ? 0 : 1;
}
nand scrub -y 0xc000000 0x4000000
详情请查看u-boot中的cmd_nand.c文件中相关部分:
/*
* Syntax is:
* 0 1 2 3 4
* nand erase [clean] [off size]
*/
if (strncmp(cmd, "erase", 5) == 0 || strncmp(cmd, "scrub", 5) == 0) {
nand_erase_options_t opts;
/* "clean" at index 2 means request to write cleanmarker */
int clean = argc > 2 && !strcmp("clean", argv[2]);
int scrub_yes = argc > 2 && !strcmp("-y", argv[2]);
int o = (clean || scrub_yes) ? 3 : 2;
int scrub = !strncmp(cmd, "scrub", 5);
int spread = 0;
int args = 2;
const char *scrub_warn =
"Warning: "
"scrub option will erase all factory set bad blocks!\n"
" "
"There is no reliable way to recover them.\n"
" "
"Use this command only for testing purposes if you\n"
" "
"are sure of what you are doing!\n"
"\nReally scrub this NAND flash? <y/N>\n";
if (cmd[5] != 0) {
if (!strcmp(&cmd[5], ".spread")) {
spread = 1;
} else if (!strcmp(&cmd[5], ".part")) {
args = 1;
} else if (!strcmp(&cmd[5], ".chip")) {
args = 0;
} else {
goto usage;
}
}
/*
* Don't allow missing arguments to cause full chip/partition
* erases -- easy to do accidentally, e.g. with a misspelled
* variable name.
*/
if (argc != o + args)
goto usage;
printf("\nNAND %s: ", cmd);
/* skip first two or three arguments, look for offset and size */
if (arg_off_size(argc - o, argv + o, &dev, &off, &size) != 0)
return 1;
nand = &nand_info[dev];
memset(&opts, 0, sizeof(opts));
opts.offset = off;
opts.length = size;
opts.jffs2 = clean;
opts.quiet = quiet;
opts.spread = spread;
if (scrub) {
if (!scrub_yes)
puts(scrub_warn);
if (scrub_yes)
opts.scrub = 1;
else if (getc() == 'y') {
puts("y");
if (getc() == '\r')
opts.scrub = 1;
else {
puts("scrub aborted\n");
return -1;
}
} else {
puts("scrub aborted\n");
return -1;
}
}
ret = nand_erase_opts(nand, &opts);
printf("%s\n", ret ? "ERROR" : "OK");
return ret == 0 ? 0 : 1;
}
名片
2024-10-28 广告
2024-10-28 广告
Altair HyperWorks是一套功能强大的集成化CAE(计算机辅助工程)软件平台,由Altair公司开发。它涵盖了结构分析、流体动力学、优化、多体动力学、电磁场仿真等多个领域,提供了丰富的仿真工具和优化算法。HyperWorks以其...
点击进入详情页
本回答由名片提供
展开全部
nand scrub 0xc000000 0x4000000
这条命令是没错的,也可以使用。
结果失败要看是那种问题导致的失败:
1.有可能超出nand大小,192M+64M = 256M
2.最大可能是硬件损伤,这种坏块是擦不掉的,不过一般驱动会自动屏蔽坏块,使用无区别
这条命令是没错的,也可以使用。
结果失败要看是那种问题导致的失败:
1.有可能超出nand大小,192M+64M = 256M
2.最大可能是硬件损伤,这种坏块是擦不掉的,不过一般驱动会自动屏蔽坏块,使用无区别
追问
没有超过nand大小,不是硬件损伤
nand scrub 0xc000000 0x4000000不能修复坏块
nand scrub 0xc000000 就可以
nand大小1G
追答
nand scrub 0xc000000是不指定擦除长度,直接擦除到器件末尾。你可以擦除后看下实际擦除长度是多少,指定长度不成功应该是长度错误
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询