Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   Cannot get Code to Download to cRIO (http://www.chiefdelphi.com/forums/showthread.php?t=74255)

greekgod8591 17-02-2009 11:29

Re: Cannot get Code to Download to cRIO
 
Hey guys,
I think we've made some progress. We have no gotten the code to download to the cRIO or at least we're under the impression that this is happening. Unfortunately we cannot get the code to execute/get anything useful to happen. Here's a list of what we did:
Problem 1: Stupidly connected the router to the internet
Solution: Disconnect from internet
Problem 2: Your IPs are not set correctly
Solution: In the control system documentation there is a nice little diagram with all the IPs. We just double checked everything and pinged to ensure they were there.
Problem 3: Project did not build correctly
Solution: Try going into WR and selecting Project->clean and rebuild everything
Problem 4: Incorrect download file
Solution: Window->Preferences and check team number and .out file
Problem 5: Do not have proper remote server set
Solution: Look in the FRC documentation, and reset your server settings, then try and connect to the robot.

So we did all of that and we now get the DS to show a voltage which I'm assuming means that we at least have the code file onto the cRIO. Unfortunately it doesn't do anything. We can also see it is there through looking at the remote server thing. We tried to run in debug mode and nothing happened, when we set debug points it throws crazy errors. We've basically hit a wall, we don't know what else to try.

JamesBrown 17-02-2009 12:53

Re: Cannot get Code to Download to cRIO
 
Try loading the code via FTP with a program like FileZilla. I had similar problems to your's and managed to resolve them this way.

As a note if you choose this solution then make sure you rename your .out file FRC_UserProgram.out . The loader changes the name itself prior to loading so if you load manually you will need to rename the file manually, you can change the name of the file created in the WindRiver build options if you don't want to rename it every time.

gm342 17-02-2009 17:46

Re: Cannot get Code to Download to cRIO
 
I connected to the cRIO with a Serial cable. Our error message is no more revealing than the Windriver Eclipse Run Last Debug except for one important bit:

Code:

task 0xc1fc38 (t1) deleted: errno=1835009 (0x1c0001) status=1 (0x1)
Warning: module 0xc9ed18 (FRC_UserProgram.out) holds reference to undefined symb
ol _ZN8SolenoidC1Eii.
Warning: module 0xc9ed18 (FRC_UserProgram.out) holds reference to undefined symb
ol _ZN8SolenoidC1Ei.
(unloading partially loaded module FRC_UserProgram.out)

I used the nmppc tool (located in C:\WindRiver\gnu\3.4.4-vxworks-6.3\x86-win32\bin) to list all of the symbols in C:\WindRiver\vxworks-6.3\target\lib\WPILib.a This lists all of the symbols in this library. Here's the interesting bit:

Code:

000003c0 T _ZN8SolenoidC1Ej
00000690 T _ZN8SolenoidC1Ejj

The symbol names don't line up (compare i and ii to j and jj). Anyone had a problem similar to this or guess what might have caused it? I would be interested to hear if other teams with symbol problems (no code error) are seeing similar output.

If it helps, run C:\WindRiver\gnu\3.4.4-vxworks-6.3\x86-win32\bin\nmppc C:\WindRiver\vxworks-6.3\target\lib\WPILib.a > outfile at a command prompt (I use Windows Power Shell)

and then you can open a file named "outfile" in any text editor to see the horrendously long list of nmppc output

Aaron S 19-02-2009 09:33

Re: Cannot get Code to Download to cRIO
 
I got this error the day after I updated the cRIO and fixed it by downloading the default code and then downloading our code (which I cleaned up a bit by going back through it and making sure I had fixed everything that looked like it could mess up). Whenever you get the "No Code" error after you have successfully downloaded your compiled .out file, it means that there is something wrong with your code. If there was no connectivity to the cRIO from the DS, "No Comm" would be displayed.

gm342 19-02-2009 17:18

Re: Cannot get Code to Download to cRIO
 
It's been several days and I have not seen any replies to this thread from other teams with the No Code error.

Did your error get fixed? Did you feel like it did it on its own or you changed something?

Are you still having problems, but it doesn't appear to be the same one as we're having?

Have you run the nmppc tool at all to compare output?

Thanks teams in replying. The reason why I am pushing this quite a bit is that this bug could track down to an issue inside of the Windriver gcc build, and this could save a lot of teams future heartache to work it now.

Aaron S 19-02-2009 20:14

Re: Cannot get Code to Download to cRIO
 
Again, it's more likely to be in your code if you successfully downloaded the .out file to the cRIO. Try making a new project based off the SimpleTemplate example and just adding your .cpp / .h files to it, then compiling. That's what I and my team did which seems to have worked.

gm342 20-02-2009 09:54

Re: Cannot get Code to Download to cRIO
 
Your fix may be a workaround to this larger problem. What may have happened is that by moving your files in the build order you changed the ordering in memory and gcc got a lucky fix and worked around it.

I have also done the new project, but in our case it hasn't resolved the problem.

I would say we should push for a md5/sha1 checksum on the cRIO for the uploaded file to compare it with the computer's file to verify the copy integrity. I will try this tonight and see where it goes. However, copying the file multiple times should have fixed any possible bit error. It would be inconsistent to get this same error after multiple uploads.

Thanks for the feedback.

computerish 26-02-2009 19:22

Re: Cannot get Code to Download to cRIO
 
We did an md5 sum. The files are the exact same for us.

We have solved this problem many times by reimaging the cRIO, but it always comes back. (And the fix is always different.)

ExarKun666 27-02-2009 00:02

Re: Cannot get Code to Download to cRIO
 
Okay our team just went through this problem and I personally went and debugged, undeployed, updated, ect... continuously.
We were successful in fixing this, while one team member was fixing the chain, I jokingly just said "For fun let's just check the wiring just in case." We found at least four loose wires, we tightened them all down, turned on the bot, downloaded and then it worked. I might mention we did the download tethered, but it works now wirelessly too. Hope this is some help. :D

computerish 01-03-2009 13:50

Re: Cannot get Code to Download to cRIO
 
We fixed our problem. Turns out that the function powf() that we were using to calculate the distance of the target is undefined, even though it is include in the Math.h file. pow() seems to work fine, though.

gm342 09-03-2009 22:10

Re: Cannot get Code to Download to cRIO
 
Here is some additional input that may help teams.

We had:
Code:

#define UINT32 unsigned int
in one of our files. This is actually slightly different than the type defined in WPILib (even though it eventually resolves into an unsigned int). The compiler/linker could successfully resolve that two-level symbol, but when placed on the cRIO, the variable types were slightly different and so the symbols did not match up.

This is not an obvious problem, with no obvious error message given. So other teams may have encountered this in some form also.

And Windriver/Eclipse guys reading this... why do you filter out -pedantic from the g++ Makefile settings in Eclipse IDE? It is very useful, and may have even caught this error.

Thanks to everyone for their help and input. Figuring out problems like this will be very useful for a lessons learned on the new cRIO controller.


All times are GMT -5. The time now is 17:30.

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