Go to Post We also indirectly benefit from those rookie teams having well-built and working drivebases. It helps raise the level of performance across the board, making for a better competitive environment. - Alan Anderson [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 Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 12-14-2011, 01:13 PM
rbmj rbmj is offline
Registered User
FRC #0612 (Chantilly Robotics)
Team Role: Alumni
 
Join Date: Apr 2011
Rookie Year: 2011
Location: DC Area/Fairfax County
Posts: 192
rbmj is a jewel in the roughrbmj is a jewel in the roughrbmj is a jewel in the rough
C++ - No Code?

So my team is moving to C++ away from LabVIEW (which makes me want to bang my head against the wall). I've been trying to get some very simple code working (demos). Since I don't have WindRiver (my team lost the disk), I'm using ucpp to compile through the gccdist. Everything compiles/links fine, so I have a FRC_UserProgram.out , which I ftp up to the cRIO (just reimaged for C++). Then, driver station says Comm works, but claims No Robot Code even after a restart. I've verified that the .out file has uploaded successfully to /ni-rt/system .

So any ideas why the driver station still claims that there is no code?

Thanks!

PS: I've looked at the .ini files, and it appears that lvrt.out (which I assume means labview runtime) and startup.rtexe (the name of compiled labview code) are still set for startup. Don't want to toss out a red herring, but could this be it? FRC_ImageVersion.ini has Language=C, so I assume it isn't and I'm not deploying correctly (though the only file the compiler gives me is the .out file; I'm not exactly sure what I need in this case).

Anyways, thanks again.
Reply With Quote
  #2   Spotlight this post!  
Unread 12-14-2011, 01:54 PM
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 9,638
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: C++ - No Code?

Without the Wind River installation your generic compiler is probably targeting Windows rather than the VxWorks that runs on the cRIO.

Your code on the cRIO is probably starting and immediately dying on the first Windows call.

You can use Netconsole for the cRIO to check the error messages being generated. That gets installed with the FRC Utilities package. Just make sure the cRIO is setup for Netconsole (a choice during the cRIO imaging process).

The LabVIEW leftovers won't matter.
__________________
2018 Beta Testing Results


Last edited by Mark McLeod : 12-14-2011 at 01:57 PM.
Reply With Quote
  #3   Spotlight this post!  
Unread 12-14-2011, 02:27 PM
rbmj rbmj is offline
Registered User
FRC #0612 (Chantilly Robotics)
Team Role: Alumni
 
Join Date: Apr 2011
Rookie Year: 2011
Location: DC Area/Fairfax County
Posts: 192
rbmj is a jewel in the roughrbmj is a jewel in the roughrbmj is a jewel in the rough
Re: C++ - No Code?

No, I'm 99% sure it's targeting cRIO. For one, the build directory is for PPC. I'm using the cross-compiler provided by NI (gccdist) and the very nice ucpp project (https://github.com/nikitakit/ucpp). The makefile is virtually identical to the standard one given by NI.

I would use WindRiver, if I had it. But I wasn't able to get another copy of the license file. I need to make sure that everything works correctly before build season starts though, so necessity dictates I hack something together.
Reply With Quote
  #4   Spotlight this post!  
Unread 12-14-2011, 04:01 PM
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: C++ - No Code?

is the cRIO imaged for C++ or LabVIEW?
just open up the imaging tool, change it, and hit apply.
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
Reply With Quote
  #5   Spotlight this post!  
Unread 12-14-2011, 04:09 PM
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 9,126
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: C++ - No Code?


Quote:
Originally Posted by byteit101 View Post
is the cRIO imaged for C++ or LabVIEW?
original post:
Quote:
Originally Posted by rbmj View Post
(just reimaged for C++)
Reply With Quote
  #6   Spotlight this post!  
Unread 12-14-2011, 09:56 PM
AustinSchuh AustinSchuh is offline
Registered User
FRC #0971 (Spartan Robotics) #254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Feb 2005
Rookie Year: 1999
Location: Los Altos, CA
Posts: 887
AustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond repute
Re: C++ - No Code?

I second viewing either NetConsole or the serial port output. If you have trouble interpreting it, feel free to post it here and I will do my best to help.

The ucpp project targets the cRIO, and should build code correctly. I have been using that toolchain (under Linux) for years without issues, and with a similar Makefile.
Reply With Quote
  #7   Spotlight this post!  
Unread 12-15-2011, 10:10 AM
rbmj rbmj is offline
Registered User
FRC #0612 (Chantilly Robotics)
Team Role: Alumni
 
Join Date: Apr 2011
Rookie Year: 2011
Location: DC Area/Fairfax County
Posts: 192
rbmj is a jewel in the roughrbmj is a jewel in the roughrbmj is a jewel in the rough
Re: C++ - No Code?

OK. I was able to get NetConsole working after manually changing the default gateway in ni-rt.ini to 10.6.12.4.

More interestingly, it fails to lode the code due to undefined symbol errors. The symbols look like the mangled names of WPILib functions (_Z...WatchdogC1EPi), so i assume that ucpp is not linking in WPILib.

Where is the WPILib file? I assume I could add it to StartupDlls in ni-rt.ini, or change the makefile to run wine ldppc.exe (I too am on linux) or something of the like to statically link them together.

Or have I just missed a step. Again, I haven't modified the toolchain from the default linux ucpp.

Thanks for your help.

EDIT: Found the WPILib.a file. It looks like it *should* be linked in (glancing at the makefile). Why am I getting undefined symbol errors then?

Last edited by rbmj : 12-15-2011 at 10:34 AM.
Reply With Quote
  #8   Spotlight this post!  
Unread 12-15-2011, 11:21 AM
rbmj rbmj is offline
Registered User
FRC #0612 (Chantilly Robotics)
Team Role: Alumni
 
Join Date: Apr 2011
Rookie Year: 2011
Location: DC Area/Fairfax County
Posts: 192
rbmj is a jewel in the roughrbmj is a jewel in the roughrbmj is a jewel in the rough
Re: C++ - No Code?

Got it to work - An update to version 30 of the firmware did the trick (I was using version 29).

Thanks!
Reply With Quote
  #9   Spotlight this post!  
Unread 12-15-2011, 11:26 AM
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 9,638
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: C++ - No Code?

Great.
A mismatch of the library/image versions causing the error makes sense.
__________________
2018 Beta Testing Results


Last edited by Mark McLeod : 12-15-2011 at 03:19 PM.
Reply With Quote
  #10   Spotlight this post!  
Unread 12-15-2011, 12:41 PM
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,014
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: C++ - No Code?

Technically WPILib was being linked in. The failure was coming from a mismatch of symbol names between WPILib.a and the NI_FPGA.out binary that exposes symbols to access the FPGA.
Reply With Quote
  #11   Spotlight this post!  
Unread 12-15-2011, 12:43 PM
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,014
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: C++ - No Code?

Quote:
Originally Posted by rbmj View Post
Got it to work - An update to version 30 of the firmware did the trick (I was using version 29).
Would you care to write up a document describing what you used and how you put it together (potentially including the Makefile you ended up with) so that others on Linux can get a head start?

Thanks,
-Joe
Reply With Quote
  #12   Spotlight this post!  
Unread 12-15-2011, 01:38 PM
AustinSchuh AustinSchuh is offline
Registered User
FRC #0971 (Spartan Robotics) #254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Feb 2005
Rookie Year: 1999
Location: Los Altos, CA
Posts: 887
AustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond repute
Re: C++ - No Code?

Quote:
Originally Posted by jhersh View Post
Would you care to write up a document describing what you used and how you put it together (potentially including the Makefile you ended up with) so that others on Linux can get a head start?

Thanks,
-Joe
The ucpp project is just that. It is nicely packaged to make it easy to use.

https://github.com/nikitakit/ucpp

Code:
Universal compiling scripts for FRC

System Requirements:
  For Linux: wine, wput
  For Windows: MSYSgit or Cygwin

Installation instructions:
 - Add the "ucpp/ucpp" folder to your system PATH
 - Run the ucpp setup script
       $ ucpp setup -t <team-number>

Creating a project
 $ ucpp init
        Configures the current directory as an FRC C++ project
        that deploys code to your team's robot.

        The ucpp build system aims to be fully compatible with
        development in WindRiver. You can initialize any existing
        WindRiver project as a ucpp project, as well as any folder
        that contains C++ files.

Building and deploying code
 $ ucpp configure
        Generates a Makefile for your project
        For additional options, run "ucpp configure help"
 $ make
        Compile the project
 $ make deploy
        Deploy code to the robot
Reply With Quote
  #13   Spotlight this post!  
Unread 12-15-2011, 02:03 PM
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,014
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: C++ - No Code?

Quote:
Originally Posted by AustinSchuh View Post
The ucpp project is just that. It is nicely packaged to make it easy to use.
Excellent. Somehow I had not seen this before. Nice work.

-Joe
Reply With Quote
  #14   Spotlight this post!  
Unread 12-16-2011, 12:51 PM
rbmj rbmj is offline
Registered User
FRC #0612 (Chantilly Robotics)
Team Role: Alumni
 
Join Date: Apr 2011
Rookie Year: 2011
Location: DC Area/Fairfax County
Posts: 192
rbmj is a jewel in the roughrbmj is a jewel in the roughrbmj is a jewel in the rough
Re: C++ - No Code?

Note that the main version by nikitakit doesn't work for me - it calls python2 which is only python on some boxes. Ozzloy added a few commits to detect where python2 was installed and call that through a shell variable, so his fork might work better for many users. He submitted a pull request a long time ago but upstream hasn't merged them in.

I made some patches to some of the scripts as well, as I was getting syntax errors on my computers (Debian & openSUSE). I have a fork at github (https://github.com/rbmj/ucpp) that has ozzloy's changes as well as mine until upstream merges them in. I've also requested that ozzloy merge my changes into his repo.

Last edited by rbmj : 12-16-2011 at 12:57 PM.
Reply With Quote
  #15   Spotlight this post!  
Unread 12-16-2011, 02:49 PM
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: C++ - No Code?

Quote:
Originally Posted by rbmj View Post
Note that the main version by nikitakit doesn't work for me - it calls python2 which is only python on some boxes. Ozzloy added a few commits to detect where python2 was installed and call that through a shell variable, so his fork might work better for many users. He submitted a pull request a long time ago but upstream hasn't merged them in.

I made some patches to some of the scripts as well, as I was getting syntax errors on my computers (Debian & openSUSE). I have a fork at github (https://github.com/rbmj/ucpp) that has ozzloy's changes as well as mine until upstream merges them in. I've also requested that ozzloy merge my changes into his repo.
Did not realize that, I though that was pulled a while ago. submit the pull request to nikitakit/ucpp (I just pulled ozzloy's)
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
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 12:27 PM.

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


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