vxWorks 无法启动问题定位
vxWorks无法启动问题定位办法
- 现象
Press any key to stop auto-boot...
1
auto-booting...
boot device : motetsec
unit number : 0
processor number : 0
host name : host
file name : vxWorks
inet on ethernet (e) : 192.168.0.207:ffffff00
host inet (h) : 192.168.0.106
user (u) : xygm
ftp password (pw) : xygm
flags (f) : 0x8
target name (tn) : xygm
Booting from flash ...
Loading /vxWorks @ 0xf0400000 ... Not found
Loading /vxWorks @ 0xf0a00000 ... Not found
192.168.0.106 @ motetsec0(192.168.0.107:ffff0000)
Loading... 2269760 + 557152
Starting at 0x100000...
即vxworks启动过程中死机了,有的项目是加载到这里卡死,不动,直到看门狗复位重启。有的项目是加载到这里,死机了马上重启。本项目是加载到这里卡死不动。
2.解决办法:
解决此办法必须了解vxworks的启动流程,大致如下:
辅助办法 : <1> 点灯,直接操作GPIO引脚,观察启动过程中led的状态变化。
<2> 加汇编指令, 如WRS_ASM(“EIEO”);通过仿真器查看CPU最终的运行状态。
显然方法1 能更快捷的定位问题。
定位步骤如下:
一般会首先联想到是驱动问题。
PrjConfig.c (hardWareInterFaceBusInit)
如果这里还不能解决问题,就需要按照vxworks的启动流程,步步跟踪,查看出问题的地方在哪里.
函数调用过程
usrInit(prjconfig.c)->SysHwInit(sysLib.c) ->hardWareInterFaceInit(prjconfig.c) ->hardWareInterFaceBusInit(prjconfig.c)->
usrInit 很有多重要的初始化
void usrInit (int startType)
{
sysStart (startType); /* clear BSS and set up the vector table base address. */
usrBootHwInit (); /* call usrBootHwInit() routine */
cacheLibInit (USER_I_CACHE_MODE, USER_D_CACHE_MODE); /* include cache support */
excShowInit (); /* exception show routines */
excVecInit (); /* exception handling */
vxCpuLibInit (); /* Enable the initialization of CPU identification routines */
sysHwInit (); /* call the BSPs sysHwInit routine during system startup */
usrCacheEnable (); /* optionally enable caches */
objInfoInit (); /* object management routines that requires lookup in a list of objects, such as the objNameToId() routine. */
objLibInit ((OBJ_ALLOC_FUNC)FUNCPTR_OBJ_MEMALLOC_RTN, (OBJ_FREE_FUNC)FUNCPTR_OBJ_MEMFREE_RTN, OBJ_MEM_POOL_ID, OBJ_LIBRARY_OPTIONS); /* object management */
vxMemProbeInit (); /* Initialize vxMemProbe exception handler support */
classListLibInit (); /* object class list management */
semLibInit (); /* semaphore support infrastructure */
/* mutex semaphores */
/* mutex semaphore creation routine */
classLibInit (); /* object class management */
kernelBaseInit (); /* required component DO NOT REMOVE. */
taskCreateHookInit (); /* user callouts on task creation/deletion */
sysDebugModeInit (); /* a flag indicating the system is in 'debug' mode */
usrKernelInit (VX_GLOBAL_NO_STACK_FILL); /* context switch and interrupt handling (DO NOT REMOVE). */
}
usrKernelInit(target/config/comps/src/usrkernel.c) ->usrRoot->
usrRoot 会调用usrAppInit,用户函数入口。
void usrRoot (char *pMemPoolStart, unsigned memPoolSize)
{
// *(volatile UINT32*)(0xffe00000 + 0xF008) =0; //运行到这里来
usrKernelCoreInit (); /* core kernel facilities */
poolLibInit(); /* memory pools of fixed size items */
memEdrInit (); /* Memory Error Detection and Reporting */
memInit (pMemPoolStart, memPoolSize, MEM_PART_DEFAULT_OPTIONS); /* full featured memory allocator */
memPartLibInit (pMemPoolStart, memPoolSize); /* core memory partition manager */
memEdrInit2(); /* Memory Error Detection and Reporting */
usrAimMmuConfig (); /* AIM MMU configlette */
if (memDefaultAlignment<16) memDefaultAlignment = 16; /* Because FileSytem use malloc() to allocate ATA I/O buffer, if the buffer is not aligned 16 bytes, driver for some ATA controller(such as, CS5530), will copy data to/from aligned buffer before write/read. This is a serious reduction in efficiency. Include me to avoid it. */
/* basic MMU component */
usrMmuInit ((VIRT_ADDR) pMemPoolStart, memPoolSize); /* MMU global map support */
usrKernelCreateInit (); /* object creation routines */
memInfoInit (); /* memory allocator info routines */
envLibInit (ENV_VAR_USE_HOOKS); /* unix compatible environment variables */
usrPmInit (); /* reboot-safe protected memory region manager */
usrEdrInit (); /* reboot-safe protected error log */
edrStubInit (); /* protected error log stub initialization */
usrTextProtect (); /* write-protect program text */
excIntNestLogInit(); vxMsrSet(vxMsrGet() | taskMsrDefault); /* Enable interrupts at appropriate point in root task */
// *(volatile UINT32*)(0xffe00000 + 0xF008) =0; //运行到这里来
logInitEarly(MAX_LOG_MSGS); /* ZYHD extend of logLib */
// *(volatile UINT32*)(0xffe00000 + 0xF008) =0; //运行到这里来
usrSysHwInit2(); /* call the usrSysHwInit2 routine during
这个函数要注意,往往不执行什么。
void usrSysHwInit2 (void)
{
//因为vxworks必须肯定定义了该组件,所以不会执行sysHwInit2
#ifndef INCLUDE_SYSCLK_INIT
sysHwInit2();
#endif
}
system startup
// *(volatile UINT32*)(0xffe00000 + 0xF008) =0; //运行到这里来
sysClkInit (); /* System clock component */
void sysClkInit (void)
{
/* set up the system timer */
sysClkConnect ((FUNCPTR) usrClock, 0); /* connect clock ISR */
sysClkRateSet (SYS_CLK_RATE); /* set system clock rate */
sysClkEnable (); /* start it */
}
//==========================此时钟有问题
*(volatile UINT32*)(0xffe00000 + 0xF008) =0; //XXXXX运行BU 到这里来
usrIosCoreInit (); /* core I/O system */
// *(volatile UINT32*)(0xffe00000 + 0xF008) =0; //XXXXXX运行BU到这里来
usrKernelExtraInit (); /* extended kernel facilities */
usrIosExtraInit (); /* extended I/O system */
sockLibInit (); /* Socket API */
usrNetworkInit (); /* Initialize the network subsystem */
selTaskDeleteHookAdd (); /* selectInit, part 2, install task delete hook */
cpuPwrLightMgrInit (); cpuPwrMgrEnable (TRUE); /* Idle-halt CPU power management */
cplusCtorsLink (); /* run compiler generated initialization functions at system startup */
usrCplusLibInit (); /* Basic support for C++ applications */
cplusDemanglerInit (); /* Support library for kernel shell and loader: provides human readable forms of C++ identifiers */
// *(volatile UINT32*)(0xffe00000 + 0xF008) =0; //XXXXXX 没运行到这里来
usrToolsInit (); /* software development tools */
usrMmuOptimize (); /* Optimize configlette */
// *(volatile UINT32*)(0xffe00000 + 0xF008) =0; //xxxxxx运行不到这里来
usrAppInit (); /* call usrAppInit() (in your usrAppInit.c project file) after startup. */
wdbIpAddr(); /* BOOL wdbIpAddr(BOOL bShow). if not INCLUDE_WDB_COMM_END, the routine is dummy. */
}
还有一种方法是去掉hwconfig.c中的设备列表,去掉之后,prjconfig.c中的相关设备驱动就无法加载,两者效果是一致的。
这里解决办法是,修改设备列表的内容,而不是像以前那样注释掉hardWareInit里面的注册函数,两者效果应该是一致的,但是前者可以rebuild,后者rebuild 后要手动修改。
各类问题欢迎进群讨论:QQ群:245079182
vxWorks 无法启动问题定位相关推荐
- taskspawn函数 linux,vxworks的启动任务taskSpawn
vxworks启动线程任务的api接口和linux有所不同,vxworks采用的是taskSpawn. 如下代码所示: #include #include #include #include #inc ...
- PC104上配置VxWorks硬盘启动详解
DEVPC104-SYS是一款在 PC104 尺寸上开发出来的嵌入式工业主板.以其小巧的体积﹑超强的功能和稳定性,可广泛应用于自动查询系统﹑POS 机﹑网络终端﹑仪器仪表﹑信息家电.工业控制等各种嵌入 ...
- 启动命令提示符定位到D盘java文件夹
开始 运行 cmd 进入命令提示符 d: 回车 进入D盘 cd java 进入文件夹
- js摇奖 转载
查看全文 http://www.taodudu.cc/news/show-3790499.html 相关文章: 建议初创团队起初也要构建分布式应用 C语言堆栈 西电"智能星"第一届 ...
- VxWorks启动之romStart剖析
0 引言 在VxWorks BSP中,从romInit.s跳转到romStart()那一刻起,我们便开始从汇编乾坤大挪移到C的世界.作为VxWorks BSP中的第一个C函数,它的主要任务是清空内存( ...
- VxWorks启动过程具体解释
上一节主要是从映像的分类和各种映像的大致载入流程上看VxWorks的启动过程,这一节让我们从函数级看一下VxWorks的启动过程: 1. Boot Image + Loadable Images: 以 ...
- vxworks启动详解
1 三种不同的VxWorks映象比较 VxWorks是一种灵活的.可裁剪的嵌入式实时操作系统.用户可以根据需要创建自己的VxWorks映象,由它来引导目标系统,而后下载并运行应用程序. 根据应用场合的 ...
- VxWorks启动过程描述及主要宏开关含义
1 三种不同的VxWorks映象比较 VxWorks是一种灵活的.可裁剪的嵌入式实时操作系统.用户可以根据需要创建自己的VxWorks映象,由它来引导目标系统,而后下载并运行应用程序. 根据应用场合的 ...
- VxWorks 启动程序的四种方法
文章目录 1.背景介绍 1.1.Vxworks工程 1.2.Vxworks shell 2.内核应用程序(DKM)自启动 2.1.需求来源 2.2.方案1(失败) 2.3.方案2(成功) 3.用户应用 ...
最新文章
- DHCP自动分配地址;DHCP指定IP给客户端
- HTML5全局属性和事件
- mysql索引组织结构_MySQL中创建及优化索引组织结构的思路(3)
- 直男的回答能多出乎意料?
- 3d打印英语文献_锐医学院 | 只需10分钟!解读康复医学文献+英语学习
- Reg“.NET研究”exOptions.Compiled的含义和使用
- Java Applet编程总结
- 【JAVA实例】代码生成器的原理讲解以及实际使用
- bz2解压命令_Linux下的tar压缩解压缩命令
- 树状数组---Squared Permutation
- Django配置文件常用信息
- 安装cm初始脚本配置数据库scm_prepare_database.sh(在主节点上)遇到的问题
- python如何退出虚拟环境_python 虚拟环境
- Android studio底部Logcat模块不见了以及Locat日志中包含了很多无用的错误日志筛选方法
- 概率论中的矩母函数(MGF)
- java版Spring Cloud+b2b2c多商户分布式微服务
- 人到底是为了什么活着?
- jquery调色板_使用jQuery的调色板生成器
- 物理每日一题(hyq的1、2)
- Windows手动配置ip
热门文章
- 音视频开发系列(28)AudioTrack播放PCM音频
- 【机器学习】自动编码器
- 【转载】IPSec-Tools配置
- ORACLE数据库之ORA-02290检查校验问题解析
- pythorch显卡利用率过低的问题
- linux nfs引起重启,linux下面重启nfs报错:nfs-server.service:main process exited
- python生成json_Python JSON 教程
- Unity 触摸屏旋转和缩放
- 【编程100%】22-02 基础算法之KTV
- 安装包制作工具 SetupFactory使用4:安装时写入注册表和拷贝文件到指定目录