Go to Post Load the whole bot up with all 22 motors, put them all into the drive train. Oh yes. - Grim Tuesday [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 01-28-2009, 08:58 AM
7-11number1 7-11number1 is offline
ROAR.
FRC #1711 (RAPTORS)
 
Join Date: Sep 2007
Rookie Year: 2006
Location: Traverse City, Michigan
Posts: 46
7-11number1 will become famous soon enough
Exclamation cRIO Application Loader Issue

Hello from 1711 Traverse City!

We have much (I joke) of our code written to do this, that, and the other and have tripped on what looks like a memory related issue. Having Hyperterm connected to our serial console, we witness vxWorks booting just fine, starts to load our deployed FRC_UserProgram then fails with an Application Loader exception, data access error of course. We know that the data access error is a protected mode trap on illegal memory access. The situation is that our code has not been executed yet. This seems to be connected with static memory heap utilization. We can solve it by reducing the number of variables declared on the heap (actually just by removing one class variable does the trick) and we boot fine. Adding a different class variable (such as changing Joystick rightStick(2); to Sensor turret(4);) causes the problem to re-occur. Anyone else witnessed this behavior? I am looking for WindRiver Linker options or any config settings that my be able to expand my static heap (sounds personal?). Since this is memory address space not stack, I do not think this is stack related (but all ideas welcome). I wish the nastiness of this one on nobody!

Oh by the way, reverting to a simpler program works just fine and we are still at update #2 RIO v7 (we'll change that this afternoon).

Cheers! Tony.
Reply With Quote
  #2   Spotlight this post!  
Unread 01-28-2009, 09:04 AM
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,069
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: cRIO Application Loader Issue

If you are declaring your members using:

Joystick rightStick(2);

instead of:

Joystick *rightStick = new Joystick(2);

then you are declaring on the stack, NOT the heap. You have a limited stack size for your program (I'm not sure if you can increase it or not - anyone?). Try using heap variables instead and see if the problem goes away if this is how your code works (which it looks like from the snippets you posted).
Reply With Quote
  #3   Spotlight this post!  
Unread 01-28-2009, 01:37 PM
7-11number1 7-11number1 is offline
ROAR.
FRC #1711 (RAPTORS)
 
Join Date: Sep 2007
Rookie Year: 2006
Location: Traverse City, Michigan
Posts: 46
7-11number1 will become famous soon enough
Re: cRIO Application Loader Issue

Abwehr,

Thanks for the response, in this case we are declaring in the heap and did use the dereference as a tester but made no difference. I know that the code is not executing at all as this is the loader throwing the exception, not the application based on the exception report. When I get to the lab in a few hours, I'll post the exception text. Our code model is as follows:

/* declare global vars */
etc...
Joystick *joy2=new Joystick(2);
-or-
Joystick joy2(2);


(FUNCPTR) taskOperations(params) {
// do task operations
}

MyTask::MyTask() : Task("1711_TASK", (FUNCPTR)taskOperations) {}

I think some of the variables in the global space are candidates for the local task scope, but I fear there is a problem coming to light here that may bite us in due time again.

Cheers, Tony.
Reply With Quote
  #4   Spotlight this post!  
Unread 01-28-2009, 10:20 PM
7-11number1 7-11number1 is offline
ROAR.
FRC #1711 (RAPTORS)
 
Join Date: Sep 2007
Rookie Year: 2006
Location: Traverse City, Michigan
Posts: 46
7-11number1 will become famous soon enough
Smile Re: cRIO Application Loader Issue

Problem solved and was a code architecture issue. We were instantiating the Joystick class outside of our class model. This caused early allocation, prior to the driver station object being initialized and *bang* all fell down. Keeping our pointer in the heap but instantiating in our task initializer class conformed to start up sequencing and all works without issue.

Thanks for your help!

Tony,
1711 Raptors
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
cRIO configuration issue- serial connection to laptop Torbots 1197 FRC Control System 5 01-28-2009 10:28 PM
Issue with debugging/running code on cRio 114Klaatu0x72 Programming 5 01-27-2009 02:02 PM
Mobile CD application? Elgin Clock CD Forum Support 9 03-03-2008 09:37 PM
Issue with CMUCam2 Demo application Bio LabView and Data Acquisition 12 01-21-2006 04:08 PM
Application Process Nick Seidl College Teams 2 09-11-2003 05:23 PM


All times are GMT -5. The time now is 10:54 AM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi