Re: static initializer
"murphynetuk" <[email protected]>
| Newsgroups | gmane.comp.hardware.motorola.microcontrollers |
|---|---|
| Message-ID | <[email protected]> |
The .map file is created in the same location as your .elf which is specified in your target settings in CW. The map file for the 86kb compile put most of the .text section outside the MPC555 memory range too, so you would have trouble as soon as you called any of those functions. Unfortunately I don't know how to get the linker to raise a warning when you exceed a memory limit, if anyone does I would be grateful for this info. I use a linker configuration file (.lcf) to explicitly locate data structures in memory. That way I can persist data between resets. The linker will flag up a warning if the sections overlap because they are too large. I place the data at the end of RAM, so if the code is too big I get the warning. I suggest you have a good long read of the documentation regarding .lcf, .map files and linking in general. It will be worth it. Ian --- In [email protected], "coles555" <coles555@y...> wrote: > > I think you are right about the PB board not having enough memory for > C++ code. But it's wierd that only _ctors and _dtors are ones outside > of memory range. Everything else seems to be within bound when I view > the global variables address. > > Lei > > --- In [email protected], "murphynetuk" <murphynetuk@y...> wrote: > > > > > > > > As Ian is implying, converting to C instead of C++ may be your only > > hope ... but > > > you can try things like removing formatter and stream library calls > > from your > > > code (which are implicit with C++ rather than explicit with C). > > > > > > Randall > > > > > > > Commenting out the <iostream> stuff took it down to 2.2kb. > > Replacing it with printf took it back up to 16kb. > > > > And there was I thinking that printf was bloated... > > > > Ian > > > ------------------------ Yahoo! Groups Sponsor --------------------~--> Most low income households are not online. Help bridge the digital divide today! http://us.click.yahoo.com/cd_AJB/QnQLAA/TtwFAA/dN_tlB/TM --------------------------------------------------------------------~-> ----------------------------------------------------------- To learn more about Freescale Microcontrollers, please visit http://www.freescale.com/mcu Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/MPC500/ <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/