MC56F84xxx Linker command file when using Quickstart

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MC56F84xxx Linker command file when using Quickstart

1,154 Views
guenter_loettrich
NXP Employee
NXP Employee

Hi all,

 

customer Mile have questions regarding the Linker command file in Codewarrior 10.6 when using the Quickstart stationaries.

Compared to the .cmd file coming from Codewarrior project wizard the generated file from Quickstart looks different:

The colored parts below are not clear for them:

 

MEMORY

{

.p_flash_ROM_vect     (RX)  : ORIGIN = 0x0000,   LENGTH = 0x0200
.p_flash_ROM          (RX)  : ORIGIN = 0x0208,   LENGTH = 0xFdf8

 

###############################

# The internal RAM is physically shared among P-RAM and X-RAM so the user

# has to do partitioning between the two when putting variables. These two

# lines define full memory areas (just for an information, not used for variables). 
.p_all_internal_RAM   (RWX) : ORIGIN = 0x60000, LENGTH = 0x3000

.x_all_internal_RAM   (RW)  : ORIGIN = 0x0000, LENGTH = 0x3000

  
###############################

# the partitioning is made here (0x2fe0 of X-RAM vs. 0x020 of P-RAM)

.p_internal_RAM        (RWX) : ORIGIN = 0x63fe0, LENGTH = 0x0020

.x_internal_RAM         (RW)  : ORIGIN = 0x0001, LENGTH = 0x2fdf

 

# ximage MUST be set same as x_internal_RAM above (with X flag set)

.p_internal_RAM_ximage  (RX)  : ORIGIN = 0x0001, LENGTH = 0x2fdf

.x_onchip_peripherals   (RW)  : ORIGIN = 0xC000, LENGTH = 0x3000

.x_onchip_far           (RW)  : ORIGIN = 0x018000, LENGTH = 0x4798  # 18328 words

.x_EOnCE                (R)   : ORIGIN = 0xFFFF00, LENGTH = 0x0100

}

 

Questions:

What is ".p_internal_RAM" exactly used for?

Why is ".x_internal_RAM" reduced by 0x20?  (LENGTH=0x2fdf instead of 0x3000)

 

 

Thanks for quick help.

 

br

Guenter

Labels (1)
0 Kudos
4 Replies

868 Views
TICS_Fiona
NXP Employee
NXP Employee

Hello Guenter

>>What is ".p_internal_RAM" exactly used for?

Below is extracted from the link command file. Some global variables (.data.char.pmem, .data.pmem)  and application code (pramcode.text) are placed in program flash, and loaded into program RAM.   ‘.p_internal_RAM’ is reserved for this data.

--------------------------------------------------------------------------------------------------------------

   .pmemdata_image :  AT(_datap_ROM_addr)  # data load address is in pFlash

    {

        # __pmem .data sections (init values saved in pROM)

       

        # remember data start so we can copy data later to pRAM

        _datap_RAM_addr = .;

        # the linker does not like empty sections, you can remove this line

        # when you have at least one initialized global __pmem variable in the application

        WRITEH(0xdead);

       

        * (pramcode.text)    # treat pramcode just like initialized __pmem data

        * (.data.char.pmem)

        * (.data.pmem)

        . = . + .%2;

        _datap_RAM_end = .;

        _datap_size = _datap_RAM_end - _datap_RAM_addr;

        # calculate address for next part of pROM data

        _data_ROM_addr = _datap_ROM_addr + _datap_size + 1;

       

    } > .p_internal_RAM

--------------------------------------------------------------------------------------------------------------

>>       Why is ".x_internal_RAM" reduced by 0x20?  (LENGTH=0x2fdf instead of 0x3000)

Program RAM and data RAM are mapped to a single physical flash memory, and .p_internal_RAM has already occupied 0x20 words. 

Best Regards

Fiona Kuang

Technical Information & Commercial Support

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

0 Kudos

868 Views
guenter_loettrich
NXP Employee
NXP Employee

Hi Fiona,

thanks. The sections ".p_internal_RAM" and ".x_internal_RAM" seem to be specific for Quickstart projects.

When looking into the linker file template from Codewarrior without Quickstart then both ranges are missing.

Do you know which information (from QS) is stored in these 0x20 words?

Guenter

0 Kudos

868 Views
TICS_Fiona
NXP Employee
NXP Employee

Hello Guenter

Please see the code extracted above for ".p_internal_RAM". ".p_internal_RAM" is reserved for these three sections: 

  * (pramcode.text)    # treat pramcode just like initialized __pmem data

* (.data.char.pmem)

* (.data.pmem)

"pramcode.text" is for the code that is loaded from flash after DSC starts up, needs to run from RAM, usually is the code for flash operation.

".data.char.pmem" is for the global constants saved in program flash.

".data.pmem" is for the global variables saved in program flash.

Best Regards

Fiona Kuang

Technical Information & Commercial Support

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

0 Kudos

868 Views
johnlwinters
NXP Employee
NXP Employee


Please consult the European team for this question.

0 Kudos