|
Page 1 of 1
|
[ 6 posts ] |
|
RobotC IDE crashes upon compile
| Author |
Message |
|
JaguarsTeam5009
Rookie
Joined: Wed Oct 05, 2011 4:34 pm Posts: 4
|
 RobotC IDE crashes upon compile
Hello,
When we loading (and compile) our teleop, the entire RobotC IDE freezes and then crashes. We are at version 3.54 on a Windows 7 32 bit computer and currently downloading the 3.55.2 beta to see if that fixes the issue.
Another thing to note is that when we remove the #include "JoystickDriver.c", is does not crash, and only spits undefined procedure type errors.
I've included a simplified teleop program which also crashes the program.
Thanks!
|
| Thu Nov 22, 2012 5:31 pm |
|
 |
|
JohnWatson
Site Admin
Joined: Thu May 24, 2012 12:15 pm Posts: 380
|
 Re: RobotC IDE crashes upon compile
The problem I'm seeing with this code is that you have the servos defined in the #pragma statements, but the program is not configured for a Servo Controller. The easiest way to solve this is to enter the Motors and Sensor Setup window through the Robot menu and configure the 'External Controllers' tab accordingly. Once it's done, it should look something like this:  |  |  |  | Code: #pragma config(Hubs, S1, HTMotor, HTServo, none, none) #pragma config(Sensor, S1, , sensorI2CMuxController) #pragma config(Motor, mtr_S1_C1_1, motorD, tmotorTetrix, openLoop) #pragma config(Motor, mtr_S1_C1_2, motorE, tmotorTetrix, openLoop) #pragma config(Servo, srvo_S1_C2_1, servo1, tServoNone) #pragma config(Servo, srvo_S1_C2_2, servo2, tServoNone) #pragma config(Servo, srvo_S1_C2_3, servo3, tServoNone) #pragma config(Servo, srvo_S1_C2_4, servo4, tServoNone) #pragma config(Servo, srvo_S1_C2_5, servo5, tServoNone) #pragma config(Servo, srvo_S1_C2_6, servo6, tServoNone) |  |  |  |  |
This is why we always recommend using the Motor and Sensors setup window (instead of manually entering the configuration #pragma statements); it will automatically create the necessary #pragma statements, and you don't have to worry about forgetting a parameter or misspelling/capitalizing a word. We actually have a page on our wiki that goes a bit more in depth with the HiTechnic Motor and Servo Controllers that you may want to look at, here.
_________________Check out our Blog! And our Facebook page! Need help? Take a look at our Wiki and our Forums.I just met you, And this is crazy, But here's my code now, So fix it, maybe? ~ Carly Rae Jepsen parody
|
| Mon Nov 26, 2012 2:29 pm |
|
 |
|
JaguarsTeam5009
Rookie
Joined: Wed Oct 05, 2011 4:34 pm Posts: 4
|
 Re: RobotC IDE crashes upon compile
Thanks for the suggestion, but it turns out that the culprit was the enumeration. Upon removing the previous code and replacing it with #defines, the program compiled successfully. To reproduce the error, you must include the Joystick driver and have an enumeration. Either alone does not crash the IDE, but together they cause the crash.
|
| Mon Nov 26, 2012 5:08 pm |
|
 |
|
amcerbu
Novice
Joined: Sun Oct 21, 2012 10:01 pm Posts: 76
|
 Re: RobotC IDE crashes upon compile
When you use an enumeration, you have to name it. The name of a data structure in C and RobotC (an enum, struct, or union) comes at the end, rather than the beginning (as in C++, C#, etc.). This syntax should work: You would have to replace all references to BUTTON_A with BUTTON_VALUES.BUTTON_A, and so on.
|
| Wed Nov 28, 2012 2:27 am |
|
 |
|
karim
Rookie
Joined: Mon Nov 29, 2010 10:56 am Posts: 3
|
 Re: RobotC IDE crashes upon compile
We have the same problem with enums. Below is a simplified test case that is guaranted to crash our IDE (3.55.2). Note that it only crashes if a call is made to a function that expects an enum parameter. If that call is commented out, it compiles just fine. We tried the suggestion of naming the enum below, but that results in this error: **Error**:Expected->';'. Found 'JointID' Regardless, whatever the issue with enums, it should not crash the IDE. Here's the code: In the meantime we'll switch to using defines Thanks.
|
| Wed Feb 27, 2013 1:45 pm |
|
 |
|
tfriez
Site Admin
Joined: Wed Jan 24, 2007 10:42 am Posts: 537
|
 Re: RobotC IDE crashes upon compile
ROBOTC works well when you first declare a “typedef struct” or “typedef union”. And then declare a variable of that type. ROBOTC won't work at all when you directly define the “struct/union” and end it with a variable name. The issue is further complicated by different syntaxes supported in “C” and “C++”. “C++” is more tolerant of this topic. However, in the latest 3.59 BETA, the code: Should work without issue. I just tested this and ROBOTC compiled/downloaded without issue.
_________________Timothy Friez ROBOTC Developer - SW Engineer tfriez@robotc.net
|
| Fri Mar 01, 2013 5:27 pm |
|
|
|
Page 1 of 1
|
[ 6 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 0 guests |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|