您尚未登录。

楼主 # 2022-04-21 10:31:30

Gentlepig
会员
注册时间: 2018-10-24
已发帖子: 1,204
积分: 1140.5

如何彻底擦除emmc上的Boot分区?

多次烧录uboot及修改、增删环境变量后,感觉环境变量这里有问题。用mfgtools烧录uboot、内核、设备树、跟文件系统后,可以正常运行。
但是再次用uuu命令烧录我自己编译的uboot、内核、设备树,则启动总是失败。
比如最近的这次,uboot里有个提示faild to find boot.src。
有次是将所有环境变量都删了,用mfgtools烧录官方文件后能启动,再烧录我的uboot,执行printevn,却看不到几个环境变量。

那么,如何擦除emmc的boot分区呢?
uboot里有个mmc erase blk# cnt命令,我尝试过mmc erase 0# 100000,结果boot还能启动,环境变量也还在。只是找不到emmc里的fat和ext4分区了。

离线

楼主 #1 2022-04-21 11:26:40

Gentlepig
会员
注册时间: 2018-10-24
已发帖子: 1,204
积分: 1140.5

Re: 如何彻底擦除emmc上的Boot分区?

网上搜到了个命令:
dd if=/dev/zero of=/dev/bootloader

将bootloader改成了mmcblk1boot0和mmcblk1boot1,执行完后重启,结果还是有uboot...

---------------------------------------------------------------------

原来linux下默认boot区是只读的,需要执行:

echo 0 > /sys/block/mmcblk1boot0/force_ro
echo 0 > /sys/block/mmcblk1boot1/force_ro

后,再执行dd操作:

dd if=/dev/zero of=/dev/mmcblk1boot0
dd if=/dev/zero of=/dev/mmcblk1boot0

这样就把boot区擦除了,但是这样还是觉得有些麻烦,是进到系统里才擦除,有没有办法在uboot下擦除呢?

最近编辑记录 Gentlepig (2022-04-21 11:46:16)

离线

楼主 #2 2022-04-21 11:54:19

Gentlepig
会员
注册时间: 2018-10-24
已发帖子: 1,204
积分: 1140.5

Re: 如何彻底擦除emmc上的Boot分区?

擦出boot分区后,使用uuu烧录自己的uboot、内核、设备树,还是起不来,提示找不到boot.src。

U-Boot 2021.04 (Apr 18 2022 - 10:08:05 +0800)

CPU:   i.MX6ULL rev1.1 792 MHz (running at 396 MHz)
CPU:   Industrial temperature grade (-40C to 105C) at 55C
Reset cause: POR
Model: i.MX6 ULL 14x14 EVK Board
Board: MX6ULL 14x14 EVK
DRAM:  512 MiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
Loading Environment from MMC... *** Warning - bad CRC, using default environment

[*]-Video Link 0 (480 x 272)
        [0] lcdif@21c8000, video
In:    serial
Out:   serial
Err:   serial
switch to partitions #0, OK
mmc1(part 0) is current device
flash target is MMC:1
Net:   
Error: ethernet@20b4000 address not set.

Error: ethernet@20b4000 address not set.

Error: ethernet@20b4000 address not set.
FEC: can't find phy-handle

Error: ethernet@20b4000 address not set.
Could not get PHY for FEC0: addr 2

Error: ethernet@20b4000 address not set.
FEC: can't find phy-handle

Error: ethernet@20b4000 address not set.
Could not get PHY for FEC0: addr 2
No ethernet found.

Fastboot: Normal
Normal Boot
Hit any key to stop autoboot:  0 
switch to partitions #0, OK
mmc1(part 0) is current device
switch to partitions #0, OK
mmc1(part 0) is current device
Failed to load 'boot.scr'
9402352 bytes read in 209 ms (42.9 MiB/s)
Booting from mmc ...
40618 bytes read in 3 ms (12.9 MiB/s)
Kernel image @ 0x80800000 [ 0x000000 - 0x8f77f0 ]
## Flattened Device Tree blob at 83000000
   Booting using the fdt blob at 0x83000000
   Using Device Tree in place at 83000000, end 8300cea9
Modify /soc/aips-bus@02200000/epdc@0228c000 disabled

Starting kernel ...

卡在这里了。

离线

#3 2022-04-21 12:00:12

