View Single Post
  #5   Spotlight this post!  
Unread 07-11-2005, 08:02
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: EDU Mini Controller & 2005 Nav Code

The memory map can be generated by MPLAB whenever you compile your code by going to:
Project -> Build Options... -> Project
then click on the "MPLINK Linker" tab,
then click on "Generate map file".
After you build your project look in your project directory for a text file ending in ".map". You can view it in any text editor.

The *.map file has four parts:
1) Section Info
2) Program Memory Usage
3) Symbols - Sorted by Name
4) Symbols - Sorted by Address

Section 2 is pretty useful as it gives the utilization summary for the Program Space directly, but 90% actually represents full as far as the user is concerned.

Section 4 shows the Data Space utilization that you want (ignore for now the Program Space – see column marked “location”). It provides the starting address of each declared variable. The ending address can be either assumed to be where the next variable starts or calculated from the known size.

-----------------
rc is fine declared the way it is. My fault for snapping off a quick afterthought and not checking the code first.
rc's value is the status returned from each of the driving functions, so the problem is probably within one or more of the driving functions.
Identify the function(s) being executed when it returns the bad values. It could be as simple as just not being assigned before exiting the drive routine.

If it's an overwrite issue it'll either be within the drive function or possibly with any debug printfs that occur before you check rc to proceed to the next command.

As regards the printf, the EDU code because of it's age is probably not using the newest C compiler version, but an old IFI version printf_lib.c/h. That old version has several limitations you should read about in the printf_lib.c header comments. I only mention it because one of the limitations is it will overwrite if you attempt to printf a long message (> 80 characters). I doubt this is your problem because the bad rc numbers you quoted are not the ASCII characters you'd expect if this were happening.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 07-11-2005 at 09:52.