DSP/BIOS的点点滴滴

来源:互联网 发布:淘宝开店详细流程 编辑:程序博客网 时间:2024/05/01 15:02
一、CCS3.3,建立BIOS环境的过程
1,从Project菜单选择New,建立项目工程.prj
2,从File菜单选择New -> DSP/BIOS configuration ..,建立.tcf文件,并保存
3,将上述.tcf文件添加到项目中
4,建立一个源文件.c,含main函数
5,编译。此时会报错。其中一个是说heap空间没有分配,一个是说没有.cmd文件。后者将.tcf文件编译生成的.cmd手工添加到项目中。前者的解决方法是,在.tcf编辑窗口里,选择MEM下的IRAM,右点属性,建立heap空间,然后在MEM条目右点属性,选择使用堆栈的MEM NULL为IRAM。
6,再次编译,通过。缺省编译配置是Debug版本。
7,上述过程并未指定链接库,甚至未指定缺省的链接库路径,比较惊奇,也比较心虚。
8,SDRAM大小的填写:使用64Mb的MT48LC2M32B2TG6填写len=8MB=0x0x00800000;使用128Mb的MT48LC4M32B2TG6填写len=16MB=0x0x01000000,长度单位是MADUs(Minimum Addressable Data Units),最小可寻址数据单元。定义为:The smallest unit of data storage that can be read or written by the CPU. For the C6000, this is an 8-bit byte. For the C5000, this is a 16-bit word. For the C28x, this is an 16-bit word。可见,对不同处理器,这个定义不一样。

二、关于printf的输出
1,puts直接将结果输出到Stdout窗口,无需头文件
2,printf函数需要引用#include <stdio.h>,而且不会立刻输出,需要有\n等语句排空。如:
       printf("\nTesting is success!\n");    // 结尾的\n是不能少的
3,都说LOG_printf函数比printf速度快很多,它是依托BIOS环境的,需要引用下列头文件:
       #include <std.h>
       #include <log.h>
   并且,要在.tcf环境中添加一个LOG对象,如trace,然后代码如下:
   extern LOG_Obj trace;
   main()
   {
      unsigned int sum=880;
      LOG_printf (&trace,"the sum = %d .\n",sum);
   }
   运行后,在Message Log窗口中选择trace,即可显示运行结果。

三、版本变化、资料
TI早期的文档:
1,应用报告,SPRA772A,May 2006,DSP/BIOS Sizing Guidelines for TMS320C2000/C5000/C6000 DSPs,讲述了COFF章节,如何裁减BIOS占用空间
2,一些ROM的应用,不列举
3,DSP/BIOS Driver Developer's Guide

CCS3.3缺省安装版本bios_5_31_02。CCS3.x使用的最新BIOS版本是DSP/BIOS 5.41.10.36,兼容CCS3.3和CCS4,下载地址:
http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/dspbios/5_41_10_36/index_FDS.html
文档地址:http://focus.ti.com.cn/cn/docs/toolsw/folders/print/dspbios5.html
1,SPRU403R,November 2010,TMS320C6000 DSP/BIOS 5.x Application Programming Interface (API) Ref Guide, c28x和C5x有自己的API手册
2,SPRU423H,August 2009,TMS320 DSP/BIOS v5.41 User's Guide
3,SPRU007I,February 2009,DSP/BIOS 5.40 Textual Configuration (Tconf) User’s Guide

CCS4使用的是SYS/BIOS 6,名都改了,真TMD郁闷。最新版本SYS/BIOS 6.32.00.28,支持CCS4.X和CCS5.X。
软件下载地址:http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/bios/sysbios/
文档:
1,SPRUEX3E,June 2010,TI SYS/BIOS Real-time Operating System v6.x User’s Guide
2,在线教程:http://focus.ti.com/docs/training/catalog/events/event.jhtml?sku=OLT110026

迁移手册:
1,Migrating a DSP/BIOS 5 Application to SYS/BIOS 6

BIOS时有更新升级,CCS也在不断升级,低版本需要向高版本迁移过程中,代码转换会出现一些问题,这是很麻烦的事情!

中文图书:
1,TI DSP/BIOS用户手册与驱动开发。前一部分是上述用户手册的中文翻译,后一部分是驱动开发手册是翻译。
2,DSP系统设计和BIOS编程及应用实例——基于TMS320C67x系列DSP芯片,赵家祥,机械工业出版社。前半部分6713最小系统;4~9章讲述了BIOS用法,10章给了2个例子。这本书通俗易懂,适合初学者。

四、C6713涉及到的模块

Index

Module

Function

C6713适合

1

ATM Module

Atomic functions written in assembly language

未引入项目

2

BCACHE Module

Cache operation manager (C64x+ only)

/

3

BUF Module

Maintains buffer pools of fixed size buffers

未引入项目

4

C62 and C64 Modules

Target-specific functions

/

5

CLK Module

System clock manager

yes

6

DEV Module

Device driver interface

?

7

ECM Module

Event combiner manager (C64x+ only)

/

8

EXC Module

Exception manager (C64x+ only)

/

9

GBL Module

Global setting manager

yes

10

GIO Module

I/O module used with IOM mini-drivers

yes

11

HOOK Module

Hook function manager

yes

12

HST Module

Host channel manager

yes

13

HWI Module

Hardware interrupt manager

yes

14

IDL Module

Idle function and processing loop manager

yes

15

LCK Module

Resource lock manager

yes

16

LOG Module

Event Log manager

yes

17

MBX Module

Mailboxes manager

yes

18

MEM Module

Memory manager

yes

19

MPC Module

Memory protection manager (C64x+ only)

/

20

MSGQ Module

Variable-length message manager

yes

21

PIP Module

Buffered pipe manager

yes

22

POOL Module

Allocator interface module

yes

23

PRD Module

Periodic function manager

yes

24

PWRM Module

Reduce application's power consumption

未引入项目

25

QUE Module

Queue manager

yes

26

RTDX Module

Real-time data exchange manager

yes

27

SEM Module

Semaphores manager

yes

28

SIO Module

Stream I/O manager

yes

29

STS Module

Statistics object manager

yes

30

SWI Module

Software interrupt manager

yes

31

SYS Module

System services manager

yes

32

TRC Module

Trace manager

yes

33

TSK Module

Multitasking manager

yes

34

std.h and stdlib.h functions

Standard C library I/O functions

都有

PWRM模块为5.4新增,C6713用不上,yes模块为C6713新建BIOS时引入的模块,重点掌握。


五、一些认识
1,C6713内部RAM一共256K字节,其中0X00000000-0X0002FFFF的192K字节数是内部RAM(L2),0X30000-0X3FFFF的64K字节是内部RAM/cache,即后64K字节可以配置成0/16K/32K/64K Cache,也可以都看成内部RAM。
2,基于上述定义,GEL文件中的RAM显示范围应该涵盖0X30000-0X3FFFF,缺省是不显示这一部分的,把这一部分直接当成CACHE了吧。不了解如何设置成CACHE的,貌似TCF文件里没有啊。
3,按照中文图书2的例子,测试了一些模块,包括MEM、线程管理模块HWI/SWI/PRD/TSK、线程协调同步模块SEM/MBX/QUE,到I/O传输类模块PIP/HST/SIO/DEV/RTDX这里卡住了,上述例子转换不了,也没耐心看下去了。明天去找个CCS低版本的,看看怎样弄的,把它跑起来。
4,HOOK钩子,其实与回调函数是一样的。这部分没有例子,了解的不具体。

0 0
原创粉丝点击