Go to Post If there isn't unity in your team, the outcome will never be good. - Arefin Bari [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 08-02-2006, 18:41
Semicolon's Avatar
Semicolon Semicolon is offline
Registered User
#0399
 
Join Date: Feb 2005
Location: California
Posts: 21
Semicolon will become famous soon enough
Unhappy Another Loader Error

When we loaded our code to the robot, it popped up with a bunch of errors. After some trial and error, we found it was our timer code and our autonomous code that caused the errors. The errors were wierd too. Once loaded, the loader would tell us there was an error and pop up with a bunch of hexidecimals that make no sense (to us anyway).

WHAT'S UP WITH THAT!?!?!?

P.S. if it will help to see the code, just ask.
__________________
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Stay with me here...

Everyone knows that Time = Money and Knowledge is power right? It is also known that Power = Work / Time. So then we substitue Power and time so Knowledge = Work / Money. Then we solve for money and get that Money = Work / Knowledge. So, As Knowledge approaches 0, the more money is made regardless of how much work is done.

Now we know that the less you know the more money you make, even with close to no work!
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  #2   Spotlight this post!  
Unread 08-02-2006, 18:42
Tureyhall Tureyhall is offline
Registered User
AKA: Thomas Hall
FRC #0668 (Apes Of Wrath)
Team Role: Programmer
 
Join Date: Feb 2006
Rookie Year: 2004
Location: San Jose
Posts: 40
Tureyhall will become famous soon enoughTureyhall will become famous soon enough
Re: Another Loader Error

it ALWAYS helps to see the code AND the errors/hex that came with the errors.
__________________
/*Nerd Camouflage*/

2005 SVR - 668+1072+840 - Semifinalists.
2006 SVR - 668+1280+1693 - Finalists.
2007 SVR - 668+604+624 - Quarter-finalists, Xerox Creativity Award, two highest scores (290-2, 128-0) at SVR.
2007 Nat's - TBA.
  #3   Spotlight this post!  
Unread 08-02-2006, 18:57
Semicolon's Avatar
Semicolon Semicolon is offline
Registered User
#0399
 
Join Date: Feb 2005
Location: California
Posts: 21
Semicolon will become famous soon enough
Re: Another Loader Error

Quote:
Originally Posted by Tureyhall
it ALWAYS helps to see the code AND the errors/hex that came with the errors.
Here you go. Can't get errors right now, but could you tell me how to find out what they mean?

Quote:
/************************************************** *****************************
*
TITLE: 399Auto.c
*
* VERSION: 0.1 (Beta)
*
* DATE: 04-Oct-2005
*
* AUTHOR: Semicolon
*
* COMMENTS: Hello!
*
************************************************** ******************************
*
* CHANGE LOG:
*
* DATE REV DESCRIPTION
* ----------- --- ----------------------------------------------------------
* Nothing
*
************************************************** *****************************/
//--Header Files--\\
#include <stdio.h>
#include <math.h>

#include "ifi_aliases.h"
#include "ifi_default.h"
#include "ifi_utilities.h"
#include "user_routines.h"
//#include "user_Serialdrv.h"
#include "399code.h"
#include "399Auto.h"
#include "tracking.h"
#include "camera.h"

#define AUTOSPEED 50
#define AUTOFWD 127+AUTOSPEED
#define AUTOBK 127-AUTOSPEED
#define MOTORSTEP 1

extern int motor01accel;
extern int motor02accel;
extern int AutoState;
extern int Centering;
int RobotTime = 0;
extern int Alarm;
extern int cent;
extern int dista;
extern int motor03;
extern int motor04;
extern int motor01;
extern int motor02;



