|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
为了实现程序自动启动,在vxworks5.5中我是这样使用的(是参考网上资料,非原创!):
在BSP目录中的bootConfig.c的函数autoboot()的printf ("\nauto-booting...\n\n");的后面加上:
if (tffsLoad (0, 0, "/tffs/vxworks", &entry) == OK)
go (entry); /* ... and never return */
else if (tffsLoad (0, 0, "/tffs/vxworks.z", &entry) == OK)
go (entry);
else if (tffsLoad (0, 0, "/tffs/vxworks.bin", &entry) == OK)
go (entry);
else
{
printf ("Can't load boot file from TFFS!!\n");
printErr ("\nError loading file: errno = 0x%x.\n", errno);
taskDelay (sysClkRateGet ()); /* pause a second */
}
然后重新生成bootrom.bin,这样,bootrom启动时会先在/tffs文件系统上查找3个文件:vxworks、vxworks.z、
vxworks.bin,只要有任意一个文件,则直接读取该文件启动。这种方式我们已经用在产品上,是没有问题的。
现在,我们换了开发平台,从原来的Tornado2.2/vxWorks5.5换成Workbench3.0/vxworks6.6,CPU是MPC8315E,
硬件平台是freescale原厂的rdb8315e开发板。
Step1:
我是在C:\WindRiver-GPPVE-3.6-PPC-Eval\vxworks-6.6\target\src\boot\
bootAppShell.c中的函数autoboot()中 bootAppPrintf ("\nauto-booting...\n\n",0,0,0,0,0,0);后加入:
if (bootFsFileLoad ( "/tffs0/vxworks", &entry) == OK)
go (entry); /* ... and never return */
else if (bootFsFileLoad ( "/tffs0/vxworks.z", &entry) == OK)
go (entry);
else if (bootFsFileLoad ( "/tffs0/vxworks.bin", &entry) == OK)
go (entry);
else
{
printf ("Can't load boot file from TFFS!!\n");
printErr ("\nError loading file: errno = 0x%x.\n", errno);
taskDelay (sysClkRateGet ()); /* pause a second */
}
Step2:
我事先已建立了TFFS文件系统,并且已经把vxworks(是一个最小系统映像)存储在/tffs0/内,我重新在C:\WindRiver-GPPVE-3.6-PPC-Eval\vxworks-6.6\target\src\boot\
目录下运行:make CPU=PPC32 TOOL=gnu,该命令更新库文件libboot.a,
Step3:
在8315E的BSP目录下运行:make bootrom.bin,
Step4:
用U_BOOT将bootrom.bin重新编程到NOR FLASH中,上电。
结果:
出现的信息如下:
U-Boot 2009.03-rc2 (Jul 19 2010 - 14:31:08) MPC83XX
Reset Status:
CPU: e300c3, MPC8315E, Rev: 1.0 at 400 MHz, CSB: 133.333 MHz
Board: Freescale MPC8315ERDB Rev 0.1
I2C: ready
DRAM: 128 MB
FLASH: 8 MB
NAND: 32 MiB
PCIE0: No link
PCIE1: No link
In: serial
Out: serial
Err: serial
Net: eTSEC0, eTSEC1
Hit any key to stop autoboot: 0
## Starting application at 0xFE070100 ...
Bulk Class Driver Successfully Initialized
VxWorks System Boot
Copyright 1984-2007 Wind River Systems, Inc.
CPU: Freescale MPC8315E
Version: VxWorks 6.6
BSP version: 2.0/0
Creation date: Dec 22 2011, 15:46:25
Press any key to stop auto-boot...
0
auto-booting...
Loading /tffs0/vxworks...2279856
Starting at 0x10000...
Bulk Class Driver Successfully Initialized
Press any key to stop auto-boot...
0
auto-booting...
Loading /tffs0/vxworks...2279856
Starting at 0x10000...
Bulk Class Driver Successfully Initialized
Press any key to stop auto-boot...
0
auto-booting...
Loading /tffs0/vxworks...2279856
Starting at 0x10000...
Bulk Class Driver Successfully Initialized
设备反复启动。
大家帮帮忙吧!多谢!
转自Tony嵌入式论坛,地址:http://www.cevx.com/bbs/thread-42283-1-1.html |
|