View previous topic :: View next topic |
Author |
Message |
Johnjc Guest
|
Not enough ram ".sym file shows fragment" |
Posted: Mon Nov 26, 2007 2:18 pm |
|
|
When i compile my program I get the not enough ram error (PCH ver4). I am using PIC18F8722. I look at .sym file and notice that ram allocation is not continuous. Allocation goes to 35A and stops then picks back up at F71. A large chunk of ram not used. Why is this happening?
Thanks
John |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Mon Nov 26, 2007 2:39 pm |
|
|
The 18F8722 has 3932 bytes of RAM, in hex notation that's 0xF5C.
The Special Function Registers (SFR) are mapped into the same address space as RAM. SFR memory in the PIC18F8722 starts at 0xF60 and ends at 0xFFF.
The symbols you see allocated at 0xF71 and higher are SFR's.
Normally you only get a symbol file when compilation succeeded without errors. Are you sure you are looking at the symbol file for your most recent program? Haven't you added a new large array to your program?
What is your exact compiler version? It looks something like 4.062 and can be found on top of the list file (*.lst). |
|
|
Johnjc Guest
|
|
Posted: Mon Nov 26, 2007 3:05 pm |
|
|
Version 4.042. The compiler creates the .sym file each time I compile. I have a data array signed long data[1024]. That should take 2048 bytes (compiler manual says long default size is 2 bytes). The amount of ram from address 35A to F71 is 3095 bytes, this is enough for the data array. I am not sure why the rest of the ram is not being mapped?
Thanks for the help! |
|
|
Ttelmah Guest
|
|
Posted: Mon Nov 26, 2007 3:51 pm |
|
|
Are you sure somebody hasn't been fiddling in device editor, and that you have the device selected correctly? Have just tried with 4.042, and it happily accepted a 1024 entry 'long' array fine.
Double check in device selector, that it shows 3800+ bytes of RAM, and that in device editor, all but the last column is ticked in the memory available selector.
Best Wishes |
|
|
Johnjc Guest
|
|
Posted: Tue Nov 27, 2007 6:10 am |
|
|
Thanks for the info. I am not using mplab. I am compiling from the command line. Since I have the #include <18F8722.h> shouldn't the memory be set correctly for full usage?
Thanks |
|
|
Johnjc Guest
|
|
Posted: Tue Nov 27, 2007 6:43 am |
|
|
Removing the directive #device icd=true allows the program to compile properly. Not sure why compiling for icd debugging causes memory usage to be reduced? |
|
|
Ken Johnson
Joined: 23 Mar 2006 Posts: 197 Location: Lewisburg, WV
|
|
Posted: Tue Nov 27, 2007 8:01 am |
|
|
ICD debugging needs a little memory also
Ken |
|
|
|