/************************************************** *****************************
* FUNCTION NAME: TimerUpdate
* PURPOSE: Updates the robot time
* CALLED FROM: Autonomous399()
* ARGUMENTS: void
* RETURNS: void
* NOTES: Robot Time is in miliseconds
************************************************** *****************************/
void TimerUpdate(void)
{
// RobotTime = RobotTime + 26;

// printf("RobotTime:%d\r\n",RobotTime);
}
/************************************************** *****************************
* FUNCTION NAME: SetAlarm
* PURPOSE: Sets an alarm that will go off in the alloted time
* CALLED FROM: Process_Data_From_Master_uP
* ARGUMENTS:
* Argument Type Description
* -------- ------ -----------
* Seconds int It is Miliseconds
* RETURNS: void
* NOTES: I don't care, I mean who gives a crap anyway? I figure if you're looking at this
You probably want to know what this does, but if you dont already know what
This does, you didn't program it and if you didn't program it
Then you're probably not a programmer who wouldn't understand
this stuff anyway right? Right.
************************************************** *****************************/
void SetAlarm(int Seconds)
{
// Alarm = RobotTime + Seconds;
}
/************************************************** *****************************
* FUNCTION NAME: Manual399
* PURPOSE: What the robot does in Manual Mode
* CALLED FROM: Process_Data_From_Master_uP
* ARGUMENTS: void
* RETURNS:
* Returns Descriptionuser_Routines_Fast
* -------- -----------
* 1 Alarm has fired
* 0 Has not reached the Alarm
* NOTES: I don't care
************************************************** *****************************/
int CheckAlarm(void)
{
// int flag = 0;

// if(RobotTime >= Alarm)
// flag = 1;

// return flag;
}
/************************************************** *****************************
* FUNCTION NAME: Autonomous399
* PURPOSE: What the robot does in Autonomous Mode
* CALLED FROM: User_routines_Fast/User_Autonomous_Code()
* ARGUMENTS: void
* RETURNS: void
* NOTES: Well if you have a pole one light year long and you pull on it
does the other side take a whole year to move or does it move right away?
If it moves right away then there is something out there that
moves faster than the speed of light, but didn't Einstein say that
the speed of light is the universal speed limit?
************************************************** *****************************/
void Autonomous399(void)
{
switch(dip_switch())
{
// case 1: Auto1_Shoot(); break;
// case 2: Auto2_Dump(); break;
// case 3: Auto3_(); break;
case 4: break;//DO NOTHING
}
}
/************************************************** *****************************
* FUNCTION NAME: dip_switch
* PURPOSE: turn dip switches to #s 1-4
* CALLED FROM:
* ARGUMENTS: void
* RETURNS:
* Switches Outcomes
* ----------- -----------
* 0 0 1
* 1 0 2
* 0 1 3
* 1 1 4
* NOTES: I don't care
************************************************** *****************************/
int dip_switch(void)
{
int dip;
dip = (4*digital_io_01) + (2*digital_io_02) + digital_io_03;
return dip;
}

/************************************************** *****************************
* FUNCTION NAME: Auto1_Shoot
* PURPOSE: What the robot does in Autonomous Mode
* CALLED FROM: User_routines_Fast/User_Autonomous_Code()
* ARGUMENTS: void
* RETURNS: void
* NOTES: Yeah, so a C++ programmer from Apple walks into a bar and says
"Bartender can I have a soda and soda on the rocks?" and the
Bartender says, "Soda and soda, that doesnt make any sense mister."
and the programmer says, "whoops, looks like I took a ring zero exception
fault on an illegal instruction in the old CPU huh?"
************************************************** *****************************/
/*void Auto1_Shoot(void)
{
// TimerUpdate();
switch(AutoState)
{
case 1:
// SetAlarm(1500);
AutoState = 2;
break;
case 2:
pwm04 = pwm05 = pwm06 = pwm07 = 200;
pwm08 = pwm09 = motor03 + MOTORSTEP;
if(CheckAlarm()1)
{
pwm04 = pwm05 = pwm06 = pwm07 = 127;
AutoState= 3;
}
break;
case 3:
if(Center_On_Goal() == 1)
{
AutoState = 4;
}
break;
case 4:
if(MoveInOnGoal() == 1)
{
AutoState = 5;
}
break;
case 5:
pwm08 = pwm09 = pwm10 = pwm11 = 254;

break;
}
}
/************************************************** *****************************
* FUNCTION NAME: Auto2
* PURPOSE: What the robot does in Autonomous Mode
* CALLED FROM: User_routines_Fast/User_Autonomous_Code()
* ARGUMENTS: void
* RETURNS: void
* NOTES: Are you still seriously reading these things? If you want the notes
you'll have to go to class yourself, I am tired of pulling your
weight around here, seriously, next time you're absent I'm not taking
the notes for you.
************************************************** *****************************/
/*void Auto2_Dump(void)
{
motor03 = pwm09 = pwm08;
// TimerUpdate();
switch(AutoState)
{
case 1:
// SetAlarm(800);
AutoState = 2;
break;
case 2: //Turn Right .8s
pwm04 = pwm05 = 254;
pwm06 = pwm07 = 0;
pwm08 = pwm09 = motor03 - MOTORSTEP;
if(CheckAlarm())
{
pwm04 = pwm05 = pwm06 = pwm07 = 127;
// SetAlarm(1500);
AutoState = 3;
}
break;
case 3: //go forward 1.5s
pwm04 = pwm05 = pwm06 = pwm07 = 254;
if(CheckAlarm()1)
{
pwm04 = pwm05 = pwm06 = pwm07 = 127;
AutoState = 4;
}
break;
case 4: //DUMP
pwm08 = pwm09 = 0;
relay1_fwd = 1; //Open Door
break;
}
}
/************************************************** *****************************
* FUNCTION NAME: Auto3_
* PURPOSE: What the robot does in Autonomous Mode
* CALLED FROM: User_routines_Fast/User_Autonomous_Code()
* ARGUMENTS: void
* RETURNS: void
* NOTES: David's.
************************************************** *****************************/
/*void Auto3_(void)
{

motor03 = pwm09 = pwm08;
// TimerUpdate();
switch(AutoState)
{
case 1:
// SetAlarm(10000);
AutoState = 2;
break;

case 2:
pwm04 = pwm05 = pwm06 = pwm07 = 254;//floor it!//
if(CheckAlarm())
{
AutoState = 0;
pwm04 = pwm05 = pwm06 = pwm07 = 127;
}
break;
}
}
*/
Give credit where it's due! (me by the way)
__________________
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Stay with me here...

Everyone knows that Time = Money and Knowledge is power right? It is also known that Power = Work / Time. So then we substitue Power and time so Knowledge = Work / Money. Then we solve for money and get that Money = Work / Knowledge. So, As Knowledge approaches 0, the more money is made regardless of how much work is done.

Now we know that the less you know the more money you make, even with close to no work!
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  #4   Spotlight this post!  
Unread 08-02-2006, 19:12
Tureyhall Tureyhall is offline
Registered User
AKA: Thomas Hall
FRC #0668 (Apes Of Wrath)
Team Role: Programmer
 
Join Date: Feb 2006
Rookie Year: 2004
Location: San Jose
Posts: 40
Tureyhall will become famous soon enoughTureyhall will become famous soon enough
Re: Another Loader Error

this is what happens when you take out all the commented out code. this is all that the compiler/robot sees:


Quote:
/************************************************** *****************************
*
TITLE: 399Auto.c
*
* VERSION: 0.1 (Beta)
*
* DATE: 04-Oct-2005
*
* AUTHOR: Semicolon
*
* COMMENTS: Hello!
*
************************************************** ******************************
*
* CHANGE LOG:
*
* DATE REV DESCRIPTION
* ----------- --- ----------------------------------------------------------
* Nothing
*
************************************************** *****************************/
//--Header Files--\\
#include <stdio.h>
#include <math.h>

#include "ifi_aliases.h"
#include "ifi_default.h"
#include "ifi_utilities.h"
#include "user_routines.h"
//#include "user_Serialdrv.h"
#include "399code.h"
#include "399Auto.h"
#include "tracking.h"
#include "camera.h"

