Solved! Go to Solution.
Hi!
This looks like a perfect thread to hijack for my purpose :smileyhappy:
I have the (more or less) exact same problem. Im am on the MC9S08QE128CLH, I do get the L1102: Out of allocation space in segment. And if I uncomment a HUGE constant variable I have, the problem disappear.
So, I tried to switched from small to a banked memory model. What I did was
* Change in CPU bean build options from small to banked
* In edit->Standard settings->Compiler->options->Code generation->memory model = banked
* in the file / libs tab, added ansibim.lib and removed ansiis.lib
* In events.c added
#ifdef ISR_IN_NONBANKED
#pragma push
#pragma CODE_SEG __NEAR_SEG NON_BANKED
#endif
before all my handlers ( should it be before static variables as well? )
and
#ifdef ISR_IN_NONBANKED
#pragma pop
#endif
afterwards.
However I still get the same problem. Btw I am using V6.22 instead. Any suggestions? What have I missed?
Best Regards
Martin
Not sure if reusing threads is a good idea, in general and also as I'm not sure this is the same issue.
The difference in betweem the small and banked memory model is that in the banked model the code
can use the full available flash. However constants are still limited to the non banked area and as you have a huge constant to comment, I wonder if this is the problem.
Anyway, check in the map file how the memory is used currently. Check that the regular code gets placed banked (regular meaning not interrupt handlers, not compiler runtime support and not startup code, just not stuff which has a special purpose to be non banked). Then check if in the remaing non banked memory area the commented constant would fit. Is there enough space for it?
BTW2: How huge is your constant? If >16k then the prm file needs to contain a block of that size.
Daniel
Hi!
I more or less solved my own problem by reusing this thread
in combination with my own instructions above. Im not compleatly sure that the supplied prm.zip will work compleatly on a MC9S08QE128, but for now,atleastmy memory problems are gone.
The constant was about 4K
Best regards
Martin