Go to Post As a Mississippi boy, I'm especially proud that I could read - Natchez [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 09-02-2004, 18:22
ShadowKnight's Avatar
ShadowKnight ShadowKnight is offline
Registered User
FRC #1719 (Umbrella Corporation)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2003
Location: Alexandria, VA
Posts: 142
ShadowKnight has a spectacular aura aboutShadowKnight has a spectacular aura about
IFI loader help!

Ok, so i've been trying to download code to the EDUbot for about 2 weeks, but it doesn't work. When I tried to download, a box would pop up saying:

ERROR '6'
Overflow

I would also get back a file called ERROR.MCP, filled with a buncha hex numbers. And the program light would stay yellow. I have IFI_Loader v. 1.0.7 and the memory isn't a problem, the .map file says 41% is used.

I tried copying my code into the default code function by function, and it starts messing up when i get to my absolute value function. For some reason, this works:

short long abs(short long num)
{
return num;
}

but this doesn't:

short long abs(short long num)
{
if (num < 0) return -num;
else return num;
}


Help me please!
__________________
Gracious Professionalism isn't simply courtesy or tradition, it's a way of life

I met her through FIRST...

We only are where we are by God's providence and by no other...
  #2   Spotlight this post!  
Unread 09-02-2004, 18:42
deltacoder1020's Avatar
deltacoder1020 deltacoder1020 is offline
Computer Guy
AKA: Dav
#1020 (The Indiana Prank Monkeys)
Team Role: Programmer
 
Join Date: Jan 2004
Location: Muncie, Indiana
Posts: 340
deltacoder1020 has a spectacular aura aboutdeltacoder1020 has a spectacular aura about
Send a message via AIM to deltacoder1020
Re: IFI loader help!

"short long" - this seems slightly redundant... might try "short int", "int", or "long".
__________________
Team 1020, the Indiana Prank Monkeys (www.team1020.org)
  #3   Spotlight this post!  
Unread 09-02-2004, 19:39
ShadowKnight's Avatar
ShadowKnight ShadowKnight is offline
Registered User
FRC #1719 (Umbrella Corporation)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2003
Location: Alexandria, VA
Posts: 142
ShadowKnight has a spectacular aura aboutShadowKnight has a spectacular aura about
Re: IFI loader help!

Quote:
Originally Posted by deltacoder1020
"short long" - this seems slightly redundant... might try "short int", "int", or "long".

"short long" is a 24 bit variable; check the programming reference guide.
Anyway, that's not the problem. It worked with short longs before.
__________________
Gracious Professionalism isn't simply courtesy or tradition, it's a way of life

I met her through FIRST...

We only are where we are by God's providence and by no other...
  #4   Spotlight this post!  
Unread 09-02-2004, 19:43
deltacoder1020's Avatar
deltacoder1020 deltacoder1020 is offline
Computer Guy
AKA: Dav
#1020 (The Indiana Prank Monkeys)
Team Role: Programmer
 
Join Date: Jan 2004
Location: Muncie, Indiana
Posts: 340
deltacoder1020 has a spectacular aura aboutdeltacoder1020 has a spectacular aura about
Send a message via AIM to deltacoder1020
Re: IFI loader help!

Quote:
Originally Posted by ShadowKnight
"short long" is a 24 bit variable; check the programming reference guide.
Anyway, that's not the problem. It worked with short longs before.
just somewhat curious as to why you're using them.
__________________
Team 1020, the Indiana Prank Monkeys (www.team1020.org)
  #5   Spotlight this post!  
Unread 10-02-2004, 10:52
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: 8,856
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: IFI loader help!

It has all the symptoms of running out of data or program space.
Sorry to say (or is it good news?) there's absolutely nothing wrong with the code you posted (as you knew). The only thing you didn't mention is how much data space you are filling.
A simple test would be to comment out something else that frees up data space, then add in your abs function.
Any overly large arrays hidden elsewhere in the code, array macros used repeatedly (found one guy who did that with his SIN table, boy did his data space disappear fast!), other things that don't show up in the program space total?

Try varying the combinations of other software you've added in with particular attention to high volume variable users.

If you'd like to email be your zipped project I'd be glad to serve as a second pair of eyes. You know how it can be sometimes when you're looking at your own code.

