Minidragon C code limit /Codewarrior serialmonitor

Started by jeff...@bendnet.com January 19, 2011
Hello,
I am using a Minidragon plus2 with mixed C & assembly as shown in the book:
"Learning C by example" & have seemingly run into the max C code limit.

Using special edition version of Codewarrior with serial monitor
My C code is growing & now now during flash programming at approx 14210 bytes size the Hiwave debugger indicates:
Link Error : L1102: Out of allocation space in segment ROM_C000 at address 0xF769 Link Error : Link failed
F769 is 63337 decimal!!
What is the general procedure to get the full 32K limit

Thanks
Jeff Morrison
Bend Oregon
j...@bendnet.com
Hi

You need either use banked memory model, or edit *.prm file. For some reason
if you specify small memory model, only ROM_C000 segment is used for
constants and code placement. Find where ROM_4000 is commented out and
uncomment it. Also enable compiler switch which is specified there in prm
file.

Edward

----- Original Message -----
From:
To: <6...>
Sent: Wednesday, January 19, 2011 2:41 AM
Subject: [68HC12] Minidragon C code limit /Codewarrior serialmonitor
> Hello,
> I am using a Minidragon plus2 with mixed C & assembly as shown in the
> book:
> "Learning C by example" & have seemingly run into the max C code limit.
>
> Using special edition version of Codewarrior with serial monitor
> My C code is growing & now now during flash programming at approx 14210
> bytes size the Hiwave debugger indicates:
> Link Error : L1102: Out of allocation space in segment ROM_C000 at
> address 0xF769 Link Error : Link failed
> F769 is 63337 decimal!!
> What is the general procedure to get the full 32K limit
>
> Thanks
> Jeff Morrison
> Bend Oregon
> j...@bendnet.com
>
Thanks Edward,
In the file serial monitor linker.prm I was able to find the ROM_4000 area & change it, but am not sure about how to use the compiler option "-OnB=b" specified in the same file.
Im in CW/ edit / HCS12 serialmonitor settings /compiler for HC12.
I dont see anywhere to select anything to creat option: -OnB=b

Where is this option set?

Interestingly enough, I can now go to 16K before running out of memory - just changing the ROM_4000
Jeff

Standard settings->Compiler. You should see compiler command line switches
string. Copy paste this -OnB=b to the end of this string. Make sure to
insert space before "-".

Edward

----- Original Message -----
From:
To: <6...>
Sent: Wednesday, January 19, 2011 10:37 PM
Subject: [68HC12] Re: Minidragon C code limit /Codewarrior serialmonitor
> Thanks Edward,
> In the file serial monitor linker.prm I was able to find the ROM_4000 area
> & change it, but am not sure about how to use the compiler option "-OnB=b"
> specified in the same file.
> Im in CW/ edit / HCS12 serialmonitor settings /compiler for HC12.
> I dont see anywhere to select anything to creat option: -OnB=b
>
> Where is this option set?
>
> Interestingly enough, I can now go to 16K before running out of memory -
> just changing the ROM_4000
> Jeff
>
>
Alright the compiler option is in.
I can fill the program up with bloat (strings) till it fails at"

Link Error : L1102: Out of allocation space in segment ROM_4000 at address 0x7FED Link Error : Link failed (32,749) is this the actual code size trying to load to the flash?
If I reduce the code by 1 byte, there is no link error, but Hiwave reports 16,386 loaded. Im a bit confused. Oh well, its probably enough to finish!

Thank you Edward.

Jeff

Since there are two pieces of memory, 16k @4000 and 16k at $c000, no object
can be bigger than 16k. Try defining two big strings. Keep in mind that
linker will not link unused objects, so both string objects should be
referenced from your code.

Edward

----- Original Message -----
From:
To: <6...>
Sent: Thursday, January 20, 2011 9:22 AM
Subject: [68HC12] Re: Minidragon C code limit /Codewarrior serialmonitor
> Alright the compiler option is in.
> I can fill the program up with bloat (strings) till it fails at"
>
> Link Error : L1102: Out of allocation space in segment ROM_4000 at
> address 0x7FED Link Error : Link failed (32,749) is this the actual
> code size trying to load to the flash?
> If I reduce the code by 1 byte, there is no link error, but Hiwave reports
> 16,386 loaded. Im a bit confused. Oh well, its probably enough to finish!
>
> Thank you Edward.
>
> Jeff
>
>
Special edition limit message is different.

Edward

----- Original Message -----
From: "Edward Karpicz"
To: <6...>
Sent: Thursday, January 20, 2011 12:54 PM
Subject: Re: [68HC12] Re: Minidragon C code limit /Codewarrior serialmonitor
> Since there are two pieces of memory, 16k @4000 and 16k at $c000, no
> object can be bigger than 16k. Try defining two big strings. Keep in mind
> that linker will not link unused objects, so both string objects should be
> referenced from your code.
>
> Edward
>
> ----- Original Message -----
> From:
> To: <6...>
> Sent: Thursday, January 20, 2011 9:22 AM
> Subject: [68HC12] Re: Minidragon C code limit /Codewarrior serialmonitor
>> Alright the compiler option is in.
>> I can fill the program up with bloat (strings) till it fails at"
>>
>> Link Error : L1102: Out of allocation space in segment ROM_4000 at
>> address 0x7FED Link Error : Link failed (32,749) is this the
>> actual code size trying to load to the flash?
>> If I reduce the code by 1 byte, there is no link error, but Hiwave
>> reports 16,386 loaded. Im a bit confused. Oh well, its probably enough
>> to finish!
>>
>> Thank you Edward.
>>
>> Jeff
>>
>>