How to write the function to a specific address in the flash?

Viewed 44

I want to write a library to a specific address in the flash, I have a entire sector for this, than I will calculate crc16 value of that library, I tried to add a new section in linker file but it couldn't work. i am using Atollic Truestudio as IDE and stm32f4 as mcu.

MEMORY  
{  
  FLASH(rx) =             : ORIGIN = 0x08020000, LENGTH = 2048K  
  IP_CODE(x) =            : ORIGIN = 0x08060000, LENGTH = 256K  
  MY_FUNCTION(rxw) =      : ORIGIN = 0x080C0000, LENGTH = 128K//section for the library  
  RAM(rxw) =              : ORIGIN = 0x20000000, LENGTH = 192K  
  MEMORY_B1(rx) =         : ORIGIN = 0x60000000, LENGTH = 0K  
  CCMRAM(rx) =            : ORIGIN = 0x10000000, LENGTH = 64K  
}  
  
SECTIONS  
{  
   
.isr_vector :  
{  
 .=ALIGN(4);  
KEEP(*(.isr_vector))  
.ALIGN(4);  
} >FLASH  
  
.text:  
{  
 .ALIGN(4);  
*(.text)  
*(.text*)  
*(.glue_7)  
*(.glue_7t)  
*(.eh_frame)  
  
KEEP(*(.init))  
KEEP(*(.fini))  
  
.=ALIGN(4);  
_etext=.;  
} >FLASH  
  
.mysection :  
{  
 .= ALIGN(4);  
 KEEP(*(.mysection*))  
} >MY_FUNCTION  

.  
.  
.  so on..
.  
.  
}
0 Answers
Related