4.6 uboot开发 - 修复启动
- 上文验证过了编译出来的镜像无法使用。
- 试试通过修改源码的方法,使其能够正常使用。
修改源码
-
通过上文可知,主要是
bootcmd bootargs
的值不对,找到这两个变量定义的地方,修改即可。 -
文件
include/configs/ss928v100.h
将CONFIG_BOOTCOMMAND
修改为mmc read 0 0x50000000 0x800 0x8000; bootm 0x50000000
-
注释掉
#include <config_distro_bootcmd.h>
,并在其后面添加以下内容:#define CONFIG_EXTRA_ENV_SETTINGS \ "bootargs=mem=3840M console=ttyAMA0,115200 clk_ignore_unused rw rootwait " \ "root=/dev/mmcblk0p4 rootfstype=ext4 " \ "blkdevparts=mmcblk0:1M(u-boot.bin),16M(kernel),19M(update),6144M(rootfs.ext4),8192M(oem),-(data)\0"
验证修改
-
重新生成镜像:
./build.sh -c ./build.sh
-
使用前文介绍的烧写工具烧写到板子里。
-
重启板子,他奶奶的,可以成功进系统了。
修改内容
-
如下:
diff --git a/include/configs/ss928v100.h b/include/configs/ss928v100.h index ebca49ed..54426b2e 100644 --- a/include/configs/ss928v100.h +++ b/include/configs/ss928v100.h @@ -176,14 +176,18 @@ e* ---------------------------------------------------------------------*/ */ /* Assume we boot with root on the seventh partition of eMMC */ -#define CONFIG_BOOTCOMMAND "bootm 0x42000000" +#define CONFIG_BOOTCOMMAND "mmc read 0 0x50000000 0x800 0x8000; bootm 0x50000000" #define CONFIG_SYS_USB_XHCI_MAX_ROOT_PORTS 2 #define CONFIG_USB_MAX_CONTROLLER_COUNT 2 #define BOOT_TARGET_DEVICES(func) \ func(USB, usb, 0) \ func(MMC, mmc, 1) \ func(DHCP, dhcp, na) -#include <config_distro_bootcmd.h> +// #include <config_distro_bootcmd.h> +#define CONFIG_EXTRA_ENV_SETTINGS \ + "bootargs=mem=3840M console=ttyAMA0,115200 clk_ignore_unused rw rootwait " \ + "root=/dev/mmcblk0p4 rootfstype=ext4 " \ + "blkdevparts=mmcblk0:1M(u-boot.bin),16M(kernel),19M(update),6144M(rootfs.ext4),8192M(oem),-(data)\0" /*allow change env*/ #define CONFIG_ENV_OVERWRITE