#define AUTOSPEED 50
#define AUTOFWD 127+AUTOSPEED
#define AUTOBK 127-AUTOSPEED
#define MOTORSTEP 1

extern int motor01accel;
extern int motor02accel;
extern int AutoState;
extern int Centering;
int RobotTime = 0;
extern int Alarm;
extern int cent;
extern int dista;
extern int motor03;
extern int motor04;
extern int motor01;
extern int motor02;





/************************************************** *****************************
* FUNCTION NAME: dip_switch
* PURPOSE: turn dip switches to #s 1-4
* CALLED FROM:
* ARGUMENTS: void
* RETURNS:
* Switches Outcomes
* ----------- -----------
* 0 0 1
* 1 0 2
* 0 1 3
* 1 1 4
* NOTES: I don't care
************************************************** *****************************/
int dip_switch(void)
{
int dip;
dip = (4*digital_io_01) + (2*digital_io_02) + digital_io_03;
return dip;
}
i wonder why nothing works? you've got..... what, 20 lines of code that actually are read? if i missed a close comment or something, just tell me, but i think i didn't take out any used code.
__________________
/*Nerd Camouflage*/

2005 SVR - 668+1072+840 - Semifinalists.
2006 SVR - 668+1280+1693 - Finalists.
2007 SVR - 668+604+624 - Quarter-finalists, Xerox Creativity Award, two highest scores (290-2, 128-0) at SVR.
2007 Nat's - TBA.
  #5   Spotlight this post!  
Unread 08-02-2006, 19:43
Semicolon's Avatar
Semicolon Semicolon is offline
Registered User
#0399
 
Join Date: Feb 2005
Location: California
Posts: 21
Semicolon will become famous soon enough
Re: Another Loader Error

Quote:
Originally Posted by Tureyhall
i wonder why nothing works? you've got..... what, 20 lines of code that actually are read? if i missed a close comment or something, just tell me, but i think i didn't take out any used code.
I'm Sorry, i didn't take all the quotes out before i posted it . The commented out portions are the ones that don't work. The uncommented one is the only one without an error. Sorry for the miss-post.
__________________
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Stay with me here...

Everyone knows that Time = Money and Knowledge is power right? It is also known that Power = Work / Time. So then we substitue Power and time so Knowledge = Work / Money. Then we solve for money and get that Money = Work / Knowledge. So, As Knowledge approaches 0, the more money is made regardless of how much work is done.

Now we know that the less you know the more money you make, even with close to no work!
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  #6   Spotlight this post!  
Unread 08-02-2006, 19:50
Tureyhall Tureyhall is offline
Registered User
AKA: Thomas Hall
FRC #0668 (Apes Of Wrath)
Team Role: Programmer
 
Join Date: Feb 2006
Rookie Year: 2004
Location: San Jose
Posts: 40
Tureyhall will become famous soon enoughTureyhall will become famous soon enough
Re: Another Loader Error

WHAT? are you sure that EVERYTHING that is commented out is bad? i mean, is the SetAlarm function messed up?

you should comment things out ONE FUNCTION AT A TIME, till you make sure that ONLY the ones that don't work are commented out.
__________________
/*Nerd Camouflage*/

2005 SVR - 668+1072+840 - Semifinalists.
2006 SVR - 668+1280+1693 - Finalists.
2007 SVR - 668+604+624 - Quarter-finalists, Xerox Creativity Award, two highest scores (290-2, 128-0) at SVR.
2007 Nat's - TBA.
  #7   Spotlight this post!  
Unread 08-02-2006, 20:09
Semicolon's Avatar
Semicolon Semicolon is offline
Registered User
#0399
 
Join Date: Feb 2005
Location: California
Posts: 21
Semicolon will become famous soon enough
Re: Another Loader Error

