本文主要是介绍如何让 uboot启动时自动执行指令?(执行“mtdparts default”命令),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
让uboot启动时自动设置分区(执行“mtdparts default”命令),在uboot进入main_loop()死循环之前添加执行命令代码
run_command("mtdparts default", 0);
#define MTDIDS_DEFAULT "nand0=mini2440-nand"
#define MTDPARTS_DEFAULT "mtdparts=mini2440-nand:"BOOT_SIZE"k(u-boot),128k(params),5m(kernel),-(root);"
MINI2440 # mtdparts default
MINI2440 #
MINI2440 # mtdparts---list_partitions---
device nand0 <mini2440-nand>, # parts = 4
#: name size offset mask_flags
0: u-boot 0x00040000 0x00000000 0
1: params 0x00020000 0x00040000 0
2: kernel 0x00500000 0x00060000 0
3: root 0x03aa0000 0x00560000 0active partition: nand0,0 - (u-boot) 0x00040000 @ 0x00000000
defaults:
mtdids : nand0=mini2440-nand
mtdparts: mtdparts=mini2440-nand:256k(u-boot),128k(params),5m(kernel),-(root);
MINI2440 #
MINI2440 #
这篇关于如何让 uboot启动时自动执行指令?(执行“mtdparts default”命令)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!