IAR STM32 函数和变量的绝对地址定位
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
这是.icf文件
/*###ICF### Section handled by ICF editor, dont touch! ****/
/*-Editor annotation file-*/
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
/*-Specials-*/
define symbol __ICFEDIT_intvec_start__ = 0x08004000;
/*-Memory Regions-*/
define symbol __ICFEDIT_region_ROM_start__ = 0x08004000;
define symbol __ICFEDIT_region_ROM_end__ = 0x08020000;
define symbol __ICFEDIT_region_RAM_start__ = 0x20000000;
define symbol __ICFEDIT_region_RAM_end__ = 0x2000BFFF;
/*-Sizes-*/
define symbol __ICFEDIT_size_cstack__ = 0x400;
define symbol __ICFEDIT_size_heap__ = 0x200;
/**** End of ICF editor section. ###ICF###*/
define memory mem with size = 4G;
define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
initialize by copy { readwrite };
do not initialize{ section .noinit };
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
place at address mem:0x08017000 { readonly section .sendstr};
place at address mem:0x08018500 { readonly section .MYSEG};
place at address mem:0x08018000 { section .text object test.o };
place in ROM_region { readonly };
place in RAM_region { readwrite,
block CSTACK, block HEAP };
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
main.c
/* Includes ------------------------------------------------------------------*/
//#include "stm32f10x.h"
#include "string.h"
#include "stdio.h"
void sendstr(unsigned *buf,unsigned shortlen) @".sendstr"
{
}
extern void test(void);
extern void main1(void);
int main(void)
{
test();
}
#ifdefUSE_FULL_ASSERT
/**
* @briefReports the name of the source file and the source line number
* where the assert_param error has occurred.
* @paramfile: pointer to the source file name
* @paramline: assert_param error line source number
* @retval None
*/
void assert_failed(uint8_t* file, uint32_t line)
{
/* User can add his own implementation to report the file name and line number,
ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
/* Infinite loop */
while (1)
{
}
}
#endif
/**
* @}
*/
/**
* @}
*/
/******************* (C) COPYRIGHT 2010 STMicroelectronics *****END OF FILE****/
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test.c
//__no_init char array1[100]@0x2000B000;
//char array1[100];
const char str1[8]@".MYSEG"="test11!!";
const char str2[8]@".MYSEG"="test66!!";
int f1(int a,int b);
void test(void)// @".test" //MYSEGMENT段可在XCL中开辟
{
char arrayx[150];
char array1[150];
int i,a,b,c;
for (i=0;i<8;i++){
array1[i]=str1[i];
arrayx[i]=str2[i];
}
a=1;
b=2;
c=f1(a,b);
for (i=0;i
sendstr(arrayx,8);
}
}
int f1(int a,int b){
if(a>0){
return (a+b)*1;
}
else return 0;
}
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
对于你的第三点,cortex和其他arm处理器都提供了一种特殊的中断 |
IARSTM32函数变量绝对地 相关文章:
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)