vxWorks应用程序怎么能让系统重启
发布时间:2010-06-14 16:48:45 文章来源:www.iduyao.cn 采编人员:星星草
求教:vxWorks应用程序如何能让系统重启?
vxWorks应用程序如何能让系统重启?
------解决方案--------------------
reboot函数。参见帮助。
------解决方案--------------------
直接写控制重启的那个寄存器。
------解决方案--------------------
没有重启是你的BSP没有支持。
------解决方案--------------------
嵌入式系统中一般都有硬件狗,有CPU狗也有外狗,确认一下它是如何设置的,如果已经使能了锁中断之后死循环
就可以复位,比调reboot要彻底一些。
------解决方案--------------------
STATUS sysToMonitor
(
int startType /* parameter passed to ROM to tell it how to boot */
)
就是它了~~reboot最后会调用到这个函数
其实应用程序可以使用的RESET要查找CPU的软硬中断资源的~~实在不行WDT超时不也重启了
------解决方案--------------------
roboot函数并不会充气系统,但会调用syslib.c中的sysToMonitor函数
/*******************************************************************************
*
* sysToMonitor - transfer control to the ROM monitor
*
* This routine transfers control to the ROM monitor. Normally, it is called
* only by reboot()--which services ^X--and by bus errors at interrupt level.
* However, in some circumstances, the user may wish to introduce a
* <startType> to enable special boot ROM facilities.
*
* The entry point for a warm boot is defined by the macro ROM_WARM_ADRS
* in config.h. We do an absolute jump to this address to enter the
* ROM code.
*
* RETURNS: Does not return.
*/
STATUS sysToMonitor
(
int startType /* parameter passed to ROM to tell it how to boot */
)
{
FUNCPTR pRom = (FUNCPTR) (ROM_WARM_ADRS);
int ix;
intLock (); /* disable interrupts */
cacheDisable (INSTRUCTION_CACHE); /* Disable the Instruction Cache */
cacheDisable (DATA_CACHE); /* Disable the Data Cache */
#if (CPU == PPC604)
vxHid0Set (vxHid0Get () & ~_PPC_HID0_SIED); /* Enable Serial Instr Exec */
#endif /* (CPU == PPC604) */
/* Turn off timer */
#ifdef INCLUDE_AUX_CLK
sysAuxClkDisable();
#endif
/* turn off all i8259 int's */
for (ix = 0; ix < WB_MAX_IRQS; ix++)
{
intDisable (ix + INT_NUM_IRQ0);
}
for (ix = 0; ix < EPIC_MAX_EXT_IRQS; ix++)
{
intDisable (ix);
}
sysEpicInit(EPIC_DIRECT_IRQ, (ULONG)0); /* reset the epic registers */
#if FALSE /* sandpoint errata: do not enable this until fixed in X3 rev */
{
UINT8 resetVal;
pciConfigInByte (WB_PCI_BUS, WB_PCI_DEV, WB_PCI_FUNC,
WB_PCI_CLK_DIV_INDX, &resetVal);
pciConfigOutByte (WB_PCI_BUS, WB_PCI_DEV, WB_PCI_FUNC,
WB_PCI_CLK_DIV_INDX, (resetVal | WB_RSTDRV_BIT));
/* 50 ms delay to allow ISA & PCI RST to settle */
sysMsDelay (50);
}
#endif
vxMsrSet (0); /* Clear the MSR */
(*pRom) (startType); /* jump off to romInit.s */
return (OK); /* in case we continue from ROM monitor */
}
------解决方案--------------------
taskSpawn("rebooting", 10, 0, 1024, (FUNCPTR)reboot,
BOOT_QUICK_AUTOBOOT, 0, 0, 0, 0, 0, 0, 0, 0, 0);
------解决方案--------------------
(void(*)(void))reset_addr
其中reset_addr就是你的复位地址,根据你的CPU类型和你的BSP设置定
------解决方案--------------------
reboot让系统重新创建任务。
------解决方案--------------------
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。
其他相似内容:
-
Tilcon下的Table控件问题
VxWorks5.5+Tilcon5.4环境下~~
在程序中如何在Table的最后新增一行?
------解决方案-----------------...
-
关于vxworks的inflate/deflate
请问各位大侠,在vxworks中,针对不同架构的cpu的vxworks代码中,应该是采用相同的inflate/deflate解压...
-
tornado安装问题
请高手帮忙:
问下tornado的安装过程中,如果从开始菜单直接运行tornado,会提示错误,这是因为安装还没有完成,在C盘Torn...
-
vxworks系统启动很慢
小弟最近在做一个vxworks下的项目,目前系统基本上已经搭建起来了,但是系统从flash上启动的时候非常的慢,经查看...
-
请问一下,一个任务accept产生的socket描述符怎么在另一个task的send函数中用,把那个Socket ID作为全局可以吗???谢谢!
有两个任务,一个接...
-
taskspawn 分配一个任务时,参数中有优先级,堆栈大小,我要怎么来写啊?刚刚搞这个东西。
taskspawn 分配一个任务时,参数中有优先级,堆栈...
-
谁会裸机运行pentium的cpu
谁会裸机运行pentium的cpu,能不能简单讲讲?
就是将cpu引导到保护模式后,进入到一段用户代码,这段代码是个...
-
如何根据字符数组去执行相应的函数或者查找到变量(急!)
现在需要在没有操作系统的powerPC上完成这样一个类似串口的输入输出功能。注...
-
关于vxworks TFFS文件系统搭建时 format 死机问题
我修改了tffsconfig.c systffs.c config.h 等文件,已经显示了 type size但是...
-
vxworks解压缩
请问各位大侠,vxworks的解压缩源代码怎么看不到啊?它是采用的通用deflate/inflate算法吗?
在命令行中defl...