프로그램 컴파일 후 링크 스크립트의 변수 가져오기

6273 단어 구동
sct 파일: 각 세그먼트가 메모리에 분배되는 경우, 매번 컴파일된 후
	extern unsigned int Image$$ER_IROM1$$Base;
	extern unsigned int Image$$ER_IROM1$$Limit;
	extern unsigned int Image$$ER_IROM1$$Length;   
	
	extern unsigned int Image$$RW_IRAM1$$Base;
	extern unsigned int Image$$RW_IRAM1$$Limit;
	extern unsigned int Image$$RW_IRAM1$$Length;     
	
	extern unsigned int Image$$RW_IRAM1$$ZI$$Base;
	extern unsigned int Image$$RW_IRAM1$$ZI$$Limit;
	extern unsigned int Image$$RW_IRAM1$$ZI$$Length;    
	
	
	unsigned int base,limit,length;
	base = (unsigned int )&Image$$ER_IROM1$$Base;
	limit = (unsigned int )&Image$$ER_IROM1$$Limit;
	length = (unsigned int )&Image$$ER_IROM1$$Length;
	printf("
ER_IROM1 Base = 0x%x
ER_IROM1 Limit = 0x%x
ER_IROM1 Length = %d
"
,base,limit,length); base = (unsigned int )&Image$$RW_IRAM1$$Base; limit = (unsigned int )&Image$$RW_IRAM1$$Limit; length = (unsigned int )&Image$$RW_IRAM1$$Length; printf("
RW_IRAM1 Base = 0x%x
RW_IRAM1 Limit = 0x%x
RW_IRAM1 Length = %d
"
,base,limit,length); base = (unsigned int )&Image$$RW_IRAM1$$ZI$$Base; limit = (unsigned int )&Image$$RW_IRAM1$$ZI$$Limit; length = (unsigned int )&Image$$RW_IRAM1$$ZI$$Length; printf("
RW_IRAM1_ZI Base = 0x%x
RW_IRAM1_ZI Limit = 0x%x
RW_IRAM1_ZI Length = %d
"
,base,limit,length);
Image$$ER_IROM1$$Length : CODE  RO_data    
Image$$RW_IRAM1$$Length : RW_data    
Image$$RW_IRAM1$$ZI$$Length : ZI_data    

좋은 웹페이지 즐겨찾기