专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > VxWorks

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让系统重新创建任务。
------解决方案--------------------
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: