Initialize static data (something like spin DAT)
ctwardell
Posts: 1,716
What is the proper way to initialize static data that will go in the HUB?
I have a lookup table of 256 longs.
Building an array and explicitly assigning the values would work, but that seems inefficient.
What I would like is to have it already in place in the EEPROM image and just have a pointer to it, but I don't know how to accomplish that.
Thanks,
C.W.
I have a lookup table of 256 longs.
Building an array and explicitly assigning the values would work, but that seems inefficient.
What I would like is to have it already in place in the EEPROM image and just have a pointer to it, but I don't know how to accomplish that.
Thanks,
C.W.
Comments
Did you see the example in one of todays threads?
You can put cogc driver code into EEPROM automatically with propeller-load using the ecogc extension, but I've never tried making a data table with it - maybe it could be done. The code would be put into a buffer that can be loaded from eeprom similar to the cog_loader example in the demos.
--Steve
I think between your two replies I see what I need to try.
C.W.
This is for the COSMACog stuff.
We worked out the " __stack_end" setting for LMM earlier this year, I'm using that to reserve space at the top of the HUB for Mailboxes and now Lookup Tables that will remain in place for the emulator cogs to use. Once the GCC LMM loader program loads the cogs and sets up Mailboxes and LUT's it will be wiped out and its code code space re-used as general purpose RAM.
The issue I'm trying to work around is getting the LUT's into the space above __stack_end without either copying data or a bunch of manual address manipulation in the loader.
I know I can specify an address for a variable, and I've been doing that so far, but it seems to "manual" to me. When the various COSMACog "objects" are complete I want users to be able to mix and match as set of objects to build a "system". I'm afraid all the manual address manipulation will be an impedement to success for many users.
What I'd like to have is a GCC segment defined ABOVE __stack_end that grows upward as I put variables in it.
So...can I set a start address for the HEAP?
If so can I use an attribute like Steve mentioned for forcing variables into the TEXT section and then put both initialized and uninitialized variables on the HEAP using the attribute?
Thanks,
C.W.
Is there a EGOCS or something like that that let's you create an ECOG using assembler instead C?
I'd like the "ECOG Advantage (tm)" of having the images above 32k, but with assembler created cog code instead of C.
Thanks,
C.W.
An example of this might be useful. How would gas end up in EEPROM automatically?
Just put something like this at the start of the GAS souirce file:
P.S. I'm glad to see we have some Makefile users out there. I was beginning to think that no one was going to use PropGCC except with SimpleIDE. :-)
Thanks!
One of those things that is really simple, once someone shows you how.
C.W.
I'm just going to put the cog images in EEPROM, that frees up enough space in the lower 32k so that the data issue goes away.
I'm trying to make everything in the COSMACog project as standard as possible using PropGCC as way of showing a project using C code, GAS code, etc.
Everthing in the emulator iteself will be GAS, the loader program will be in C.
C.W.