本帖最后由 wopt 于 2015-3-4 10:16 编辑
1.3 软件开发基础
一个DSP应用程序项目包含如下文件:
- 主程序main.c 。
- CMD文件。
- vectors.s55。中断服务表。
- 运行支持库rtx5xxx.lib,对C运行环境的支持。
- 芯片支持库cls5xxx.lib,提供芯片特性的支持。
c_init00()是C运行环境的入口,初始化堆栈指针、页指针、全局变量等。
- 为系统堆栈产生.stack段,并初始化堆栈指针。
- 从.cinit段初始化数据复制到.bss段中相应的变量。
- 调用main函数。
1.3.1 伪汇编指令
参考TMS320C55x Assembly Language Tools User's Guide
中文 DSP的汇编伪指令
1.3.2 CMD文件
详情查看《DSP与CMD文件的原理》
参考:
MEMORY
{
MMR : origin = 0000000h, length = 00000c0h
SPRAM : origin = 00000c0h, length = 0000040h
VECS0 : origin = 0000100h, length = 0000100h
VECS1 : origin = 0000200h, length = 0000100h
DARAM0 : origin = 0000300h, length = 0003D00h
DARAM1 : origin = 0004000h, length = 0004000h
DARAM2 : origin = 0008000h, length = 0004000h
DARAM3 : origin = 000c000h, length = 0004000h
SARAM0 : origin = 0010000h, length = 0004000h
SARAM1 : origin = 0014000h, length = 0008000h
/* 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
}
SECTIONS
{
/* 存放程序区 */
vectors: {} > VECS0 /* vectors是在rts55x.lib中定义的 */
.vectors: {} > VECS1 /* interrupt vector table */
.cinit: {} > SARAM0 /* 变量初值和常量 */
.text: {} > SARAM1 /* C程序代码 */
/* 存放数据区 */
.csldata: {} > DARAM0 /* csl库 */
.bss: {} > DARAM0 /* 全局和静态变量 */
.const: {} > DARAM0 /* 字符、浮点常量和用const声明的常量 */
.data: {} > DARAM0
.cio: {} > DARAM1
.stack: {} > DARAM1 /* 保持返回地址,函数间的参数传递,存储局部变量和中间结果 */
.sysstack: {} > DARAM1
.sysmem: {} > DARAM2 /* malloc,calloc和realloc函数动态分配的存储空间 */
}
1.3.3 新建工程注意事项
|