Using CodeWarrior 6.2 on a Coldfire V1 core.
I am very new to CW ...
I am having a problem using CodeWarrior to set up memory segment that I require in the .LCF file.
Using PE (Processor Expert), I did manage to set aside an area of RAM and call it "myram". However, I cannot find the proper way to place my buffer into this area. CodeWarrior always makes the data <userram> and places it in “ .sbss “ section, thus it is initiated at start up / reset. I spent many hours reading but could not find the right procedure to get CodeWarrior to generate this section(below) in the .LCF file. ( I even tried modifying startup.c, but no luck)
This is my work around, which I would like to avoid.
Here is the what I have to do after each startup of CodeWarrior ,
- I first compile the program , CW has an error, ...unresloved reference
- I then edit the “.lcf “ file and paste in “ the 'Myram' section below”. I place it before .custom
- Then I compile again, all address are resolved,
- This memory area is placed after the <useram> area and never gets initialized, ( Obviously it gets over-written if use new memory in the code. This is acceptable, Having an Origin using the PE would have been great but as mentioned above I could not find the proper syntax) I initialize this area in the code. This is for testing code. ( This information will be from another device on Rev 2 of the my PCB)
In one of the 'C' modules ….
- Here is the staemnt that I use place my Default_Parameters..
#pragma define_section data_type ".myram" far_absolute RW
__declspec (data_type) unsigned char DEF_PARAM_buf;
#pragma DATA_SEG DEFAULT
I then open up the LCF and place the following into it
>>>This is what I would like CodeWarrior to create for m <<<<
___MYRAM_START = .;
__START_MYRAM = .;
. = ALIGN (0x4);
__END_MYRAM = .;
___MYRAM_END = .;
. = ALIGN(0x4);
} >> userram
I have attached a jpg of the LCF placement position and the resulting MAP output.
Their must be a way to do this using CW. I only have to edit this at the start of each day/ or a CW Restart.
Any help will be appreciated.