使用Code Composer Studio  Version: 6.1.1.00022,建立TMS320F2812工程。

 /*
* main.c
*/
#include <stdio.h> int main(void) {
printf("Hello DSP!\r\n");
return ;
}

添加了printf函数想测试一下,然后编译出错。

 #-D</a> program will not fit into available memory. placement with alignment/blocking fails for section ".text" size 0x1be0 page . Available memory ranges:    2812_RAM_lnk.cmd    /2812Test    line     C/C++ Problem

查阅资料,应该调整-stack和-heap的大小,并且工程库文件必须选择rts2800_ml.lib而不是rts2800.lib。不过我修改-stack和-heap如下图,无效。

DSP:CCS V6 TMS320F2812 使用printf函数-LMLPHP

更改工程库文件为rts2800_ml.lib也无效,最后在Project-Properties-Build-Advanced Options-Library Function Assumptions下,Level of printf/scanf support required(--printf_support)选择minimal,如下图。编译通过。

DSP:CCS V6 TMS320F2812 使用printf函数-LMLPHP

04-29 21:48
查看更多