BIOS MCSDK 2.0 学习笔记(二)————使用Platform Library创建工程
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创建工程的更多相关文章
- BIOS MCSDK 2.0 学习笔记(一)
MCSDK简介 BIOS MCSDK是为TI的高性能多核DSP提供的一套组件,包括: SYS/BIOS实时操作系统 Chip support libraries, drivers, and basic ...
- 一起学ASP.NET Core 2.0学习笔记(二): ef core2.0 及mysql provider 、Fluent API相关配置及迁移
不得不说微软的技术迭代还是很快的,上了微软的船就得跟着她走下去,前文一起学ASP.NET Core 2.0学习笔记(一): CentOS下 .net core2 sdk nginx.superviso ...
- vue2.0学习笔记之路由(二)路由嵌套+动画
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- vue2.0学习笔记之路由(二)路由嵌套
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- python3.4学习笔记(二十一) python实现指定字符串补全空格、前面填充0的方法
python3.4学习笔记(二十一) python实现指定字符串补全空格.前面填充0的方法 Python zfill()方法返回指定长度的字符串,原字符串右对齐,前面填充0.zfill()方法语法:s ...
- AJax 学习笔记二(onreadystatechange的作用)
AJax 学习笔记二(onreadystatechange的作用) 当发送一个请求后,客户端无法确定什么时候会完成这个请求,所以需要用事件机制来捕获请求的状态XMLHttpRequest对象提供了on ...
- DirectX 总结和DirectX 9.0 学习笔记
转自:http://www.cnblogs.com/graphics/archive/2009/11/25/1583682.html DirectX 总结 DDS DirectXDraw Surfac ...
- java之jvm学习笔记二(类装载器的体系结构)
java的class只在需要的时候才内转载入内存,并由java虚拟机的执行引擎来执行,而执行引擎从总的来说主要的执行方式分为四种, 第一种,一次性解释代码,也就是当字节码转载到内存后,每次需要都会重新 ...
- Java IO学习笔记二
Java IO学习笔记二 流的概念 在程序中所有的数据都是以流的方式进行传输或保存的,程序需要数据的时候要使用输入流读取数据,而当程序需要将一些数据保存起来的时候,就要使用输出流完成. 程序中的输入输 ...
随机推荐
- 【转】python中的正斜杠、反斜杠
原文地址:http://www.cnblogs.com/followyourheart1990/p/4270566.html 首先,"/"左倾斜是正斜杠,"\" ...
- CI(持续集成)CD(持续交付)
持续集成实践: 1.保持单一代码仓库 2.自动化构建项目 3.使项目拥有自测试的能力 4.成员每天上传代码 5.每次上传需要在集成机上构建主线项目 6.立即修复出错的构想流程 7.保证构建效率 8.将 ...
- WEB前端开发CSS基础样式全面总结
Web前端开发css基础样式全面总结 颜色和单位的使用 颜色 用颜色的名字表示颜色,比如:red 用16进制表示演示 比如:#FF0000 用rgb数值表示颜色,rgb(红,绿,蓝),每个值都在0-2 ...
- java语言的I/O操作预习
一些概念: 流:计算机的输入输出之间流动的数据序列,也是类的对象.java中的流方式就像是建立在数据交换源和目的之间的一条通信路径. 数据源:计算机中的数据源是指可以提供数据的地方,包括键盘,磁盘文件 ...
- switch 与 python字典
python 中并没有switch语句,但是有一个数据类型与switch语句特别相似,它就是 dict{ key: value, ...} 下面用 dict{ key:value,..} 来简单的实现 ...
- django 其他地址访问不了问题
启动的时候 使用 python manage.py runserver 0.0.0.0:8000 即可接收所有IP访问
- [转]Android SDK更新 Connection to http://dl-ssl.google.com refused 解决方法
问题描述 使用SDK Manager更新时出现问题Failed to fetch URL https://dl-ssl.google.com/android/repository/repository ...
- MooseFS
http://www.moosefs.org/
- MessageReceiver
class MessageReceiver { private RelayEngine<MessageCollection> _MessageRelayEngine; private st ...
- mysql 主命令总结
mysql 登录和恢复命令 mysqladmin 管理 mysql 命令 mysqldump 备份命令 mysqlbinlog 解析 binlog 命令 source 恢复数据命令