cmd파일, 커맨드 파일이라고 하는것 같다.
그 구조를 뜯어보면 아래처럼 되어있다.
/*
// TI File $Revision: /main/3 $
// Checkin $Date: April 23, 2007 09:09:27 $
//###########################################################################
//
// FILE: F2812_EzDSP_RAM_lnk.cmd
//
// TITLE: Linker Command File For F2812 eZdsp examples that run out of RAM
// This linker file assumes the user is booting up in Jump to H0 mode
//
//###########################################################################
// $TI Release: DSP281x C/C++ Header Files V1.20 $
// $Release Date: July 27, 2009 $
//###########################################################################
*/
/* ======================================================
// For Code Composer Studio V2.2 and later
// ---------------------------------------
// In addition to this memory linker command file,
// add the header linker command file directly to the project.
// The header linker command file is required to link the
// peripheral structures to the proper locations within
// the memory map.
//
// The header linker files are found in <base>\DSP281x_Headers\cmd
//
// For BIOS applications add: DSP281x_Headers_BIOS.cmd
// For nonBIOS applications add: DSP281x_Headers_nonBIOS.cmd
========================================================= */
/* ======================================================
// For Code Composer Studio prior to V2.2
// --------------------------------------
// 1) Use one of the following -l statements to include the
// header linker command file in the project. The header linker
// file is required to link the peripheral structures to the proper
// locations within the memory map */
/* Uncomment this line to include file only for non-BIOS applications */
/* -l DSP281x_Headers_nonBIOS.cmd */
/* Uncomment this line to include file only for BIOS applications */
/* -l DSP281x_Headers_BIOS.cmd */
/* 2) In your project add the path to <base>\DSP281x_headers\cmd to the
library search path under project->build options, linker tab,
library search path (-i).
/*========================================================= */
MEMORY
{
PAGE 0 :
/* For this example, H0 is split between PAGE 0 and PAGE 1 */
/* BEGIN is used for the "boot to HO" bootloader mode */
/* RESET is loaded with the reset vector only if */
/* the boot is from XINTF Zone 7. Otherwise reset vector */
/* is fetched from boot ROM. See .reset section below */
RAMM0 : origin = 0x000000, length = 0x000400
BEGIN : origin = 0x3F8000, length = 0x000002
PRAMH0 : origin = 0x3F8002, length = 0x001FFE
RESET : origin = 0x3FFFC0, length = 0x000002
PAGE 1 :
/* For this example, H0 is split between PAGE 0 and PAGE 1 */
RAMM1 : origin = 0x000400, length = 0x000400
RAML1 : origin = 0x009000, length = 0x001000 /* on-chip RAM block L1 */
/* DRAMH0 : origin = 0x3f9000, length = 0x001000 */
}
SECTIONS
{
/* Setup for "boot to H0" mode:
The codestart section (found in DSP28_CodeStartBranch.asm)
re-directs execution to the start of user code.
Place this section at the start of H0 */
codestart : > BEGIN, PAGE = 0
ramfuncs : > PRAMH0 PAGE = 0
.text : > PRAMH0, PAGE = 0
.cinit : > PRAMH0, PAGE = 0
.pinit : > PRAMH0, PAGE = 0
.switch : > RAMM0, PAGE = 0
.reset : > RESET, PAGE = 0, TYPE = DSECT /* not used, */
.stack : > RAMM1, PAGE = 1
.ebss : > RAML1, PAGE = 1
.econst : > RAML1, PAGE = 1
.esysmem : > RAML1, PAGE = 1
}
역할을 메모리 영역에 구조체를 배치해 준다는것 같다,
예를들어 abc라는 구조체를 DSP의 0x12345라는 주소에 집어넣고자 한다면
본 소스에 선처리 잡업 코드로
#pragma Data_SECTION(abc,"ABC");
를 해주고
커맨드 파일 내의 SECTION안에
SECTION{
...
ABC : >ASDF, PAGE = 1
...
}
MEMORY{
PAGE 1:
...
ASDF : origin = 0x12345, length = 0x1000
...
}
위와같이 해주면 ASDF라는 메모리 영역이 0x12345 에서 시작하여 0x1000의 크기를 갖으며
ABC로 이름붙여진 abc구조체가 그 영역에 들어가게 된다.
이러한 MEMORY{} 구간의 정의들은 DSP메모리맵을 기준으로 할당된다. 따라서 자신이 사용하는 DSP에 맞는 cmd파일을 적용하도록 하자.
이 설정은 properties의 General의 맨 하단의 두번째의 메뉴인 Linker command file을 통해서 링크 시킬 수 있다.
'TMS320 > Study' 카테고리의 다른 글
[28346]부트와 간단한 예제 (0) | 2014.07.22 |
---|---|
[28346]작업환경 구성하기 (0) | 2014.07.21 |
rts2800_xxx.lib (0) | 2014.07.17 |
GlobalVariableDefs.c (0) | 2014.07.17 |
TMS UserGuide (0) | 2014.07.17 |