买了一块开发板,商家没有技术支持,特来咨询TI工程师,型号是TMS320VC5509A PGE封装。
下图是商家给的历程中的CMD文件和DSP存储空间示意图,CMD文件中的P_VECT是存放中断向量表的吧,这样的话和PAGE1中的数据存储区不是重叠了吗,为什么这样分配空间?还有P_VECT段同时占用了DARAM和SARAM,这样也可以吗?
Tony Tang:
请参考文档spru280h第303d页,page之间可以重叠,当然要自己保证是有效的内存,说实话,我也不觉得有分page的必要,连续分配就好了(当然可能上面的作者有什么特殊想法,我们没有领会)。
PAGE
identifies a memory space. You can specify up to 255 pages,depending on your configuration; usually, PAGE 0 specifiesprogram memory, and PAGE 2 specifies peripheral memory. If youdo not specify a PAGE, the linker acts as if you specified PAGE 0.Each PAGE represents a completely independent address space.Configured memory on PAGE 0 can overlap configured memoryon PAGE 2.
比如下面的C5509的cmd我觉得挺清楚的:
MEMORY{ PAGE 0:
MMR : origin = 0000000h, length = 00000c0h SPRAM : origin = 00000c0h, length = 0000040 DARAM0 : origin = 0000100h, length = 0003F00h DARAM1 : origin = 0004000h, length = 0004000h DARAM2 : origin = 0008000h, length = 0004000h DARAM3 : origin = 000c000h, length = 0004000h
SARAM0 : origin = 0010000h, length = 0004000h SARAM1 : origin = 0014000h, length = 0004000h SARAM2 : origin = 0018000h, length = 0004000h SARAM3 : origin = 001c000h, length = 0004000h SARAM4 : origin = 0020000h, length = 0004000h SARAM5 : origin = 0024000h, length = 0004000h SARAM6 : origin = 0028000h, length = 0004000h SARAM7 : origin = 002c000h, length = 0004000h SARAM8 : origin = 0030000h, length = 0004000h SARAM9 : origin = 0034000h, length = 0004000h SARAM10 : origin = 0038000h, length = 0004000h SARAM11 : origin = 003c000h, length = 0004000h SARAM12 : origin = 0040000h, length = 0004000h SARAM13 : origin = 0044000h, length = 0004000h SARAM14 : origin = 0048000h, length = 0004000h SARAM15 : origin = 004c000h, length = 0004000h
CE0 : origin = 0050000h, length = 03b0000h CE1 : origin = 0400000h, length = 0400000h CE2 : origin = 0800000h, length = 0400000h CE3 : origin = 0c00000h, length = 03f8000h
PDROM : origin = 0ff8000h, length = 07f00h VECS : origin = 0ffff00h, length = 00100h /* reset vector */}
SECTIONS{ vectors : {} > VECS PAGE 0 /* interrupt vector table */ .cinit : {} > SARAM0 PAGE 0 .text : {} > SARAM1 PAGE 0 isrs : {} > SARAM2 PAGE 0
.stack : {} > DARAM0 PAGE 0 .sysstack: {} > DARAM0 PAGE 0 .sysmem : {} > DARAM1 PAGE 0 .data : {} > DARAM1 PAGE 0 .bss : {} > DARAM1 PAGE 0 .const : {} > DARAM1 PAGE 0
}
meng zhang5:
回复 Tony Tang:
谢谢