HC08, CodeWarrior for Microcontrollers v6.3, IDE version 5.9.0 build 5292.
Using Start08.c, .prm file for project includes a "COPY" (segment? org?) in the placement section.
What do I need to change in order to allow static variables in my functions to be initialized. I'm trying to get a cross-platform library working on this target, and really need to make use of static variables if at all possible.
I'm an experienced C and embedded programmer, but very green with CodeWarrior and Freescale. Explicit instructions without too many abbreviations (WTF does feeding the COP mean in Start08.c?) appreciated.
I was given a skeleton project file as a starting point, since it's sharing the flash with a bootloader and some shared data, so using the Project Wizard is likely out of the question.
Here are the SEGMENTS and PLACEMENT sections of my .prm file:
SEGMENTS /* Here all RAM/ROM areas of the device are listed. Used in PLACEMENT below. */ Z_RAM = READ_WRITE 0x0080 TO 0x00FF; FLASH_RAM = READ_WRITE 0x0100 TO 0x01FF; /* Reserved for flash code that executes in RAM */ SHARED_RAM = NO_INIT 0x0200 TO 0x0215; /* Used to send data between bootloader and application */ RAM = READ_WRITE 0x0216 TO 0x087F; /* The rest of RAM */ /* Application areas */ APP_RESERVED = READ_ONLY 0x8000 TO 0x83FF; /* 1KB storage for app - never touched by BL */ APP_VER_DATA = READ_ONLY 0x8400 TO 0x841F; APP_FLASH_ROM = READ_ONLY 0x8420 TO 0x850F RELOCATE_TO 0x100; APP_ROM = READ_ONLY 0x8510 TO 0xF1BB; APP_VERSION = READ_ONLY 0xF1BC TO 0xF1BF; /* 4 byte pointer to app version string */ APP_IVT = READ_ONLY 0xF1C0 TO 0xF1FD; /* Application Interrupt Vector Table */ APP_START = READ_ONLY 0xF1FE TO 0xF1FF; /* Application start address */ /* Bootloader (BL) areas */ FLASH_ROM = READ_ONLY 0xF200 TO 0xF2EF RELOCATE_TO 0x100; /* Flash routines that get copied to RAM */ BOOTLOADER = READ_ONLY 0xF2F0 TO 0xFFA9; /* Bootloader ROM area */ BL_VERSION = READ_ONLY 0xFFAA TO 0xFFAD; /* 4 byte pointer to BL version number */ENDPLACEMENT SHARED_DATA INTO SHARED_RAM; _DATA_ZEROPAGE, /* zero page variables */ MY_ZEROPAGE INTO Z_RAM; FAR_RAM, /* non-zero page variables */ DEFAULT_RAM INTO RAM; APPLICATION_VERSION INTO APP_VER_DATA; FLASH_ROUTINES INTO APP_FLASH_ROM; _PRESTART, STARTUP, /* startup data structures */ ROM_VAR, /* constant variables */ STRINGS, /* string literals */ VIRTUAL_TABLE_SEGMENT, /* C++ virtual table segment */ DEFAULT_ROM, COPY INTO APP_ROM; /* copy down information: how to initialize variables */ END
Thanks in advance for any guidance.