Platform Library提供了一组适用于开发板的API函数。我们可以使用它来快速入手开发板。

1、启动CCS,建立一个空的工程

2、添加include路径

"C:\Program Files\Texas Instruments\pdk_C####_1_0_0_xx\packages"

3、添加下列链接库到C6000 Linker section中的File Search Path

"C:\ti\pdk_c667x_2_0_3\packages\ti\platform\evmc6678l\platform_lib\lib\debug\ti.platform.evm6678l.ae66"

"C:\ti\pdk_c667x_2_0_3\packages\ti\csl\lib\c6678\c66\release\ti.csl.ae66"

"C:\ti\pdk_c667x_2_0_3\packages\ti\csl\lib\c6678\c66\release\ti.csl.intc.ae66"

4、指定库的查找路径

"C:\ti\pdk_c667x_2_0_3\packages\ti\csl\lib\c6678\c66\release"

"C:\ti\pdk_c667x_2_0_3\packages\ti\platform\evmc6678l\platform_lib\lib\debug"

5

打开Project->Properties,在Build->C6000 Compiler->Advanced Options->Predefined Symbol中添加SOC_C6678

6、编写代码

这里给MCSDK中的led_play.c的代码

Note:代码中的OSAL functions for Platform Library不要注释掉!(Osal_platformMalloc等这些函数在platform_lib中的platform.c 中有使用,但是lib工程中没有其实现,所以可以在工程中实现。否则在linker的时候会提示函数未定义,也可以将实现与声明均放在lib中编译生成lib。)

#include <cerrno>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "ti\platform\platform.h"
#include "ti\platform\resource_mgr.h" /* OSAL functions for Platform Library */
uint8_t *Osal_platformMalloc (uint32_t num_bytes, uint32_t alignment)
{
return malloc(num_bytes);
} void Osal_platformFree (uint8_t *dataPtr, uint32_t num_bytes)
{
/* Free up the memory */
if (dataPtr)
{
free(dataPtr);
}
} void Osal_platformSpiCsEnter(void)
{
/* Get the hardware semaphore.
*
* Acquire Multi core CPPI synchronization lock
*/
while ((CSL_semAcquireDirect (PLATFORM_SPI_HW_SEM)) == 0); return;
} void Osal_platformSpiCsExit (void)
{
/* Release the hardware semaphore
*
* Release multi-core lock.
*/
CSL_semReleaseSemaphore (PLATFORM_SPI_HW_SEM); return;
} void main(void) {
platform_init_flags init_flags;
platform_init_config init_config;
platform_info p_info;
uint32_t led_no = 0;
char message[] = "\r\nHello World.....\r\n";
uint32_t length = strlen((char *)message);
uint32_t i; /* Initialize platform with default values */
memset(&init_flags, 0x01, sizeof(platform_init_flags));
memset(&init_config, 0, sizeof(platform_init_config));
if (platform_init(&init_flags, &init_config) != Platform_EOK) {
return;
} platform_uart_init();
platform_uart_set_baudrate(115200); platform_get_info(&p_info); /* Write to the UART */
for (i = 0; i < length; i++) {
if (platform_uart_write(message[i]) != Platform_EOK) {
return;
}
} /* Play forever */
while(1) {
platform_led(led_no, PLATFORM_LED_ON, PLATFORM_USER_LED_CLASS);
platform_delay(30000);
platform_led(led_no, PLATFORM_LED_OFF, PLATFORM_USER_LED_CLASS);
led_no = (++led_no) % p_info.led[PLATFORM_USER_LED_CLASS].count;
}
}

7、添加linker command script

The linker command script defines the memory map for the platform (where internal, shared and external memory start, etc.) and where we want our code and data sections to be placed. We are going to put them in the shared memory region on the processor.

  • Select File->New->File from Template, enter File Name as XXXX.cmd and hit Finish.

  • paste following linker command file in the editor


-c
-heap 0x41000
-stack 0xa000 /* Memory Map */
MEMORY
{
L1PSRAM (RWX) : org = 0x0E00000, len = 0x7FFF
L1DSRAM (RWX) : org = 0x0F00000, len = 0x7FFF
L2SRAM (RWX) : org = 0x0800000, len = 0x080000
MSMCSRAM (RWX) : org = 0xc000000, len = 0x200000
DDR3 (RWX) : org = 0x80000000,len = 0x10000000
} SECTIONS
{
.csl_vect > MSMCSRAM
.text > MSMCSRAM
GROUP (NEAR_DP)
{
.neardata
.rodata
.bss
} load > MSMCSRAM
.stack > MSMCSRAM
.cinit > MSMCSRAM
.cio > MSMCSRAM
.const > MSMCSRAM
.data > MSMCSRAM
.switch > MSMCSRAM
.sysmem > MSMCSRAM
.far > MSMCSRAM
.testMem > MSMCSRAM
.fardata > MSMCSRAM
platform_lib > MSMCSRAM
}