ubuntu
会员
注册时间: 2020-03-30
已发帖子: 228
积分: 206

Re: 如何彻底擦除emmc上的Boot分区?

全志的SDK好像没有用到 mmcblk0boot0 mmcblk0boot1,直接用主分区的。

离线

#4 2022-04-21 12:36:16

yixiuge
会员
注册时间: 2022-04-07
已发帖子: 53
积分: 63

Re: 如何彻底擦除emmc上的Boot分区?

A64 emmc boot0启动问题
https://whycan.com/t_4437.html


请教大家,A33 接了 eMMC, Linux识别到 boot0, boot1 是什么操作?eMMC特有的分区?
https://whycan.com/t_4735.html#p47906


帮不上忙, 找到了两个相关帖子,看有没有参考价值。

离线

楼主 #5 2022-04-21 14:56:35

Gentlepig
会员
注册时间: 2018-10-24
已发帖子: 1,204
积分: 1140.5

Re: 如何彻底擦除emmc上的Boot分区?

感谢两位回复。

又用mfgtools下载了官方固件,发现也有找不到boot.src这个提示,看来这个是无关紧要的。我编译的起不来另有原因。

这是官方固件启动信息:

reading logo.bmp
** Unable to read file logo.bmp **
switch to partitions #0, OK
mmc1(part 0) is current device
switch to partitions #0, OK
mmc1(part 0) is current device
reading boot.scr
** Unable to read file boot.scr **
reading zImage
6326880 bytes read in 155 ms (38.9 MiB/s)
Booting from mmc ...
reading imx6ull-14x14-evk.dtb
40618 bytes read in 18 ms (2.2 MiB/s)
Kernel image @ 0x80800000 [ 0x000000 - 0x608a60 ]
## Flattened Device Tree blob at 83000000
   Booting using the fdt blob at 0x83000000
   Using Device Tree in place at 83000000, end 8300cea9

Starting kernel ...

Booting Linux on physical CPU 0x0
Linux version 4.1.15-2.1.0 (any@Any-Desktop) (gcc version 7.4.0 (Buildroot 2019.02.6-g28f7d48) ) #1 SMP PREEMPT Mon Jan 13 16:11:02 CST 2020

------------------------------------------------------------------

问题找到了,用mfgtools烧写官方固件,设备树名称是imx6ull-14x14-evk.dtb。
官方提供的最新的uboot,boot选项下设备树的默认名称,也是imx6ull-14x14-evk.dtb。
我用的是emmc版本的野火的核心板,所以想当然的用了imx6ull-14x14-evk-emmc.dtb。结果没认出这个设备数来,而同名的原设备树虽然存在,但是和这个貌似不搭配。
修改名称重新下载后没事了。

查看了-emmc.dts,发现包含了不带emmc的设备树文件,额外加了些内容。

/*
 * Copyright 2019 NXP
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 */

#include "imx6ull-14x14-evk.dts"

&usdhc2 {
	pinctrl-names = "default", "state_100mhz", "state_200mhz";
	pinctrl-0 = <&pinctrl_usdhc2_8bit>;
	pinctrl-1 = <&pinctrl_usdhc2_8bit_100mhz>;
	pinctrl-2 = <&pinctrl_usdhc2_8bit_200mhz>;
	bus-width = <8>;
	non-removable;
	status = "okay";
};

最近编辑记录 Gentlepig (2022-04-21 15:57:24)

离线

#6 2023-10-24 15:11:25

不吃奶瓶的
会员
注册时间: 2023-10-24
已发帖子: 1
积分: 1

Re: 如何彻底擦除emmc上的Boot分区?

请教楼主,如何擦除eMMC 的Boot 分区?目前手头有一个芯片,MLC改为SLC 了,里面有分区,有偿求教

离线

楼主 #7 2023-10-25 15:57:52

Gentlepig
会员
注册时间: 2018-10-24
已发帖子: 1,204
积分: 1140.5

Re: 如何彻底擦除emmc上的Boot分区?

我不知啊,买了野火的imx6ull mini板,就刚买时玩了玩,想在ubuntu下实现烧录,搜到了uuu这个工具,后来忘了咋样了,最后就是扔一边吃灰去了...
嵌入式linux 编译烧录这方面,没继续琢磨...

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn