2464 views|0 replies

3836

Posts

19

Resources
The OP
 

Using CSL library in CCS v5, taking McBSP of DM642 as an example [Copy link]

Preliminary preparation: Download CSL header files and libraries. Since CCS v4 no longer has CSL, but is renamed CSLR and added to the BIOS, you need to download the CSL header file and library separately. After downloading, unzip and install. I installed it in: C:\ti\C6xCSL. After installation, the CSL header file is under the "/include/" folder, and the CSL library is under the "/lib_3x/" folder. Using CSL Library in CCSv5 Here we take the McBSP of DM642 as an example. First, create an empty project. The creation method can be seen in the previous log. Copy the following code into main.c. /////////////////////////////////////////////////////////////////////// #define CHIP_DM642 1 #include
#include


//编写好.cmd文件后,在SECTION中定义.csldata的位置,并将下句话加入
//#pragma CODE_SECTION(CSL_Init_CFG,".csldata:CSL_Init_CFG")


static MCBSP_Config mcbspCfg0 = {
   0x00000000,        
   0x00000000,        
   0x00000000,        
   0x20000001,        
   0x00000000,        
   0x00000000,        
   0x00000000,        
   0x00000000        
};




void main(void) {
    MCBSP_Handle hMcbsp0;


hMcbsp0 = MCBSP_open(MCBSP_PORT0, MCBSP_OPEN_RESET);
MCBSP_config(hMcbsp0, &mcbspCfg0);
MCBSP_start(hMcbsp0, MCBSP_XMIT_START | MCBSP_RCV_START | MCBSP_SRGR_START | MCBSP_SRGR_FRAMESYNC, 220);
}
///////////////////////////////////////////////////////////////////////




其中“#define CHIP_DM642 1”要写到include相应CSL库之前,否则在csl.h中会找不到芯片定义,从而报错。


接下来要在工程设置中对build和link加入头文件和库的地址:
分别操作:
在Project-Properties-Build-C6000 Compiler-Include Options:
(Add dir to #include search path)中加入C6xCSL的位置,我的是"C:\ti\C6xCSL\include"。




在Project-Properties-Build-C6000 Linker-File Search Path:
(Include library file or command file as input)中加入cslDM642的库地址,我的是"C:\ti\C6xCSL\lib_3x\cslDM642.lib"
(Add to library search path), mine is "C:\ti\C6xCSL\include". Save. After that, compile and link, it should pass smoothly without any accidents. You should also customize the memory unit where the program segment is to be stored in the .cmd file, that is, define the location of .csldata in SECTION Added: For the configuration of registers, you can use the form of MCBSP_FMKS (SPCR, FREE, NO), MCBSP_FMKS is defined in the file csl_mcbsphal.h. If CCS5 issues an alarm for the corresponding statement, you can use the following method: Go to Window->Preferences->General->Editors->Text Editors->Annotations and uncheck all three checkboxes for "C/C++ Indexer Markers".

This post is from DSP and ARM Processors
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list