Object exceeds 32k
Dave Hein
Posts: 6,347
I have a·Spin program·with several objects that has about 2000 longs of free space.· If I add an array of more than 575 longs I get an error message that says "Object exceeds 32k", even though I should have more than 1400 longs of free space.· If I eliminate the top object and recompile I can get to within a few longs of 32k without an error message.· Has anybody else encountered this problem?· Is there a work-around for it?
Comments
Constants and/or variables declared in the DAT section aren't counted in the calculated variable space?
Time to start hacking away at your objects[noparse]:)[/noparse]
You do what I do... rather than being systematic about it all, I just start out with a big unused array declaration and when I get a memory error or something spilling over into my graphics, I know I am getting close to my limit. Not very scientific, but it works for me[noparse]:)[/noparse]
I've noticed that in some of the newer objects, the guys are including the number of longs used as a comment.
Rich
The Prop tool shows a nice little memory map when you compile.· Can you use that to see what's going on?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
My Prop Products:· http://www.rayslogic.com/Propeller/Products/Products.htm
Anybody at Parallax interested in looking into it?· I can zip up the code and send it to you.
Dave
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You only ever need two tools in life. If it moves and it shouldn't use Duct Tape. If it does not move and it should use WD40.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)·
· Prop OS: SphinxOS·, PropDos , PropCmd··· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBlade Props: www.cluso.bluemagic.biz
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
My Prop Products:· http://www.rayslogic.com/Propeller/Products/Products.htm
Feel free to try out the cdos app if you want.· It still needs a lot of work, and I haven't documented it yet.· It's basically a test program for the file I/O routines I'm adding to CLib.· It includes an interface to the FSRW object for SD cards and an EEProm files system I'm writing.· I also included a YModem object based on Rayman's YModem code.
cdos talks to a serial terminal at 57,600 baud using the standard I/O pins 30 and 31.· It uses the boot EEProm for the EEProm file system, so you have to load directly into RAM with F10 to avoid wiping out the file system.· I have the SD card interface set up on I/O pins 16, 17, 18 and 19.· This can be changed in fsrwif.spin.· The EEProm is mounted at /disk1 and the SD card is mounted at /disk2 in the cdos file system.
Dave
Every man and his dog includes clib.
clib is *huge* consuming 50% of the available program space.
I suspect the Propeller Tool is building the binary image prior to doing its duplicate object reduction, and hitting the 32k object size limit while trying to pack the objects together before it has a chance to pare them down.
bst works differently in that it compiles each object completely separately and then stitches them together. It also looks at the referenced objects from a source path perspective, and does not bother to compile it again if it is already in the object pool. Only when all objects have been compiled does it do a binary compare to weed out any it might be able to reduce.
It's a completely different method of assembly to the way the Propeller tool does things.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You only ever need two tools in life. If it moves and it shouldn't use Duct Tape. If it does not move and it should use WD40.
I just compiled CDOS and I must say it might have the most extensive object tree I've seen...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
My Prop Products:· http://www.rayslogic.com/Propeller/Products/Products.htm
You can change some constants in eefs.spin to use a different area of the EEPROM.· Change disk_start to $8000 and disk_end to $10000 to use the second half of a 64K EEPROM.· Also, check out the redirection capabilty in cdos.· It will handle commands like the following:
cd /disk1
echo "This is a test" >test1
echo "This is another test" >test2
cat test1 test2 >test3
echo "This is line 3" >>test3
cat test3
I had to stub out references to cfloatstr.spin in clib.spin to get cdos to build.· cfloatstr.spin uses 308 longs.· If I add the line
· fstr : "cfloatstr"
to the end of the OBJ section in cdos.spin if will fail.· If I reduce the size of dummy1 from 368 to 59 it will work OK with 1,508 free longs.· cfloatstr.spin takes up 308 longs plus 1 long in cdos's method/object table.· If the size of dummy1 is greater than 59 longs it will fail.
If I try to add cfloatstr to clib.spin I cannot get it to work.· In theory, it should add the same size to the memory image as it did when I added it to cdos.spin.· However, this will not build even if dummy1 is removed.· As Brad said, it must have something to do with the Spin tool not accounting for duplicate objects correctly.
Dave
Is Parallax ever going to fix it ?
Or has everyone moved on to other toolsets ?
Well, if it's not fixed yet then it probably won't ever be. Parallax is sponsoring the development of a new open source Spin compiler to replace the original closed source compiler.
https://code.google.com/p/open-source-spin-compiler/
The only catch is that it takes (usually) 4 pins to talk to whatever external memory is used, and also, once the program grows it does take longer to download.
Spin programs can now be gigabytes in size!
Dr_Acula, can you point me to a thread that covers this (please save me searching the forum etc) ? Hopefully one that is a step-by-step so I don't have to kill a chunk of time in discovery, evaluating the approach and converting to it. I already have a SD card interfaced, and was eventually going to look into loading operations anyway.
Is there also a thread that evaluates the open source SPIN compiler and the status? Since I'm at a fork in the road, time to evaluate the options.
If possible start a separate forum thread asking questions and describing goals.
Others may have similar concerns and it's easier to find a thread than a few posts in a Google search.
Many here are happy to help.
I do have a separate thread about my project. Won't post it here as not relevant.
I've exhausted propeller resources many times and am sure others have too. I suppose this thread is just as good as any for the problem.
There are different ways to get around the problem. It's probably best for Dr_Acula to talk about works for him. There are different solutions depending on your needs.
I've never seen your thread before now. Sounds like a great topic.
This is a big reason people use bst, IDE, compiler and loader. It filters out unused methods, among other nice features.
The original thread.
It is the one I use 99% of the time, partly because I work on a mac. There is a recent thread about its future or lack thereof. Is-BST-dead. But, I reiterate, it does still work great on most systems.
There is a new SimpleIDE initiated by Jazzed who posted just above, and I just yestereday realized that it can compile spin code as well as C code and also run on a mac. At present it appears to use the bstc compiler. The new Parallax sanctioned compiler that SRLM mentioned above could at some time replace that, but it does not yet have the optimizations.
I have a structured text display which can display to PST or a VT100. So far (in 15 minutes) I haven't figured out what BST's serial terminal uses, if anything. Does it have clear-screen, clear-end-of-line, go-to-position, etc functionality? In the meantime I can use PST...
Moved to thread: http://forums.parallax.com/showthread.php/133731-BST-and-PST?p=1178082&viewfull=1#post1178082