HT-PIC compiler

Aug 25, 2003 4 Replies

Hi,



I'm using the HT-PIC compiler (for the PIC16 family) and encountered a "not enough memory for code psect" linker error. If I remove some bit of code it will compile/link fine. The odd thing is that my code has about 3.5 kwords, far less than my target's total memory. (16F877, 8kwords mem) Any hints?



Thanks,



Henrique Kawakami


I think the lite/free version is limited to only 2048 instructions but you'll need to verify it with their webpage.

Hi.

The trouble must be connected with the memory banking of PICs. Try to reduce the size of your largest functions by dividing to several smaller. Don't forget to watch the stack size.

One time I had a problem when used PIC14000. When my program became only a bit smaller than the memory size of this chip, compiler said the thing a sort of "Project is 7K more than the memory size". My decision was to create the dummy function:

void dummy(void) {

}

and to call it from one or two places of the program. These places was found experimentally.

Regards.

I already splitted the largest funcions, but it doesn't seem to make a difference. I will now try your "dummy function" thing..

Thanks for the help!

Henrique Kawakami

"not

code it

kwords,

"Henrique Kawakami" wrote in news:bidjfc$633$ snipped-for-privacy@aracaju.ic.unicamp.br:

Remember any const or initialized data values also go into the image thus increasing the amount of "code" size. E.g.

const int foo; 'foo' probably takes up sizeof (int) in FLASH int bar = 12; '12' does take up at least one byte in FLASH

- Mark -> --

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required