[edit]
As a side note I just noticed today's revision of the FRC default code removes some IFI debug code and frees up more program space.
[/edit]
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 10-02-2004 at 15:39.
  #6   Spotlight this post!  
Unread 10-02-2004, 10:58
ErichKeane ErichKeane is offline
Registered User
FRC #3210
Team Role: Mentor
 
Join Date: Nov 2003
Rookie Year: 2004
Location: Hillsboro, OR
Posts: 113
ErichKeane is just really niceErichKeane is just really niceErichKeane is just really niceErichKeane is just really niceErichKeane is just really nice
Send a message via AIM to ErichKeane
Re: IFI loader help!

Quote:
Originally Posted by ShadowKnight
Ok, so i've been trying to download code to the EDUbot for about 2 weeks, but it doesn't work. When I tried to download, a box would pop up saying:

ERROR '6'
Overflow

I would also get back a file called ERROR.MCP, filled with a buncha hex numbers. And the program light would stay yellow. I have IFI_Loader v. 1.0.7 and the memory isn't a problem, the .map file says 41% is used.

I tried copying my code into the default code function by function, and it starts messing up when i get to my absolute value function. For some reason, this works:

short long abs(short long num)
{
return num;
}

but this doesn't:

short long abs(short long num)
{
if (num < 0) return -num;
else return num;
}


Help me please!
Few things i would try. First, make absolutely sure you have the most recent version of the IFI Loader, from InnovationFirst

Second, try instead of return -num;, try return 0-num; Only because in the past it has given me weird errors because of the - sign as an opposite.

Other than that, check the piece of code above it, if a {} is not closed correctly, it may cause errors. BTW, do you have the function prototype listed in the top of the code?
  #7   Spotlight this post!  
Unread 10-02-2004, 17:43
ShadowKnight's Avatar
ShadowKnight ShadowKnight is offline
Registered User
FRC #1719 (Umbrella Corporation)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2003
Location: Alexandria, VA
Posts: 142
ShadowKnight has a spectacular aura aboutShadowKnight has a spectacular aura about
Re: IFI loader help!

I had an inspiration today as I played with my calculator in math class. When I multiplied numbers too big, i got a message that said "Overflow," which is the same message I got from IFI loader. I have a sin function in my code which uses a MacLaurin series expansion to approximate sin. The code looks like this:

int sin(unsigned int theta)
{
if (theta > 9000) {return (-sin(theta - 18000));} /*maclaurin series for approximation, works only in radians*/

else {
float th = theta * 3.1415/ 18000;
return (int)(th - (th * th * th / 6) + (th * th * th * th * th / 120) * 100);
}
}/* end sin*/


so I think the pic couldn't raise an unsigned int to the fifth power, because the number got too large. I commented out the math and now it works.

Thanks!
__________________
Gracious Professionalism isn't simply courtesy or tradition, it's a way of life

I met her through FIRST...

We only are where we are by God's providence and by no other...
  #8   Spotlight this post!  
Unread 10-02-2004, 17:46
deltacoder1020's Avatar
deltacoder1020 deltacoder1020 is offline
Computer Guy
AKA: Dav
#1020 (The Indiana Prank Monkeys)
Team Role: Programmer
 
Join Date: Jan 2004
Location: Muncie, Indiana
Posts: 340
deltacoder1020 has a spectacular aura aboutdeltacoder1020 has a spectacular aura about
Send a message via AIM to deltacoder1020
Re: IFI loader help!

yep. that would make sense. that's the problem with forums - unless you post the entire thing, it's possible that we can't see the problem
__________________
Team 1020, the Indiana Prank Monkeys (www.team1020.org)
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 Loader problems billstu Programming 22 23-03-2004 11:39
White Paper Discuss: IFI Loader for Linux with compiling instructions CD47-Bot Extra Discussion 1 09-02-2004 16:46
IFI Loader Doc's Raven_Writer Programming 0 21-01-2004 17:53
Bug in IFI Loader rwaliany Programming 2 06-01-2004 21:26
IFI Loader on ME LBK Rules Programming 1 18-12-2003 17:49


All times are GMT -5. The time now is 00:01.

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