Quote:
Originally Posted by Tureyhall
WHAT? are you sure that EVERYTHING that is commented out is bad? i mean, is the SetAlarm function messed up?

you should comment things out ONE FUNCTION AT A TIME, till you make sure that ONLY the ones that don't work are commented out.
I did. We ended out commenting all but the dipswitches code. Everytime we commented out another function, the # of errors went down. When I test again, I will post my results and the errors. It might be because at first, we put everything in one c file and then split it into it's own autonomous file. We made extern variables and everything compiled fine, but it went to error when we loaded it. Any ideas? Should I contact someone?

P.S. Can we use float variables in the code? I heard it would be an error.
__________________
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Stay with me here...

Everyone knows that Time = Money and Knowledge is power right? It is also known that Power = Work / Time. So then we substitue Power and time so Knowledge = Work / Money. Then we solve for money and get that Money = Work / Knowledge. So, As Knowledge approaches 0, the more money is made regardless of how much work is done.

Now we know that the less you know the more money you make, even with close to no work!
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  #8   Spotlight this post!  
Unread 08-02-2006, 20:28
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,590
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Another Loader Error

What version of the IFI loader are you using? It should be 1.1.0 (not 1.0.10 or 1.0.12).
  #9   Spotlight this post!  
Unread 08-02-2006, 20:32
Greg Ross's Avatar
Greg Ross Greg Ross is offline
Grammar Curmudgeon
AKA: gwross
FRC #0330 (Beach 'Bots)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Hermosa Beach, CA
Posts: 2,245
Greg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond repute
Send a message via AIM to Greg Ross Send a message via Yahoo to Greg Ross
Re: Another Loader Error

Quote:
Originally Posted by Semicolon
When we loaded our code to the robot, it popped up with a bunch of errors. After some trial and error, we found it was our timer code and our autonomous code that caused the errors. The errors were wierd too. Once loaded, the loader would tell us there was an error and pop up with a bunch of hexidecimals that make no sense (to us anyway).

WHAT'S UP WITH THAT!?!?!?

P.S. if it will help to see the code, just ask.
I'm guessing you have exceeded the program size that the old ifi_loader can handle. You need v1.1.0. (This has been covered in many other threads here on CD. Maybe we need a sticky?)

P.S. If a moderator sees this, and decides to make a sticky thread, my suggestion is New IFI_LOADER!
__________________
Greg Ross (The Grammar Curmudgeon formerly known as gwross)
S/W Engineer, Team 330, the Beach 'Bots
<--The Grammar Curmudgeon loves this cartoon.
“Life should not be a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming "Wow! What a Ride!" Hunter S. Thompson
"Playing a practical joke means doing something mean and calling it funny." Me

Last edited by Greg Ross : 08-02-2006 at 21:04. Reason: Add suggestion for a sticky thread
  #10   Spotlight this post!  
Unread 09-02-2006, 17:39
Semicolon's Avatar
Semicolon Semicolon is offline
Registered User
#0399
 
Join Date: Feb 2005
Location: California
Posts: 21
Semicolon will become famous soon enough
Whoopsie!

um... hello again.

Solved the Problem!
- We had the new ifiloader and it wasn't that
- It wasn't in the .c code I posted. (everything was dandy there)
- It was in the .h code. (which i unfortunatly didn't post)
- At the begining where it says #if and #define and the name of the header file.
- It said _399Code_h_ instead of _399Auto_h_
- Shows how an error so small becomes something so big.
- I'm sorry if I worried any of you too much...
Closed Thread


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
IFI Error iwdu15 Programming 3 09-02-2006 18:11
Error in IFI Loader natis Programming 1 20-01-2006 17:15
IFI Loader Error Team905Animator Programming 6 12-01-2006 22:40
MPLink Error cloudago Programming 2 01-02-2005 23:00
PHP and Wiki Error Venkatesh Website Design/Showcase 2 24-07-2004 15:51


All times are GMT -5. The time now is 15:32.

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