8、编译。。。

BIOS MCSDK 2.0 学习笔记(二)————使用Platform Library创建工程的更多相关文章

  1. BIOS MCSDK 2.0 学习笔记(一)

    MCSDK简介 BIOS MCSDK是为TI的高性能多核DSP提供的一套组件,包括: SYS/BIOS实时操作系统 Chip support libraries, drivers, and basic ...

  2. 一起学ASP.NET Core 2.0学习笔记(二): ef core2.0 及mysql provider 、Fluent API相关配置及迁移

    不得不说微软的技术迭代还是很快的,上了微软的船就得跟着她走下去,前文一起学ASP.NET Core 2.0学习笔记(一): CentOS下 .net core2 sdk nginx.superviso ...

  3. vue2.0学习笔记之路由(二)路由嵌套+动画

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  4. vue2.0学习笔记之路由(二)路由嵌套

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  5. python3.4学习笔记(二十一) python实现指定字符串补全空格、前面填充0的方法

    python3.4学习笔记(二十一) python实现指定字符串补全空格.前面填充0的方法 Python zfill()方法返回指定长度的字符串,原字符串右对齐,前面填充0.zfill()方法语法:s ...

  6. AJax 学习笔记二(onreadystatechange的作用)

    AJax 学习笔记二(onreadystatechange的作用) 当发送一个请求后,客户端无法确定什么时候会完成这个请求,所以需要用事件机制来捕获请求的状态XMLHttpRequest对象提供了on ...

  7. DirectX 总结和DirectX 9.0 学习笔记

    转自:http://www.cnblogs.com/graphics/archive/2009/11/25/1583682.html DirectX 总结 DDS DirectXDraw Surfac ...

  8. java之jvm学习笔记二(类装载器的体系结构)

    java的class只在需要的时候才内转载入内存,并由java虚拟机的执行引擎来执行,而执行引擎从总的来说主要的执行方式分为四种, 第一种,一次性解释代码,也就是当字节码转载到内存后,每次需要都会重新 ...

  9. Java IO学习笔记二

    Java IO学习笔记二 流的概念 在程序中所有的数据都是以流的方式进行传输或保存的,程序需要数据的时候要使用输入流读取数据,而当程序需要将一些数据保存起来的时候,就要使用输出流完成. 程序中的输入输 ...

随机推荐

  1. WebApi身份认证解决方案:Basic基础认证

    前言:最近,讨论到数据库安全的问题,于是就引出了WebApi服务没有加任何验证的问题.也就是说,任何人只要知道了接口的url,都能够模拟http请求去访问我们的服务接口,从而去增删改查数据库,这后果想 ...

  2. python 学习

    python 使用 缩进 代替 C 中的 {}  或 delphi 中的 begin...end 1.help()  显示帮助或 help(<命令>) 2.字符串前加 r 表示原始字符串, ...

  3. chrome + vi

    vimer们福利,一款能在chrome上面使用vim快捷键的插件 http://myhozz.com/2014/10/25/use-vim-in-chrome/

  4. 取字符串拼音首字母(js)

    //取字符串拼音首字母 function makePy(str) { if (typeof(str) != "string") throw new Error(-1, " ...

  5. Oracle安装错误“程序异常终止

    Oracle安装错误"程序异常终止.发生内部错误.请将以下文件提供给oracle技术支持部   "程序异常终止.发生内部错误.请将以下文件提供给oracle技术支持部门:" ...

  6. MVC系列1-MVC基础 (ASP.NET)

    终于决定写一个系列的文章了,最开始其实是准备写一下WPF的,因为我这两年一直在做WPF,对WPF的喜爱自然是无以言表.但是由于我所在的地区对WPF的普及不是很广泛,所以,被迫又开始做起来web,但是我 ...

  7. ACL权限设置命令setfacl和getfacl命令

    ACL权限设置命令setfacl和getfacl命令 setfacl命令是用来在命令行里设置ACL(访问控制列表).在命令行里,一系列的命令跟随以一系列的文件名. [TOC] 选项 |参数|说明|   ...

  8. com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files

    http://stackoverflow.com/questions/33951853/com-android-build-api-transform-transformexception-com-a ...

  9. jquery常用插件及用法总结

    http://www.jb51.net/Special/200.htm

  10. [转]iOS开发中@property的属性weak nonatomic strong readonly等介绍

    转载地址: http://www.lvtao.net/ios/504.html @property与@synthesize是成对出现的,可以自动生成某个类成员变量的存取方法.在Xcode4.5以及以后 ...