The error is the following
"Can't find 0x58 words for psect rbss_0 in segment BANK0 (error)"
Think its something to do with writing too many strings with too many characters so there isnt enough space, if so is there a way to clear a string after using it. Im thinking of making the string = "" but dont think thats very proffesional, not that im a pro at this or anything.
Ok, im using the following compiler. "HI-TECH PICC COMPILER (Microchip PIC) V8.02 PL1". I had intitially character of the following form:-
char INTRO[] ="fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff";
What i was doing before in which it was giving me the error "Can't find 0x58 words for psect rbss_0 in segment BANK0 (error)". Is that when i make that Char INTRO[] a bit bigger or intialise another char variable of a form like this for example
char INTRO1[] = "EE";
it gives that error, iv been reading about and found that you could do RUN-TIME Storage allocaion in which you can allocate and free memory. Is this possible when using a PIC. I have somehting like this in my funciton but the compiler is giving me error.
the syntax is correct but this will only allocate one byte in the memory allocated by the ponter INTRO. you can't put more than one character in it, and putting string in it will cause you a run-time error.
you can do manual adjustment. by doing something like this.
Code:
#define MY_CHAR_POINTER_BYTE_SIZE 20
char *INTRO=NULL;
// allocate 20 bytes
INTRO = malloc( (sizeof(char)) * MY_CHAR_POINTER_BYTE_SIZE );
// this is a must, check if memory allocation is succesful
if(INTRO==NULL)
// dynamic memory allocation failed
btw, how big is the RAM of the PIC you are using and what PIC is it?
Big computer people are really tiresome when they come to swim in the microcontroller pond and bemoan the loss of their favoite resources. Go back up to the big machines where you belong.
IIRc the error you state comes from either not having enough RAM available, or not having enough RAM to put a variable structure in one memory bank.
Memory is most often automatically divvied up as an Overlay. This only works when you declare the variables inside a code block (a "{...}"). The compiler looks for which code blocks cannot be active at the same time and may reuse the same memory for more than one block's variables.
char INTRO1[] = "EE";
May be unwise. How big a space do you want to reserve for "INTRO1[]"?
Actually I don't know how much space the compiler interprets this as, I think just 3. If you later assigned more- like INTRO1="This is my String"; then the code will assign to RAM that wasn't reserved for it and may contain other variables. This is typically very effective.
The is no way for the core to perform memory management. You can under some instances manually manage memory reuse, for example if you globally declare a 256 byte array you could place variables inside the array's space whenever and whereever you want. Of course it is easy to make a mistake and use a byte for a new variable when the old one in that spot is still needed, there is no way to automatically detect this at compile, link, or run time.