I have problem launching the Rtp application helloworld.vxe.
My helloworld application has the following code.
#include <stdio.h>
#include <stdlib.h>
#include <vxworks.h>
#include <taskLib.h>
#include <sys/stat.h>
#include <lstLib.h>
/
*******************************************************************************
* main - User application entry function
*
* This routine is the entry point for user application. A real time
process
* is created with first task starting at this entry point.
* This function writes 'Hello World' on the console and exits.
*
*/
int main
(
int argc, /* number of arguments */
char * argv[], /* array of arguments */
char * envp[], /* array of environment strings */
void * auxp /* implementation specific auxiliary vector */
)
{
printf ("Hello World\r\n");
return 0;
}
when i try to run the helloworld.vxe file from the vxworks prompt, i
get the following error message.
-> rtpSp "/romfs/helloworld.vxe",60,0x10000,0,0
value = -1572356448 = 0xa247bea0
[b]-> 0xa0934010 (iHelloworld): RTP 0xa247bea0 has been deleted due to
signal 4.[/b]
and if i dont run the above command and if i enter the following
commands, it seems that helloworld has launched but i am not able to
get print.
-> cmd
[vxWorks *]# rtp exec -c /romfs/helloworld.vxe 2 &
when i give the above command, i get the following message.
Launching process '/romfs/helloworld.vxe' ...
Process '/romfs/helloworld.vxe' (process Id = 0xa0923388) launched.
Attachment number for process '/romfs/helloworld.vxe' is %1.
[vxWorks *]#
Branch through zero
Current Processor Status Register: 0x60000053
Task: 0xa0924454 "iHelloworld"
0xa0924454 (iHelloworld): task 0xa0924454 has had a failure and has
been stopped
.
0xa0924454 (iHelloworld): fatal exception in a kernel task or stack
overflow !
and also i am able to go inside helloworld application by following
command.
[vxWorks *]# %1
[helloworld]# This will be displayed.
I am able to set the break points too as shown below.
[helloworld]# bp &main
[helloworld]# bp
# Breakpoint Address Ctx Ctx Id Cnt Stops N
Hard
--- ----------------------------- ----- ---------- --- ------- -
------------
0 0x00100328: main RTP 0xa0923388 0 task y
when i disassemble the helloworld.vxe application, i get the following
instruction.
[helloworld]# l 0x00100328
main:
00100328 e52de004 STR r14,[r13,#-4]!
0010032c e59f0008 LDR r0,0x0010033c
00100330 eb0007ae BL printf
00100334 e3a00000 MOV r0,#0
00100338 e49df004 LDR pc,[r13],#4
0010033c 0010dfc8 ANDEQS r13,r0,r8,ASR #31
memAddToPool:
00100340 e1a02001 MOV r2,r1
00100344 e1a01000 MOV r1,r0
00100348 e59f03b8 LDR r0,0x00100708
0010034c e5100000 LDR r0,[r0,#-0]
but its not displaying the prints..
and also if i enter "shl" command here, its not displaying any shared
library...
[helloworld]# shl
SHL NAME ID TEXT ADDR TEXT SIZE DATA SIZE REF
CNT
-------------------- ---------- ---------- ---------- ----------
-------
[helloworld]#
Should i include any shared library???
i have included the following macros in the config.h....
#define INCLUDE_RTP
#define INCLUDE_RTP_APPL_USR
#define INCLUDE_RTP_APPL_INIT_STRING
#define INCLUDE_RTP_APPL_INIT_BOOTLINE
#define INCLUDE_RTP_APPL_INIT_CMD_SHELL_SCRIPT
#define INCLUDE_SHARED_DATA
#define INCLUDE_SHL
#define INCLUDE_RTP_HOOKS
#undef INCLUDE_VX_TRADITIONAL_SCHEDULER
#define INCLUDE_POSIX_PTHREAD_SCHEDULER
#define INCLUDE_POSIX_CLOCK
#define INCLUDE_SHELL
#define INCLUDE_DISK_UTIL
#define INCLUDE_RTP_SHOW
#define BUNDLE_RTP_DEVELOP
#define BUNDLE_RTP_POSIX_PSE52
#define BUNDLE
#define INCLUDE_SC_POSIX
#define INCLUDE_SHOW_ROUTINES
#define INCLUDE_PROTECT_TASK_STACK
#define INCLUDE_EDR_PM /* ED&R persistent memory */
#define INCLUDE_EDR_ERRLOG /* ED&R error log */
#define INCLUDE_EDR_SHOW /* ED&R show routines */
#define INCLUDE_EDR_SYSDBG_FLAG /* ED&R debug flag */
#define INCLUDE_RTP_SHOW_SHELL_CMD
#define INCLUDE_ADR_SPACE_SHOW
#define INCLUDE_ADR_SPACE_SHELL_CMD
#define INCLUDE_VM_SHOW
#define INCLUDE_VM_SHOW_SHELL_CMD
#define INCLUDE_LOCK_TEXT_SECTION
Do i have to include any additional macros to support RTP??
Please help me out to solve this issue as soon as possible.
Thanks in Advance,
cader
Miscellaneous comments:
- given your example you really do not need to include vxWorks.h
(note the upper-case W), taskLib.h, sys/stat.h and lstLib.h.
- the list of components and bundles you provided shows
BUNDLE_RTP_POSIX_PSE52. Again, given your example all you really need
is BUNDLE_RTP_DEVELOP,
BUNDLE_NET_SHELL or BUNDLE_STANDALONE_SHELL, and BUNDLE_EDR if you
want to get early failures logged somewhere.
- unless you built your RTP executable as a dynamic executable (i.e.
using shared libraries) you do not need the INCLUDE_SHL component.
Hope this helps,
--
PAD
Hi,
PAD
Thank you very much for your prompt reply.
We are using freescale based ARM5 processor(iMx27).
We are using vxworks6.6 and Wind River Workbench 3.0 .
After creating a new real time project, i am setting build spec as
ARMARCH5diab_RTP
and compiling it .
Bsp and image is created with tool chain as diab(in integrator926ejs)
ARMARCH5diab.
How to disable the hardware floating point support in Build spec.
The macro INCLUDE_VFP for floating point is already disabled in my
bsp.
Anything else i have to do to disable the hardware floating point
support in Build spec??
We have added the following bundles from the project explorer(Kernel
Configuration->Bundles)
1. Real Time Process Development
2. POSIX functionality
3. POSIX PSE52 functionality for RTPs
4. Error Detection and Reporting
5. standalone kernel shell
I have also added the bundles as given below in config.h but its
giving same exception.
BUNDLE_RTP_DEVELOP
BUNDLE_STANDALONE_SHELL
BUNDLE_EDR
when i spawn a task helloworld.vxe, i get the following exeception.
-> rtpSp "/romfs/bin/helloworld.vxe"
value = -1561385852 = 0xa2ef2484
->
Branch through zero
Current Processor Status Register: 0x60000053
Task: 0xa2ef2118 "iHelloworld"
0xa2ef2118 (iHelloworld): task 0xa2ef2118 has had a failure and has
been stopped
.
0xa2ef2118 (iHelloworld): fatal exception in a kernel task or stack
overflow !
After this if i spawn the same helloworld.vxe file or some other .vxe
file, i get the following error.
-> rtpSp "/romfs/bin/helloworld.vxe"
value = -1601790056 = 0xa0869f98
-> 0xa0872940 (iHelloworld): RTP 0xa0869f98 has been deleted due to
signal 4.
My RTP code is as shown below .As per your suggestion, i removed
the .h files that u have mentioned.
int main
(
int argc, /* number of arguments */
char * argv[], /* array of arguments */
char * envp[], /* array of environment strings */
void * auxp /* implementation specific auxiliary vector
*/
)
{
printf ("Hello World\r\n");
return 0;
}
I removed the printf also from the above code but still branch through
zero exception is coming.
After building the image, we are converting the vxworks (elf) file
into vxworks.bin file and
then we are directly downloading in the target board via serial port
and running.
We are not connecting Workbench directly to the target board.
Waiting for your prompt reply
Thanks,
Cader.
I am not particularly knowledgeable with the ARM architecture but I
think VxWorks only supports ARM processors with software floating
point. This is what you get with the build specs you indicated. The
component INCLUDE_VFP is for vector floating point support and seems
to be specific the ARM1136JF only, which does not appear to be used
for the integrator926ejs BSP, so I suppose removing it is harmless
although it should be ignored anyway. I suppose you double-checked
that you did not use, by mistake, build specs specifying little endian
on one side and big endian on the other.
Since you added the ED&R bundle you could try the 'edrShow' shell
routine to get some more information regarding where the RTP failed.
Given that your code does essentially nothing it has to be in the
initialization sequence of the RTP and it can be useful to know where
the issue occurs.
I cannot think of anything else from the top of my head.
I am working with cader on RTP applications.
Thank you very much for your useful suggestions.
when i entered edrShow command on the vxworks prompt, i found the
following error message.
-> eeddrrSShhooww
ERROR LOG
=========
Log Size: 12288 bytes (3 pages)
Record Size: 4096 bytes
Max Records: 2
CPU Type: 0x461
Errors Missed: 0 (old) + 1 (recent)
Error count: 2
Boot count: 1
Generation count: 1
==[2/2]==============================================================
Severity/Facility: FATAL/KERNEL
Boot Cycle: 1
OS Version: 6.6.0
Time: THU JAN 01 00:01:07 1970 (ticks = 4032)
Task: "iRtp_rtp" (0xa080bb90)
RTP: "/romfs/bin/rtp_rtp.vxe" (0xa079499c)
RTP Address Space: 0x00100000 -> 0x001097e0
Injection Point: excArchLib.c:687
fatal exception in a kernel task or stack overflow !
<<<<<Memory Map>>>>>
0xa0008000 -> 0xa0323600: kernel
0x00100000 -> 0x001097e0: RTP
<<<<<Exception Information>>>>>
Branch through zero
Current Processor Status Register: 0x60000013
<<<<<Registers>>>>>
r0 = 0x00000000 r1 = 0x00000000 r2 =
0x00000000
r3 = 0x00000000 r4 = 0x00000000 r5 =
0xfffffffc
r6 = 0xa3f50000 r7 = 0xfffffffc r8 =
0x00000001
r9 = 0x00000000 r10 = 0x00000000 r11/fp =
0xa08118b8
r12/ip = 0x00000004 r13/sp = 0xa081187c r14/lr =
0xa006ff18
pc = 0x00000000 cpsr = 0x60000013 ttbase =
0xa080c000
<<<<<Traceback>>>>>
value = 0 = 0x0
->
I cant understand where the problem occurs seeing the above log.
Should we do anything to reserve memory for RTP???
Please tell me what mistake i have made by seeing the above log...
Waiting for your prompt reply.
Thanks,
Supreet.
Thank you very much for your help and useful suggestions.
We solved the RTP issue that we had while launching the
RTP application.We had commented exception function
initialisation part.So it was not switching to user mode.
We were downloading the vxworks image in the target
board and then we used to boot(Not connecting Target
server workbench to target board).
Now we are trying to connect the Target server workbench
to target board through LAN for debugging.
For this we are first downloading the vxworks image on
the board and then we are making LAN/FEC up(Assigning
some unused ipaddress to the board).After this,we are
configuring the target connection in workbench as
Backend is wdbrpc,processor is ARMARCH5,Target name/IP
address is the ipaddress assigned to the target board
and for Kernel image, we are mentioning the image path.
After doing this if we press run/connect button, we get
the following POP-UP message.
"Error connecting to 'VxWorks6x_192.168.2.249'(Registry localhost)
Failed to launch target server
Possibly caused by Back-end not connected.
Removed dead entry from registry. "
I have read in documents that WDB target Agent must
be running on the target board which will reply to
the target server workbench and establish the connection.
But i am not sure whether the target Agent is running
on the target board. I have included the #define INCLUDE_WDB
macro in the config.h file.
Should i do anything else to make Targent agent run
on target board?
The way i am trying to connect the target server
workbench to target board is correct???
Please tell me what mistake i am making as soon as possible.
I am glad that you solved your RTP launch problem.
Regarding your target connection problem from Workbench you can check
whether the WDV task (tWdbTask) is up and running in your system.
Unless it is executing (READY state) it should be in the PEND state
and wait for a semaphore to be available. You can check this using the
following C interpreter command:
ti tWdbTask
w tWdbTask
semShow <semaphore ID as displayed by the 'w' command>
I would put a word of advise here: you may configure your VxWorks
image by defining or undefining macros in the BSP's config.h. However
more and more of features are difficult to configure this way because
the require in-depth knowledge of all the dependencies between
components, default values for parameters, etc. For instance here is
what I have in a VxWorks image of mine regarding WDB:
INCLUDE_WDB
INCLUDE_WDB_BANNER
INCLUDE_WDB_BP
INCLUDE_WDB_BP_SYNC
INCLUDE_WDB_COMM_END
INCLUDE_WDB_CTXT
INCLUDE_WDB_DIRECT_CALL
INCLUDE_WDB_EVENTPOINTS
INCLUDE_WDB_EVENTS
INCLUDE_WDB_EXC_NOTIFY
INCLUDE_WDB_EXIT_NOTIFY
INCLUDE_WDB_FUNC_CALL
INCLUDE_WDB_GOPHER
INCLUDE_WDB_MDL_SYM_SYNC
INCLUDE_WDB_MEM
INCLUDE_WDB_POST_KERNEL_INIT
INCLUDE_WDB_REG
INCLUDE_WDB_RTP
INCLUDE_WDB_RTP_BP
INCLUDE_WDB_RTP_CONTROL
INCLUDE_WDB_START_NOTIFY
INCLUDE_WDB_SYS
INCLUDE_WDB_SYS_REG
INCLUDE_WDB_TASK
INCLUDE_WDB_TASK_BP
INCLUDE_WDB_TASK_HOOKS
INCLUDE_WDB_TASK_REG
INCLUDE_WDB_TSFS
INCLUDE_WDB_USER_EVENT
INCLUDE_WDB_VIO
INCLUDE_WDB_VIO_LIB
As you can see configuring WDB in goes way beyond simply including
INCLUDE_WDB even though not all the components above may be required
in your case. Therefore I would advise you to use the project facility
('vxprj' command for the command line interface, or the "kernel
editor" wizard from Workbench. This would make sure that all the
necessary pieces are included in your VxWorks image.
Thanks for your support.
We are still having problem connecting target host workbench3.0
to target board.I have included all the macros mentioned by you
in the earlier post.
WDV task (tWdbTask) is up and is in pending state when i boot
the target board.
So i think now target agent is running on the target board but
when i give connect from worbench, i am getting the the
following pop-up message after trying to connect for some time.
"Error connecting to 'VxWorks6x_192.168.2.249'(Registry localhost)
Failed to launch target server
Possibly caused by Back-end not connected.
Removed dead entry from registry. "
The connection settings that i am doing in target host
workbench are
1. Backend is selected as wdbrpc.
2. Processor is selected as ARMARCH5.
3. Target name/IP address selected is the ipaddress assigned
to the target board(192.168.2.80).
4. Port is selected as both 0000 and 8000 but both are not
working.
I am able to get reply from both the sides. i.e if i ping
from target board to pc having workbench, i am getting
reply and vice-versa also gives reply.
Anything else i have to configure in target host workbench???
Workbench keeps error logs that may hold more information about the
connection failure: in the Help menu select the "Collect Log Files"
entry. However I don't know whether those logs are in human readable
format once uncompressed.
Alternatively, since you already checked that the target answers to
ping, you may want to try using the command line interface to the
target server. Start it with the verbose option (-V) and the IP
address of your board (the default backend is wdbrpc so you don't have
to specify it): tgtsvr.exe -V 192.168.2.80
With a bit of luck you'll get more information regarding the
connection problem this way. If this is not enough to establish a
diagnostic add the -Bd <log file> option: you'll get a log of the
communication between target server's backend and target agent on your
target. The target server's -h option will display all the supported
options. The -Bt and -Br options might be useful if the issue is
caused by some heavy traffic load on your network.
I hope you can work this through because I am running out of ideas :)
Cheers,
--
PAD