56F84xx_Program_in_FLEXNVM

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

56F84xx_Program_in_FLEXNVM

56F84xx_Program_in_FLEXNVM

This project is an example of using the DSC CodeWarrior linker to place code

in a different area of memory.  In this case, the FlexNVM flash block is used.

The example uses three different methods in the linker command file to force

specific code to a different memory segment, see examples below.  For more

information on the linker syntax, see the manual installed with CodeWarrior

at \CW MCU v10.6.x\MCU\Help\PDF\MCU_DSC_Compiler.pdf

 

 

This project was developed for the TWR-56F8400 Tower development board, using

CodeWarrior for Microcontrollers v10.6.6.  The project was created using

Processor Expert, and blinks an LED using the PIT timer interrupt.

 

 

The linker command file is located at

\Project_Settings\Linker_Files\FLASH_SDM.cmd.Here are the key changes to the

project:

 

 

MEMORY {

        # Added .p_FlexNVM memory segment

        .p_FlexNVM(RWX) : ORIGIN = 0x00068000, LENGTH = 0x00004000

}

 

 

# Added .FlexNVM_Code memory section

.FlexNVM_Code :

{

  TI1_c.obj (.text) # Place whole source file in this section

  OBJECT (FPE_low_level_init, cpu_c.obj) # Place individual function in this section

  * (FlexNVM_code.text) # Place from section defined in source code, see main.c

 

 

} > .p_FlexNVM

 

 

and in main.c:

#pragma define_section FlexNVM_code "FlexNVM_code.text"  RX

#pragma section FlexNVM_code begin

void main(void)

{

  /* Write your code here */

}

#pragma section FlexNVM_code end

Labels (1)
Attachments
No ratings
Version history
Last update:
‎05-12-2016 04:40 PM
Updated by: