存档

‘davinci(TI DSP)’ 分类的存档

DM642的NDK SBNew: Buffer OOM错误问题解决

2009年9月29日
DM642的NDK SBNew: Buffer OOM错误问题解决已关闭评论

DM642上使用异常现象,建立一个TCP监听端口,当向这个tcp端口连接时失败,DM642程序在CCS上提示的打印信息:
00008.106 SBNew: Buffer OOM
00008.681 SBNew: Buffer OOM
00009.298 SBNew: Buffer OOM

整个工程原先是可用,最近不知做什么修改才出现了这个问题,怀疑是NDK相关的库被修改了,查了一遍,无果。

还是得从打印信息出发,经查证,SBNew是一个内存分配函数,在stack.lib的sb.c文件里实现,SBNew: Buffer OOM就意味着内存分配不成功。

依据网络堆栈的思路调整了堆栈大小,最终把问题确定下来了,原来我们使用的socket buffer被修改得太大了,之前调试把buffer改成 0x100000,改回8704就ok了!

// Change our socket buffer size to 8704 bytes
rc =8704;//8760;// 0x100000;//
CfgAddEntry( hCfg, CFGTAG_IP, CFGITEM_IP_SOCKBUFMAX, CFG_ADDMODE_UNIQUE, sizeof(uint), (UINT8 *)&rc, 0 );

TI提供的DM642 NDK存在不少问题,使用时要十分小心!

davinci(TI DSP) , ,

TMS320DM355 High-Definition (HD) Display

2009年8月17日
TMS320DM355 High-Definition (HD) Display已关闭评论

 

This document describes the system requirements and restrictions for high definition (HD) display while decoding 720P movie and still images.

Contents

[hide]

Introduction

The TMS320DM355 device can encode and decode 720p movies, but a very high DDR bandwidth is needed to display them simultaneously on an HD display. There are a few prerequisites and restrictions in the system to make sure that there are no display glitches during this scenario. This application report is written based on current hardware and software baselines. The restrictions or limitations can be changed according to future software optimizations and hardware improvements.

HD display scenarios

This list briefly summarizes what the DM355 device can and cannot support. More detailed information is discussed in the following sections.

The DM355 CAN support the following HD display scenarios:

  • 720p (1280×720) HD display out
    • Movie playback
      • 720p movie decode with full screen and Video Graphics Array (VGA), Quarter Video Graphics Array (QVGA) movie decode with original size in center of display
    • Still image
      • Slide show with transition effect is possible with full screen
    • Graphical User Interface (GUI)
      • 640×320 size, 8-bit bitmap can fill in full screen with no background job
  • 1080i (1920×1080) HD display out
    • Movie playback
      • 720p, VGA, QVGA movie decode with original size in center of display
    • Still image
      • Slide show with transition effect is possible with full screen
    • GUI
      • 960×540, 8-bit bitmap can fill in full screen with no background job
  • NTSC, PAL TV out
    • Movie playback
      • Super eXtended Video Graphics Array (SXVGA), 720p with full screen and GUI
    • Still image
      • Slide show with transition effect and GUI
    • Movie encoding
      • Full screen preview with GUI while SXVGA, 720p movie encoding
    • GUI
      • No special restrictions or limitations for the GUI implementation

The DM355 CANNOT support the following scenarios:

  • Preview on HD display (even with VGA, QVGA size)
  • HD display during movie encode (even with VGA, QVGA size)
  • Full screen size GUI with background job (movie playback, JPEG decoding, etc.) on HD display

System configuration

HD display with DM355 is supported with the system configurations discussed below.

For Image and Movie Playback Systems With HD Display

These configurations are for systems that need to playback both HD movies and still images. The configurations for movie and still image playback are different in this system, and are provided in the following sections.

Configuration for 720p Movie Playback

  • ARM 270 MHz*
  • DDR 216 MHz** and 8 bank
  • PBBPR*** = 0x30
  • TC RDRATE**** = 0x2

* TMS320DM355-270 is required to run ARM at 270 MHz.
** DDR2 533 MHz DDR module and 270 MHz grade DM355 are required to run DDR at 216 MHz.
*** EMIF Peripheral Bus Burst Priority (PBBPR): 32-bit register at 0x20000020
**** Enhanced Direct Memory Access (EDMA3) Transfer Control Read Rate (TC RDRATE): 32-bit registers at 0x01C10140 and 0x01C10540

This configuration is used for 720p movie playback. It is not possible to resize movies without noise with HD display. 720p movies can be played in full screen size with 720p display; VGA, QVGA size movies are played in their original sizes. 720p movies can be played in their original size with 1080i display.

It is hard to get 30 frames per second (FPS) movie playback if a bigger value than 0x2 is set for TC RDRATE. 0x2 is the highest limit to get for 30 FPS.

0x30 for PBBPR was found with a trial and error method so it is not the best possible value. Memory bandwidth can be utilized more efficiently with a bigger PBBPR value, but peak memory bandwidth can exceed the limitation with bigger PBBPR value in some situations. The best possible value can be changed according to system and application. Start with 0x30 and find good value with trial and error. 0x10 ~ 0x50 would be a good range to cover the best values for almost all systems.

Configuration for Still Image Playback When HD Movie Playback is Needed

  • ARM 270 MHz
  • DDR 216 MHz and 8 bank
  • PBBPR = 0x30
  • TC RDRATE = 0x4

This configuration is used for still image playback. Full screen size still image playback is possible with both 720p and 1080i display. The slide show with transition effect is also possible with both displays. This configuration is useful for the application that requires movie playback as well. Lower ARM and DDR clock can be used for still image playback, to reduce power consumption, but it requires a dynamic-clock-speed changing mechanism. If power consumption is not an issue, then keeping the same clock speed with movie playback is easier to implement and reduces corner cases.

The slide show with transition effect does not have strict real-time constraints like movie playback, so the TC RDRATE value can be adjusted freely. In this configuration with the bigger TC RDRATE value, the transition effects become slower but reduce the possibility of noise. To find the best value for a specific system, start with 0x4 and increase the value with the trial and error method.

For Image Playback Only System With HD Display

The configuration for still image playback is discussed below.

Configuration for Still Image Playback When HD Movie Playback is NOT Needed

  • ARM 108 MHz
  • DDR 171 MHz and 4 bank
  • PBBPR = 0x30
  • TC RDRATE = 0x4
  • IPIPEIF_CFG.CLKDIV = 1/16

This is the minimum configuration to support still image playback and slide show with transition effects for a system that does not need to playback movies on HD display. It means movie playback on the HD display is not supported.

Only 720p display is supported; 1080i is not supported. If 8 bank is used, then 1080i is possible.

ARM 216 MHz has more on-screen display (OSD) line noise than ARM 108 MHz. The reason is that ARM 216 MHz requests memory accesses in shorter periods of time so the peak-of-memory access load is higher. If 8 bank is used, then ARM 216 MHz could be used without any problem.

With this configuration, other values for PBBPR and RDRATE have more visual artifacts. But different systems can show different behavior, so start with the values above and find good values for the system.

If the JPEG size is bigger than the HD display resolution, then IPIPEIF_CFG.CLKDIV does not need to be changed; however, if the JPEG size is smaller than the HD display resolution, then IPIPEIF_CFG.CLKDIV should be set as 1/5, 1/6, 1/8, 1/16 or 1/32. The reason is that scale up requires more bandwidth than scale down. The speed of the Resizer should be reduced. By increasing the clock divider value of IPIPEIF, RESIZE runs more slowly and reduces the required memory bandwidth.

For HD Movie Record System With SD Display

The configuration for the HD movie record system with standard definition display is discussed below.

Configuration for HD Movie Record (minimum configuration)

  • ARM 216 MHz
  • DDR 171 MHz
  • PBBPR = 0x2
  • TC RDRATE = 0x2

Although HD preview is not possible while HD movie encoding, NTSC, PAL or D1 size LCD preview is possible. The above configuration is used to capture an HD movie (720p, SXVGA).

8 bank memory was tested but 4 bank memory has not been tested yet.

GUI With HD Display

There are restrictions to implement GUI with HD Display. The restrictions are explained in this section. Even with the restrictions, some reasonable GUI implementation is possible and those ideas will be discussed in this section, too.

Restrictions

GUI can be implemented with the following configuration.

  • Max size of bitmap window
    • 640×320 for 720p
    • 960×540 for 1080i
  • 2x zoom of the OSD window
  • Only 8 bit or lower bitmaps are supported

GUI has the following limitation.

  • GUI can have blending or transparent effect with video window.
  • While movie playback and slide show, no GUI display is recommended
  • If GUI is required while movie playback and slide show, then a bitmap window size as small as possible is recommended.
  • When there is no background job (movie playback paused, etc.), full screen size GUI can be displayed with above configuration

Using attribute window is not recommended because it greatly increases memory bandwidth.

Although the average memory bandwidth is good enough, the problem is the peak-of-memory bandwidth can exceed the limit and cause visual artifacts on display. GUI increases memory bandwidth significantly. The rule of thumb is not running anything in the background while the GUI menu is shown in the display and to hide the GUI menu before starting anything else. In the case that it is inevitable that an icon is showing while something is running, a bitmap window size as small as possible is recommended.

If noise appears with GUI, then PBBPR and RDRATE values should be readjusted or GUI should be hidden.

GUI Implementation Hints

Even with restrictions in the previous section, there are several ways to implement reasonable GUI on the HD display. They are explained in this section.

Warning
Descriptions in this section are not guaranteed officially. The appropriate sizes and parameters should be found with the specific system.

GUI While Movie Playback

The worst scenario is using 640×320 bitmap and blending full size with the video window. If a GUI is implemented with this method, the GUI can be displayed only when the movie is paused or stopped.

But if a smaller bitmap is used, the following GUI can be shown during movie playback.

Figure 1 GUI with Movie Playback

Figure 1 GUI with Movie Playback

To implement the GUI in Figure 1 during movie playback, the following technique can be used.

The issue is memory bandwidth: more GUI can be added if memory bandwidth increase is not too large. The important aspect is keeping the OSD window size as small as possible. Figure 2 shows how OSD windows can be configured to implement GUI in Figure 1.

Figure 2 OSD Window Configuration

Figure 2 OSD Window Configuration

If only one OSD window is used, then the OSD window size should be able to cover almost all of the display area. But when using two OSD windows, both window sizes can be minimized to cover only the bitmap or text. With this method, memory bandwidth increase can be minimized and this GUI could be shown while performing movie playback.

Full Screen Menu With HD Display

Figure 3 shows an example of a GUI that covers a large part of the screen. This kind of menu could also be implemented without increasing memory bandwidth by carefully assigning the bitmap to the OSD windows without using the attribute window.

Figure 3 Full Screen Menu Example

Figure 3 Full Screen Menu Example

As shown in Figure 4, OSD 0 can contain the menu part with 25% transparency and OSD1 can contain the banner part with 40%transparency. The sizes of the OSD 0 and OSD 1 windows should be minimized to cover only the necessary parts; this is the key to reduce memory bandwidth.

Figure 4 OSD Window Assignment Example

Figure 4 OSD Window Assignment Example

Functionality Supported

Configuration Feature List DM355-270 + 8 bank DDR2 DM355-216 + 512 MBit 4 bank DDR2 DM355-135 + 512 MBit 4 bank DDR2
Display on LCD/TV VGA movie MPEG4 encode/ decode 30FPS+ display on LCD/TV Y Y Y
720P HD movie MPEG4 encode/ decode 30FPS + display on LCD/TV Y Y N
VGA movie MPEG4 encode 30FPS+ display on LCD/TV + Video Stabilization Y Y Y
720P HD movie MPEG4 encode 30FPS+ display on LCD/TV + Video Stabilization Y Y N
VGA movie MPEG4 encode 30FPS+ display on LCD/TV + 5x digital zoom Y Y N
720P HD movie MPEG4 encode 30FPS+ display on LCD/TV + 3x digital zoom Y1 N N
VGA movie MPEG4 encode 30FPS+ display on LCD/TV + 5x digital zoom + Video Stabilization Y Y N
720P HD movie MPEG4 encode 30FPS+ display on LCD/TV + 3x digital zoom + Video Stabilization Y1 N N
Display on HDTV VGA movie MPEG4 decode 30FPS +Display on HDTV (Y Pb Pr) Y2 N N
720P HD movie MPEG4 decode 30FPS +Display on HDTV (Y Pb Pr) Y N N
VGA movie MPEG4 encode 30FPS +Display on HDTV (Y Pb Pr) N3 N3 N3
VGA movie MPEG4 encode 30FPS +Display on HDTV (Y Pb Pr) +Video Stabilization N3 N3 N3
720P HD movie MPEG4 encode 30FPS +Display on HDTV (Y Pb Pr) N3 N3 N3

 

1) “720P HD movie MPEG4 encode 30FPS+ display on LCD/TV + 5x digital zoom + Video Stabilization” 15fps possible with DM355-270

2) Only display of VGA size possible in the center of HDTV. Display of 720P upsampled frame not possible

3) HD Display not possible with Movie Encode

davinci(TI DSP), IT技术 ,

C2000系CMD文件的配置理解

2009年8月11日
C2000系CMD文件的配置理解已关闭评论

查了关于cmd的编写说明 ,这个算比较好的,所以转载,虽然这个是讲C2000的,而我想要的是C6000/davinci。ccs很强大啊!

CMD 的专业名称叫链接器配置文件,是存放链接器的配置信息的,我们简称为命令文件,其中比较关键的就是MEMORY和SECTIONS两个伪指令的使用,常常令人困惑,系统出现的问题也经常与它们的不当使用有关。CCS是DSP软件对DOS系统继承的开发环境,CCS的命令文件经过DOS命令文件长时间的引申发展,已经变得非常简洁(不知道TI文档有没有详细CMD配置说明)。我学CMD是从DOS里的东西开始的,所以也从DOS环境下的CMD说起:

1命令文件的组成
命令文件的开头部分是要链接的各个子目标文件的名字,这样链接器就可以根据子目标文件名,将相应的目标文件链接成一个文件;接下来就是链接器的操作指令,这些指令用来配置链接器,接下来就是MEMORY和SECTIONS两个伪指令的相关语句,必须大写。MEMORY,用来配置目标存储器,SECTIONS用来指定段的存放位置。结合下面的典型DOS环境的命令文件link.cmd来做一下说明:
file.obj            //子目标文件名1
file2.obj        //子目标文件名2
file3.obj        //子目标文件名3
– o prog.out  //连接器操作指令,用来指定输出文件
– m prog.m    //用来指定MAP文件
MEMORY
{ 略 }
SECTIONS
{ 略 }
otherlink.cmd
本命令文件link.cmd要调用的otherlink.cmd等其他命令文件,则文件的名字要放到本命令文件最后一行,因为放开头的话,链接器是不会从被调用的其他命令文件中返回到本命令文件。

2 MEMORY伪指令
MEMORY用来建立目标存储器的模型,SECTIONS指令就可以根据这个模型来安排各个段的位置,MEMORY指令可以定义目标系统的各种类型的存储器及容量。MEMORY的语法如下:
MEMORY
{
PAGE 0 : name1[(attr)] : origin = constant,length = constant
         name1n[(attr)] : origin = constant,length = constant
PAGE 1 : name2[(attr)] : origin = constant,length = constant
         name2n[(attr)] : origin = constant,length = constant
PAGE n : namen[(attr)] : origin = constant,length = constant
         namenn[(attr)] : origin = constant,length = constant
}
PAGE关键词对独立的存储空间进行标记,页号n的最大值为255,实际应用中一般分为两页,PAGE0程序存储器和PAGE1数据存储器。
name存储区间的名字,不超过8个字符,不同的PAGE上可以出现相同的名字(最好不用,免的搞混),一个PAGE内不许有相同的name。
attr的属性标识,为R表示可读;W可写X表示区间可以装入可执行代码;I表示存储器可以进行初始话,什么属性代码也不写,表示存储区间具有上述的四种属性,基本上我们都选择这种写法。
origin:略。
length:略。
下面是经常用的2407的简单写法大家参考,程序从0x060开始,要避开加密位,不从0x0044开始更可靠一点,此例中的同名的页可以只写第一个,其后省略,但写上至少安全一点:
MEMORY
{
PAGE 0: VECS: origin = 0x0000,  length 0x40
PAGE 0: PROG: origin = 0x0060,  length 0x6000
PAGE 1: B0  : origin = 0x200,  length 0x100
PAGE 1: B1  : origin = 0x300,  length 0x100
PAGE 1: DATA: origin = 0x0860,  length 0x0780
}

3 SECTIONS伪指令
SECTIONS指令的语法如下:
SECTIONS
{
.text:  {所有.text输入段名}  load=加载地址  run =运行地址
.data:  {所有.data输入段名}  load=加载地址  run =运行地址
.bss:  {所有.bss输入段名}    load=加载地址  run =运行地址
.other: {所有.other输入段名}  load=加载地址  run =运行地址
}
SECTIONS必须用大写字母,其后的大括号里是输出段的说明性语句,每一个输出段的说明都是从段名开始,段名之后是如何对输入段进行组织和给段分配存储器的参数说明:
以.text段的属性语句为例,“{所有.text输入段名}”这段内容用来说明连接器输出段的.text段由哪些子目标文件的段组成,举例如下
SECTIONS
{
.text:{  file1.obj(.text) file2(.text) file3(.text,cinit)}略
}
指明输出段.text要链接file1.obj的.text和 file2的.text 还有file3的.text和.cinit。在CCS的SECTIONS里通常只写一个中间没有内容的“{ }”就表示所有的目标文件的相应段
接下来说明“load=加载地址  run =运行地址”链接器为每个输出段都在目标存储器里分配两个地址:一个是加载地址,一个是运行地址。通常情况下两个地址是相同的,可以认为输出段只有一个地址,这时就可以不加“run =运行地址”这条语句了;但有时需要将两个地址分开,比如将程序加载到FLASH,然后放到RAM中高速运行,这就用到了运行地址和加载地址的分别配置了,如下例所示:
.const :{略} load = PROG  run = 0x0800
常量加载在程序存储区,配置为在RAM里调用。
“load=加载地址”的几种写法需要说明一下,首先“load”关键字可以省略,“=”可以写成“>”, “加载地址”可以是:地址值、存储区间的名字、PAGE关键词等,所以大家见到“.text:{ } > 0x0080”这样的语句可千万不要奇怪。“run =运行地址”中的“ = ”可以用“>”,其它的简化写法就没有了。大家不要乱用。

4 CCS中的案例
在CCS中的命令文件好像简化了不少,少了很多东西,语句也精简了好多,首先不用指定输入链接器的目标文件,CCS会自动默认处理,其次链接器的配置命令也和DOS的环境不同,需要了解的请找TI文档吧!下面是刘和平书中的例子,大家来看看是不是可以很精确的理解了呢!
-stack 40
/*————————————————————————-*/
/*  命令文件 – 存储空间 F2407            */
/*————————————————————————-*/
MEMORY
{
PAGE 0 :  VECS : origin =    0h , length = 40h  /*  程序复位 */
      PVECS : origin =  40h , length = 70h  /* 外围模块中断向量 */
      PROG : origin =  0b0h , length = 7F50h  /* 在片FLASH */
PAGE 1 :  MMRS : origin =    0h , length =  05Fh  /* MMRS            */
    B2 : origin = 0060h , length =  020h  /* DARAM B2 块  */
    B0 : origin = 0200h , length =  100h  /* DARAM B0 块  */
    B1 : origin = 0300h , length =  100h  /* DARAM B1 块  */
SARAM  : origin = 0800h , length =  0800h    /* SARAM 块  */
EXT : origin = 8000h , length =  8000h  /* 外部存储器  */
}
/*————————————————————————-*/
/* SECTIONS ALLOCATION                                                    */
/*————————————————————————-*/
SECTIONS
{
    .reset  : { } > VECS  PAGE 0  /* 复位中断向量表 */
    .vectors : { } > VECS  PAGE 0 /* 中断向量表 */
    .pvecs  : { } > PVECS  PAGE 0 /* 外围模块中断向量表  */
    .text    : { } > PROG  PAGE 0 /* 代码 */
    .cinit  : { } > PROG  PAGE 0  
    .bss    : { } > SARAM  PAGE 1 /* 块 B2 */
    .const  : { } > SARAM  PAGE 1 /* 块 B2 */  
    .stack  : { } > B1    PAGE 1 /* 堆栈—40个单元 */
}

http://blog.21ic.com/user1/1472/archives/2007/38482.html

davinci(TI DSP), IT技术 ,

How to update CCS ARM cgtools to build the DM365 ubl in CCS 3.3

2009年8月10日
How to update CCS ARM cgtools to build the DM365 ubl in CCS 3.3已关闭评论

The DM365 CCS ubl is in the flash_utils.tar.gz which you can find after you install psp_02_10_xx_xx.bin. 1. Update the CCS ARM cgtools to V4.5.0. You can download it here. Then install it. 2. Change the ARM cgtools used in CCS. a. There are two ways to open Component Manager.

  • In CCS, pls select Help->About…, then a new window appears. Pls click Component Manager. Then you will see the Code Composer Studio Component Manager window.
  • Or you can go to /CCS install folder/cc/bin. Pls run comp_mgr.exe. Then you will also see the Component Manager window.

b. Pls click ‘+’ of Build Tools, then ‘+’ of TMS470R2x, then you will see all CCS ARM cgtools you installed on the PC. Select the version you need, such as V4.5.0. (TMS470R1x is for ARM7 and TMS470R2x is for ARM9.) c. Close the Code Composer Studio Component Manager window. You will see a warning window "This configuration change requires Code Composer Studio to be restarted.. Pls save your work and restart Code Composer Studio before proceeding.". Read it and click ok. d. The Component Manager will ask "Do you want to save changes?". Pls select Yes. 3. Restart the CCS to let the new setting effect. Then build the ubl project with new ARM cgtools. from: http://wiki.davincidsp.com/index.php/How_to_update_CCS_ARM_cgtools_to_build_the_DM365_ubl_in_CCS_3.3

davinci(TI DSP), IT技术 , ,