热门关键词: 塑料生产设备 易拉罐灌装设备 节能环保设备 杭州博世电动工具 塑钢设备 塑钢门窗焊接设备 网络测试设备
  IC库存(8958万) PDF资料(329万) IC价格 IC求购 资讯 技术资料
电子元器件搜索:
维库电子市场网是知名的电子元器件交易网站,为电子生产企业提供IC库存和技术资料查询服务。
相关专题
VxWorks中文FAQ (9)
新闻出处: 发布时间:2007-11-01

6.15 I/O 操作
6.15.1 查看serial device的状态,又是异常!
文件如下,注释有它的说明,编译后,在shell输入:
-> pDevHdr = iosDevFind ("/tyCo/0",0)
Exception number 0: Task: 0x4bbc8e8 (t1)

General Protection Fault
Program Counter: 0x0041eba5
Status Register: 0x00010202

还是想得到各位兄台的指点,谢谢!
......
void tyShow
(
TY_DEV * pTyDev
)
{
/* read - ring buffer and semaphores */
printf ("Address of pTyDev->rdBuf = 0x0x.\n", &pTyDev->rdBuf);
printf ("Address of pTyDev->rdSyncSem = 0x0x.\n", &pTyDev->rdSyncSem);
printf ("Address of pTyDev->mutexSem = 0x0x.\n\n", &pTyDev->mutexSem);

/* rdState */
printf ("pTyDev->rdState.xoff = 0x0x.\n", pTyDev->rdState.xoff);
printf ("pTyDev->rdState.pending = 0x0x.\n", pTyDev->rdState.pending);
printf ("pTyDev->rdState.canceled = 0x0x.\n", pTyDev->rdState.canceled);
printf ("pTyDev->rdState.canceled = 0x0x.\n", pTyDev->rdState.canceled);

/* write - ring buffer and semaphores */
printf ("Address of pTyDev->wrtBuf = 0x0x.\n", &pTyDev->wrtBuf);
printf ("Address of pTyDev->wrtSyncSem = 0x0x.\n\n", &pTyDev->wrtSyncSem);

.....

A:
->buf=malloc(100)
->pDevHdr=iosDevFind("/tyCo/0", buf)
(by vxfree)


7.其它 FAQ
7.1
7.1.1 各位大侠: 我的程序写好了,系统如何启动我的应用程序。tornado 2 帮助里有这一段:
Linking the application with VxWorks is really a two-step process. You must add an entry point to the application in usrConfig.c, and you must modify the makefile to link the application statically with VxWorks.

To start your application during system initialization, add code to the usrRoot( ) routine in usrConfig.c. You can call application initialization routines, create additional I/O devices, spawn application tasks, and so on, just as you do from the Tornado shell during development. An example is provided in usrConfig.c. This file includes and initializes a simple demo if the preprocessor constant INCLUDE_DEMO is defined in one of the configuration files. In that situation, usrRoot( ) spawns usrDemo( ) as a task as the last step in booting the system. You can simply insert the appropriate initialization of your application after the conditional code to start the demo. For example:

/* spawn demo if selected */
#if defined(INCLUDE_DEMO)
taskSpawn ("demo", 20, 0, 2000, (FUNCPTR)usrDemo, 0,0,0,0,0,0,0,0,0,0);
#endif
taskSpawn ("myMod", 100, 0, 20000, (FUNCPTR)myModEntryPt,
0,0,0,0,0,0,0,0,0,0);
To include your application modules in the bootable system image, add the names of the application object modules (with the .o suffix) to MACH_EXTRA in Makefile. For example, to link the module myMod.o, add a line like the following:

MACH_EXTRA = myMod.o
...
Building the system image with the application linked in is the final part of this step. In the target directory, execute the following command:

make vxWorks

按上面的步骤,我用tornado 2的rebuild All命令生成vxWorks,考到硬盘里通过bootrom.sys启动vxWorks;vxWorks启动了,可我的应用没有。各位大侠,如何启动应用程序呢? 请指点。
小弟非常感谢!

Re:哪位大侠做过把应用绑定到vxWorks系统去
1).在启动系统时启动用户定制的任务
假设有一个MultiTask.c的程序,该程序使用消息队列来传递不同task之间的消息,其中:主task为Init,负责建立两个从task,监控和传递推出消息,并释放从进程需要的资源。
将此文件加入到制作vxworks的工程中(注意这里的MultiTask.c同样不能放在带空格的路径下),修改usrAppInit.c,在开头加入:
extern void Init(void);
在函数结束前加入:
Init();
重新编译生成vxworks,重启目标机,可以看到任务自动执行。

2).关于usrconfig.c
有些帮助文件中提到可以修改c:\tornado\target\config\all\usrconfig.c中的usrRoot函数来改变启动画面和启动用户任务。但在vxworks的faq中提到:"Tornado2.0不使用usrconfig.c,而是用target\config\comps下的 configulettes,如果需要使用usrconfig,必须"make" c:\tornado\target\config\pentiumpro下的makefile文件。事实上,在帮助文件里大量地提到了修改usrconfig,例如在不通过网络而是从rom启动vxworks,使用flash ram等。
实际上就tornado2.0来说,分为两种情况:
<1>用户自己建立的bootable image
这时不使用usrconfig,用户通过对工程可视化的修改,就可以裁减内核。如果在project里面去掉了默认的dependence,可以看到target\config\comps下的一些*.c,*.h文件其实是被引用的。通过对它们的修改,可以起到类似于修改usrconfig.c的作用,编译时使用的是系统自动在工程所在目录下产生的makefile,对这个makefile的修改将不会产生作用。

关闭】【打印
友情链接:
© 2007 电子设备网 网站地图