cmd文件中各种存贮器大小改怎么确定?
我们在写cmd文件时,memery中各需要命名的存贮器,大小怎么确定?sectons中需要那些段名,他们的长度怎么定?
MEMORY
{
PAGE 0:
VECS: origin=00h, length=040h
FLASH1: origin=044h, length=07000h
FLASH2: origin=7044h, length=0FBCh
PAGE 1:
B2: origin=00060h, length=00020h
B0: origin=00200h, length=00100h
B1: origin=00300h, length=00100h
SARAM: origin=00800h, length=00800h
}
SECTIONS
{
.text: > FLASH1 PAGE 0 /* initialized */
.cinit: > FLASH1 PAGE 0 /* initialized */
.const: > FLASH2 PAGE 0 /* initialized */
.switch: > FLASH1 PAGE 0 /* initialized */
.ext_bss: > B0 PAGE 1 /* uninitialized */
.stack: > SARAM PAGE 1 /* uninitialized */
.sysmem: > B1 PAGE 1 /* uninitialized */
.vectors: > VECS PAGE 0 /* initialized */
.bss: > SARAM PAGE 1
.disp_const: > B1 PAGE 1
}
就是问上面memery中flash1,f\'lash2,他们的大小,命名的规则,sections中,.text,.cinit,.const的等类似的需要定义哪些?他们该放在什么位置?
可以参照相应的DSP内部的程序,数据以及IO空间的地址分配进行修改
一般中断向量放在开始
要执行的程序放在FLASH中就可以
其它用不到的空间不设置也行
我也是这个问题,就是一段程序占多大的空间怎么计算?
看项目文件里的*.map文件,里面有的。
起始空间,占多大。都一清二楚的。希望大家能看明白。
有了它,你就好改地址空间分配了。
看下面的map例子
******************************************************************************
TMS320C1x/C2x/C2xx/C5x COFF Linker Version 7.00
******************************************************************************
>> Linked Fri Feb 28 01:35:47 2003
OUTPUT FILE NAME: <example_c.out>
ENTRY POINT SYMBOL: \"_c_int0\" address: 000080f5
MEMORY CONFIGURATION
name origin length used attributes fill
-------- -------- --------- -------- ---------- --------
PAGE 0: VECS 00000000 000000040 00000040 RWIX
FLASH 00000044 000007fbc 00000007 RWIX
SARAMPRO 00008000 000000800 0000016c RWIX
EXTPROG 00008800 000008000 00000000 RWIX
PAGE 1: B2 00000060 000000020 00000000 RWIX
B0 00000200 000000100 00000026 RWIX
B1 00000300 000000100 00000000 RWIX
SARAMDAT 00000800 000000800 00000400 RWIX
EXTDATA 00008000 000008000 00000000 RWIX
SECTION ALLOCATION MAP
output attributes/
section page origin length input sections
-------- ---- ---------- ---------- ----------------
.text 0 00008000 0000016c
00008000 000000f5 example_c.obj (.text)
000080f5 00000000 cvectors.obj (.text)
000080f5 00000027 rts2xx.lib : boot.obj (.text)
0000811c 00000050 : exit.obj (.text)
.const 1 00000300 00000000 UNINITIALIZED
.bss 1 00000200 00000026 UNINITIALIZED
00000200 00000022 rts2xx.lib : exit.obj (.bss)
00000222 00000000 cvectors.obj (.bss)
00000222 00000000 rts2xx.lib : boot.obj (.bss)
00000222 00000004 example_c.obj (.bss)
.stack 1 00000800 00000400 UNINITIALIZED
00000800 00000000 rts2xx.lib : boot.obj (.stack)
.sysmem 1 00000200 00000000 UNINITIALIZED
vectors 0 00000000 00000040
00000000 00000040 cvectors.obj (vectors)
.data 1 00000000 00000000 UNINITIALIZED
00000000 00000000 example_c.obj (.data)
00000000 00000000 rts2xx.lib : exit.obj (.data)
00000000 00000000 : boot.obj (.data)
00000000 00000000 cvectors.obj (.data)
.cinit 0 00000044 00000007
00000044 00000006 rts2xx.lib : exit.obj (.cinit)
0000004a 00000001 --HOLE-- [fill = 0000]
GLOBAL SYMBOLS
address name address name
-------- ---- -------- ----
00000200 .bss 00000000 .data
00000000 .data 00000000 edata
00008000 .text 00000044 cinit
00008169 C$$EXIT 00000200 .bss
00000400 __STACK_SIZE 00000201 __cleanup_ptr
00000201 __cleanup_ptr 00000222 _p_ram
00008169 _abort 00000223 _a
00000223 _a 00000224 _b
0000814a _atexit 00000225 _d_ram
00000224 _b 00000226 end
000080f5 _c_int0 00000400 __STACK_SIZE
00000225 _d_ram 00008000 _main
0000802c _data_ram_check 00008000 .text
0000811c _exit 0000802c _data_ram_check
00008000 _main 0000809d _prog_ram_check
00000222 _p_ram 000080f5 _c_int0
0000809d _prog_ram_check 0000811c _exit
00000044 cinit 0000814a _atexit
00000000 edata 00008169 _abort
00000226 end 00008169 C$$EXIT
0000816c etext 0000816c etext
ffffffff pinit ffffffff pinit
[22 symbols]