vxWorks无法启动问题定位办法

  1. 现象

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) ->hardWareInterFaceInitprjconfig.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 无法启动问题定位相关推荐

  1. taskspawn函数 linux,vxworks的启动任务taskSpawn

    vxworks启动线程任务的api接口和linux有所不同,vxworks采用的是taskSpawn. 如下代码所示: #include #include #include #include #inc ...

  2. PC104上配置VxWorks硬盘启动详解

    DEVPC104-SYS是一款在 PC104 尺寸上开发出来的嵌入式工业主板.以其小巧的体积﹑超强的功能和稳定性,可广泛应用于自动查询系统﹑POS 机﹑网络终端﹑仪器仪表﹑信息家电.工业控制等各种嵌入 ...

  3. 启动命令提示符定位到D盘java文件夹

    开始 运行 cmd 进入命令提示符 d: 回车 进入D盘 cd java 进入文件夹

  4. js摇奖 转载

    查看全文 http://www.taodudu.cc/news/show-3790499.html 相关文章: 建议初创团队起初也要构建分布式应用 C语言堆栈 西电"智能星"第一届 ...

  5. VxWorks启动之romStart剖析

    0 引言 在VxWorks BSP中,从romInit.s跳转到romStart()那一刻起,我们便开始从汇编乾坤大挪移到C的世界.作为VxWorks BSP中的第一个C函数,它的主要任务是清空内存( ...

  6. VxWorks启动过程具体解释

    上一节主要是从映像的分类和各种映像的大致载入流程上看VxWorks的启动过程,这一节让我们从函数级看一下VxWorks的启动过程: 1. Boot Image + Loadable Images: 以 ...

  7. vxworks启动详解

    1 三种不同的VxWorks映象比较 VxWorks是一种灵活的.可裁剪的嵌入式实时操作系统.用户可以根据需要创建自己的VxWorks映象,由它来引导目标系统,而后下载并运行应用程序. 根据应用场合的 ...

  8. VxWorks启动过程描述及主要宏开关含义

    1 三种不同的VxWorks映象比较 VxWorks是一种灵活的.可裁剪的嵌入式实时操作系统.用户可以根据需要创建自己的VxWorks映象,由它来引导目标系统,而后下载并运行应用程序. 根据应用场合的 ...

  9. VxWorks 启动程序的四种方法

    文章目录 1.背景介绍 1.1.Vxworks工程 1.2.Vxworks shell 2.内核应用程序(DKM)自启动 2.1.需求来源 2.2.方案1(失败) 2.3.方案2(成功) 3.用户应用 ...

最新文章

  1. AI一分钟 | 搜狗王小川:今年重点战略是输入法升级和发展机器翻译;北京无人驾驶试验场下半年正式运营
  2. websocket实现单聊
  3. 【集合之HashMap】HashMap实现原理及非线程安全原因
  4. linux线程池资料
  5. 【51Nod - 1117 】聪明的木匠 (贪心,哈夫曼树,时光倒流)
  6. RecyclerView拖拽排序和滑动删除实现
  7. 架构组件:基于Shard-Jdbc分库分表,数据库扩容方案
  8. 【算法导论33】跳跃表(Skip list)原理与java实现
  9. CassiniDev源码学习 - 可替代IIS的单机Web Form解决方案
  10. 这10款APP,让残障人士出行无忧!
  11. 日本公司为东京大学开设区块链课程捐款80万美元
  12. 生成pdf设置中文字体出错 \simsun.ttc' with 'Identity-H' is not recognized或者type of font{0} is not recognized
  13. 6步讲解应对ESD基本方法
  14. 从SO_REUSEPORT服务器的一个弊端看多队列服务模型
  15. 问卷调查网站制作-前后端开发
  16. PhotonServer-创建APPServer和Client类
  17. ubuntu 20.04 | 设置开机启动脚本
  18. wps在线预览接口_在线文档预览(干货篇)
  19. android绿豆通讯录xml,Android 数据库(SQLite)【简介、创建、使用(增删改查、事务、实战演练)、数据显示控件(ListView、Adapter、实战演练)】...
  20. 会话及会话技术、Cookie对象、Session对象 详解

热门文章

  1. 银河麒麟系统配置实用技巧-立哥总结
  2. 标志符的命名规则与规范
  3. 【4】SCI易中期刊推荐——神经科学研究(中科院4区)
  4. 美国金融工程计算机要学哪些,美国金融工程
  5. 聊聊java8中的@sun.misc.Contended与伪共享
  6. java中的全局变量和局部变量
  7. c语言抽象数据类型复数,抽象数据类型复数的实现..doc
  8. 线性回归--乐高玩具价格预测
  9. css3动画旋转不兼容ios
  10. org.apache.poi.xwpf.usermodel不存在问题