Go to Post This isn't a science fair, sometimes it's okay to give away the answer, especially if they learned something on the way there. - Karthik [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 21-02-2011, 02:15
Larry R Larry R is offline
Registered User
FRC #1258
Team Role: Electrical
 
Join Date: Jan 2008
Rookie Year: 2005
Location: Kirkland, WA
Posts: 23
Larry R is on a distinguished road
Send a message via MSN to Larry R
cRIO says: FRC_UserProgram failed to load.

We are unable to deploy our robot code to the cRIO. There are no errors from the Windriver IDE but there are VxWorks errors displayed on cRIO bootup console.
task 0xe744b8 (t1) deleted: errno=1835009 (0x1c0001) status=1 (0x1)
Relocation value does not fit in 24 bits.
Relocation value does not fit in 24 bits.
. (There are many, many of these)
.
Relocation value does not fit in 24 bits.
...FRC_UserProgram failed to load.

Googling this error gets many hits explaining that the code is addressed too far from the VxWorks kernel. The solution: use -mlongcall. In fact, a recent post, http://www.chiefdelphi.com/forums/sh...ad.php?t=91896 , recommends that as a solution to code not deploying. I followed their directions to implement -mlongcall:

"In Workbench IDE, right click on the project in project explorer on the left. Select "Properties". In the project properties dialog, click build properties on the left and click the "Build Macros" tab on the right. Make sure your Active Build Spec is "PPC603gnu". Select the "CC_ARCH_SPEC" name and click the Edit... button. If the "-mlongcall" option is not there, append it to the end. Save it and recompile."

I followed this solution and it had no effect. Build and Deploy went normally with no errors. However, I have a robot "no code" condition plus the cRIO errors already described.

Current versions of Windriver and cRIO image:
C++ : 20110203rev2259
cRIO : FRC_2011_v27

When the updates and reimaging were completed a couple weeks ago, the sample code was built and deployed successfully. The robot was driveable. When we added the code for our arm, pneumatics, line sensors, etc, the code was no longer deployable and gives the errors described above.

We could really use some help on this problem. Bag and tag is Tue and we have a robot code only running in RAM using "Run Kernel Task". The code tested very well as a Kernel Task and we can drive and operate our robot. But, we can't compete without Deploying persistent code.

Thanks from Team 1258!
Reply With Quote
  #2   Spotlight this post!  
Unread 21-02-2011, 02:30
ozrien's Avatar
ozrien ozrien is offline
Omar Zrien
AKA: Omar
no team
Team Role: Mentor
 
Join Date: Sep 2006
Rookie Year: 2003
Location: Sterling Heights, MI
Posts: 515
ozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant future
Re: cRIO says: FRC_UserProgram failed to load.

After creating a new Wind River project (Simple Robot Template) I see that mlongcall is already appended to the build parameters. If all else fails you could try creating a new Wind River project and just copy the cpp/h files from one directory into the newly created project in your workspace. Then right click, refresh in the project treeview in Wind River Workbench and all of the cpp files should build from then on. You will have to copy the code from the main robot class but at least you'll have the latest project settings.

Also you should update to image 28...
http://www.usfirst.org/uploadedFiles..._Update_12.pdf
Reply With Quote
  #3   Spotlight this post!  
Unread 23-02-2011, 20:49
Larry R Larry R is offline
Registered User
FRC #1258
Team Role: Electrical
 
Join Date: Jan 2008
Rookie Year: 2005
Location: Kirkland, WA
Posts: 23
Larry R is on a distinguished road
Send a message via MSN to Larry R
Re: cRIO says: FRC_UserProgram failed to load.

Thanks for the suggestion. Sadly that didnt' work. Also, we had a crash (Error 60) when attempting to reimage the cRIO to v28. We did a reformat in Safe Mode then re-IP'd it then reimaged. The cRIO now boots up ok.

However, we still have the problem with deployed code:

"Relocation value does not fit in 24 bits.
...FRC_UserProgram failed to load.." error on the cRIO console output.

We are unable to deploy any code. We removed the cRIO before bagging in hopes that we can solve this problem.

The current plan is to set up the cRIO, router, a PD, digital sidecar and the Driver Station and try another laptop with Windriver on it. We can start with the default code and see if the problem remains. If no problems, we'll add our code bit by bit to determine which line of code causes the problem.

Our code, by the way, works great as a kernel task so it drives, runs the pneumatics, follows the line, etc. It builds without errors. But when deployed, it won't run.

Any help solving this would be greatly appreciated.
Reply With Quote
  #4   Spotlight this post!  
Unread 23-02-2011, 21:57
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: cRIO says: FRC_UserProgram failed to load.

Quote:
Originally Posted by Larry R View Post
"Relocation value does not fit in 24 bits.
...FRC_UserProgram failed to load.." error on the cRIO console output.
That looks like the missing mlongcall problem.
Reply With Quote
  #5   Spotlight this post!  
Unread 24-02-2011, 13:24
Larry R Larry R is offline
Registered User
FRC #1258
Team Role: Electrical
 
Join Date: Jan 2008
Rookie Year: 2005
Location: Kirkland, WA
Posts: 23
Larry R is on a distinguished road
Send a message via MSN to Larry R
Re: cRIO says: FRC_UserProgram failed to load.

It WAS missing. But we added the -mlongcall flag using the instructions given in another post and still have the problem.

We did this....
"In Workbench IDE, right click on the project in project explorer on the left. Select "Properties". In the project properties dialog, click build properties on the left and click the "Build Macros" tab on the right. Make sure your Active Build Spec is "PPC603gnu". Select the "CC_ARCH_SPEC" name and click the Edit... button. If the "-mlongcall" option is not there, append it to the end. Save it and recompile."

....then CTRL-B to build and then Deploy. Same result. "No Robot Code" on the Driver Station display and the same error on the cRIO. We also deleted the make file and did a build to create a new one thinking maybe the make file wasn't updated. Still have the problem. When we go back to check the flags under CC_ARCH_SPEC, -mlongcall is there.
Reply With Quote
  #6   Spotlight this post!  
Unread 24-02-2011, 14:24
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: cRIO says: FRC_UserProgram failed to load.

Quote:
Originally Posted by Larry R View Post
...then CTRL-B to build...
Doesnt Ctrl-B just recompile files that have had their source code changed since the last compile? You might have to force all your code to be recompiled in order for the new option to actually fix the problem the linker is encountering. I don't know offhand what the "complete rebuild" is called.
Reply With Quote
  #7   Spotlight this post!  
Unread 24-02-2011, 15:06
mikets's Avatar
mikets mikets is offline
Software Engineer
FRC #0492 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Bellevue, WA
Posts: 666
mikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of light
Re: cRIO says: FRC_UserProgram failed to load.

Try clean build in the build option menu. Wind River does incremental build, so if nothing has changed, it may not do a full build. Also, check the console spew again to make sure you did not just hit a different issue.
__________________
Reply With Quote
  #8   Spotlight this post!  
Unread 24-02-2011, 18:42
Larry R Larry R is offline
Registered User
FRC #1258
Team Role: Electrical
 
Join Date: Jan 2008
Rookie Year: 2005
Location: Kirkland, WA
Posts: 23
Larry R is on a distinguished road
Send a message via MSN to Larry R
Re: cRIO says: FRC_UserProgram failed to load.

The console spew is identical. However, sounds like a good plan to do a clean build. We are planning to do just that next week. Also we're using a different laptop, freshly updated Windriver, and a new project.

I agree that CTRL-B might not look for changes like adding the -mlongcall flag to the build parameters. Starting clean holds lots of promise. We removed the cRIO and radio from the robot before the bag/tag. I'm setting up enough to do all the tests next Monday.

I will post our results next week.

Thank all of you for the great suggestions.
Reply With Quote
  #9   Spotlight this post!  
Unread 25-02-2011, 09:53
taichichuan's Avatar
taichichuan taichichuan is offline
Software Mentor
AKA: Mike Anderson
FRC #0116 (Epsilon Delta)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Herndon, VA
Posts: 328
taichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud of
Send a message via AIM to taichichuan
Re: cRIO says: FRC_UserProgram failed to load.

We, too had problems with deploying code to the robot. Our issues were twofold and, I believe, related to running Workbench on a 64-bit platform.

First, the code deployment problem. For us, with two different laptops (both 64-bit), the "Deploy" option would appear to work from the laptop's perspective but would result in an incomplete copy. We would get all types of error messages about the CAN-based Jaguars failing to initialize. When we started looking into it, it seems as though the FTP mechanism in Workbench is FUBAR from a 64-bit platform. If I went to Filezilla and did the transfer to ni-rt/system/FRC_UserProgram.out by hand, then everything worked like a charm.

Next, when we switched from our test code to the *real* code, then we got the 24-bit relocation problem. Being a long-time VxWorks developer, I'm quite familiar with this particular issue on the PPC processor family. The code works if downloaded from workbench, but not if deployed. This stems from a "feature" of the PPC's "bl" assembly instruction not being able to branch beyond 16 MBs. This is the default branch instruction for the PPC compilers and works well if your code gets loaded into the Wind Debug Pool region (which is what the 'Run Kernel Task" command does) but not if loaded at the top of memory (which is what the best-fit memory manager will do on initial boot up). Hence the need for the -mlongcall flag.

-mlongcall replaces the "bl" instruction with two separate instructions. One to load the 32-bit branch into a PPC special-purpose register followed by an indirect branch using the address in the just-loaded special-purpose register. This means that -mlongcall code should always be just a bit larger in size than the normal compile. This is an important visual cue that you've compiled it correctly.

So, where do you put -mlongcall? Right-click on the project and select "Properties". Next select "Build Properties" -> "Build Macros" and edit the "CC_ARCH_SPEC" entry. Add -mlongcall to the end of the line, press return, and then click "Apply" followed by "OK". Next, go back out to your project and right-click, "Build Options" -> "Clean Project". Right-click again and select "Rebuild Project" and you should be good to deploy. You probably don't have to do the "Clean Project" because the "Rebuild Project" should do the job. But, I'm superstitious .

BTW, I tried adding -mlongcall to the "Tool Flags" entry of the "Build Tools" tab in the build properties. It took it, but apparently WRS doesn't actually allow you to modify that field (they simply show you what you've selected from "Tool Flags" dialog). The visual check of the different size told us that the option wasn't working. Moving it to the CC_ARCH_SPEC solved the problem.

Next, use Filezilla or some other FTP client and log into your cRIO with a user ID of "FRC" and password of "FRC". CD to /ni-rt/system and copy your .out to FRC_UserProgram.out, exit the FTP client and reboot the cRIO. You should be good to go.


HTH,

Mike
Reply With Quote
  #10   Spotlight this post!  
Unread 27-02-2011, 20:13
Larry R Larry R is offline
Registered User
FRC #1258
Team Role: Electrical
 
Join Date: Jan 2008
Rookie Year: 2005
Location: Kirkland, WA
Posts: 23
Larry R is on a distinguished road
Send a message via MSN to Larry R
Re: cRIO says: FRC_UserProgram failed to load.

Thank you Mike, for the great explanation on the reasons for that error. Tomorrow (Mon) I plan to assemble the cRIO and other components to get it running so I can try this. It may take a couple days to get it going but that's the first thing I will try. I did add the -mlongcall flag as you indicated but I simply did a build which I can see now is insufficient.

On that last part that uses FTP: I have Filezilla and have been using it in my work. However I haven't used it in place of Deploy. So when you say to copy the .out, do you mean the .out from Windriver and copy it to the cRIO with a change in file name (FRC_UserProgram.out)? Is that what FIRST --> Deploy does? If so, thats cool but I will have to navigate the the correct .out file in Windriver. It should be in a path with the Project name in it.

Thanks again!
Reply With Quote
  #11   Spotlight this post!  
Unread 27-02-2011, 20:56
taichichuan's Avatar
taichichuan taichichuan is offline
Software Mentor
AKA: Mike Anderson
FRC #0116 (Epsilon Delta)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Herndon, VA
Posts: 328
taichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud of
Send a message via AIM to taichichuan
Re: cRIO says: FRC_UserProgram failed to load.

Quote:
Originally Posted by Larry R View Post
Thank you Mike, for the great explanation on the reasons for that error. Tomorrow (Mon) I plan to assemble the cRIO and other components to get it running so I can try this. It may take a couple days to get it going but that's the first thing I will try. I did add the -mlongcall flag as you indicated but I simply did a build which I can see now is insufficient.

On that last part that uses FTP: I have Filezilla and have been using it in my work. However I haven't used it in place of Deploy. So when you say to copy the .out, do you mean the .out from Windriver and copy it to the cRIO with a change in file name (FRC_UserProgram.out)? Is that what FIRST --> Deploy does? If so, thats cool but I will have to navigate the the correct .out file in Windriver. It should be in a path with the Project name in it.

Thanks again!
Good luck with the cRIO build. Yes, that is exactly what the "Deploy" command in Workbench does. However, on 64-bit Wndows 7, it doesn't appear to work quite correctly. Hence, my use of Filezilla and the name change. The path would be:

/ni-rt/system/FRC_UserProgram.out.

HTH,

Mike
Reply With Quote
  #12   Spotlight this post!  
Unread 28-02-2011, 19:18
masoug's Avatar
masoug masoug is offline
Food Consumer
FRC #0114
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Planet Earth
Posts: 78
masoug is an unknown quantity at this point
Re: cRIO says: FRC_UserProgram failed to load.

Um, try compiling and deploying the examples, e.g. SimpleTemplate and see if it works. It it does, then you need to check your code.

Are you using a camera?
__________________

JabbaScript
Reply With Quote
  #13   Spotlight this post!  
Unread 03-03-2011, 21:20
Larry R Larry R is offline
Registered User
FRC #1258
Team Role: Electrical
 
Join Date: Jan 2008
Rookie Year: 2005
Location: Kirkland, WA
Posts: 23
Larry R is on a distinguished road
Send a message via MSN to Larry R
Re: cRIO says: FRC_UserProgram failed to load.

Yes, we are using a camera but we haven't added the code for that. Our original code ran the robot very well as a kernel task.

We tried to compile and deploy SimpleTemplate, made sure -mlongcall was there but had a new error message: I/O Error popup even though in the left pane of Windriver says we can make a successful connection to the cRIO.

At first, I was connected via the router and got the error. Next, I used a crossover cable from the Windriver laptop directly to Port 1 on the cRIO and got the same I/O popup error when deploying.

I've never seen so many problems trying to deploy code on a robot!

I set up the cRIO, a PD, Digital Sidecar, D-Link and a couple spikes on a sheet of polycarb to make a sort of dev platform. This weekend we will try all this with a different laptop.

I have an additional question: If I want to use FTP instead of deploy what is the path of the compiled .out file and is it called simply .out? I'm asking this because I can FTP to and from the cRIO with no problem....thanks to Mike's suggestions.
Reply With Quote
  #14   Spotlight this post!  
Unread 03-03-2011, 23:29
taichichuan's Avatar
taichichuan taichichuan is offline
Software Mentor
AKA: Mike Anderson
FRC #0116 (Epsilon Delta)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Herndon, VA
Posts: 328
taichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud of
Send a message via AIM to taichichuan
Re: cRIO says: FRC_UserProgram failed to load.

Quote:
Originally Posted by Larry R View Post
Yes, we are using a camera but we haven't added the code for that. Our original code ran the robot very well as a kernel task.

We tried to compile and deploy SimpleTemplate, made sure -mlongcall was there but had a new error message: I/O Error popup even though in the left pane of Windriver says we can make a successful connection to the cRIO.

At first, I was connected via the router and got the error. Next, I used a crossover cable from the Windriver laptop directly to Port 1 on the cRIO and got the same I/O popup error when deploying.

I've never seen so many problems trying to deploy code on a robot!

I set up the cRIO, a PD, Digital Sidecar, D-Link and a couple spikes on a sheet of polycarb to make a sort of dev platform. This weekend we will try all this with a different laptop.

I have an additional question: If I want to use FTP instead of deploy what is the path of the compiled .out file and is it called simply .out? I'm asking this because I can FTP to and from the cRIO with no problem....thanks to Mike's suggestions.
The path is /ni-rt/system/FRC_UserProgram.out.

HTH,

Mike
Reply With Quote
  #15   Spotlight this post!  
Unread 04-03-2011, 00:16
masoug's Avatar
masoug masoug is offline
Food Consumer
FRC #0114
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Planet Earth
Posts: 78
masoug is an unknown quantity at this point
Re: cRIO says: FRC_UserProgram failed to load.

Quote:
Originally Posted by Larry R View Post
We tried to compile and deploy SimpleTemplate, made sure -mlongcall was there but had a new error message: I/O Error popup even though in the left pane of Windriver says we can make a successful connection to the cRIO.

At first, I was connected via the router and got the error. Next, I used a crossover cable from the Windriver laptop directly to Port 1 on the cRIO and got the same I/O popup error when deploying.

I've never seen so many problems trying to deploy code on a robot!

I set up the cRIO, a PD, Digital Sidecar, D-Link and a couple spikes on a sheet of polycarb to make a sort of dev platform. This weekend we will try all this with a different laptop.
Can you post the output from the error messages?
__________________

JabbaScript
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


All times are GMT -5. The time now is 08:44.

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