【TI毫米波雷达笔记】IWR6843AOP的CCS工程模板创建(DSS)
如果还不会配置MSS 则看我的文章:
blog.csdn.net/weixin_53403301/article/details/132274755
大体上与MSS创建也差不多 SDK我用的3.5版本
DSS工程模板:
download.csdn.net/download/weixin_53403301/88215478
在CCS里面新建工程 选择芯片 调试用设备和typical工程类型
Next之后要求选择Target和Platform,在页面下方处如下填写:
Target: ti.targets.elf.C674
Platform: ti.platforms.c6x:IWR68XX:false:600
Build-profile任意选择
建立好工程以后 在工程属性的general中也可以进行更改 只不过改到release版本以后需要重新配置各个设置
另外 在products中 点击add 添加mmwave sdk DSPLIB和sysconfig 如图所示
这样工程就创建好了。在左侧的Project Explorer中,可以看到。接下来,我们需要对工程的属性进行调整,并覆盖一些工程自带的文件来满足开发需求。
其中 main.h 是我自己添加的
代码如下:
/*
* ======== main.c ========
*/
#include "main.h"
/*
* ======== taskFxn ========
*/
Void taskFxn(UArg a0, UArg a1)
{
System_printf("enter taskFxn()\n");
Task_sleep(10);
System_printf("exit taskFxn()\n");
System_flush(); /* force SysMin output to console */
}
/*
* ======== main ========
*/
Int main()
{
Task_Params taskParams;
int32_t errCode;
SOC_Handle socHandle;
SOC_Cfg socCfg;
/* Initialize the SOC confiugration: */
memset ((void *)&socCfg, 0, sizeof(SOC_Cfg));
/* Populate the SOC configuration: */
socCfg.clockCfg = SOC_SysClock_BYPASS_INIT;
/* Initialize the SOC Module: This is done as soon as the application is started
* to ensure that the MPU is correctly configured. */
socHandle = SOC_init (&socCfg, &errCode);
if (socHandle == NULL)
{
System_printf ("Error: SOC Module Initialization failed [Error code %d]\n", errCode);
return -1;
}
/* Initialize the Task Parameters. */
Task_Params_init(&taskParams);
taskParams.stackSize = 4*1024;
Task_create(taskFxn, &taskParams, NULL);
/* Start BIOS */
BIOS_start();
return 0;
}
/*
* main.h
*
* Created on: 2023年8月14日
* Author: ZHOU
*/
#ifndef MAIN_H_
#define MAIN_H_
#include
#include
#include
#include
#include
#include
#include
/* BIOS/XDC Include Files. */
/* SYS/BIOS所使用的头文件 */
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
/* MMWave SDK Include Files: */
/* SDK头文件 */
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
/* Data path Include Files */
#include //dsp模式
//#include //hwa模式
/* Demo Profiling Include Files */
#include
#include
#endif /* MAIN_H_ */
从
打开**
Build->XDCtools->Advanced Options中,页面下方的Additional complier options,填入"–enum_type=int",如下
一定要注意–是两个英文的横杠(减号)
3. Build->C6000 Complier->Include Options,右侧上方的搜索路径列表,点击带有绿色加号的图标添加,添加目录 ${MMWAVE_SDK_DIR}/packages
同样的 添加另外三个目录:
${DSPLIB_C674x_DIR}/packages
${MATHLIB_C674x_DIR}/packages
${DSPLIB_C64Px_DIR}/packages
4. mmWave SDK提供的库在设计的时候考虑了整个系列雷达芯片的兼容性,因此库内有多套代码,通过宏定义来区分需要使用哪一段代码进行编译。为此,我们需要向编译器的预定义符号里添加一些用来表示当前目标芯片的宏。
Build->C6000 Complier->Prodefined Symbols,右侧上方添加以下符号(直接复制下面的内容,然后点击框内原先已有的宏,按Ctrl+V即可一次性直接粘贴进去)
SOC_XWR68XX
SUBSYS_DSS
PLATFORMES2
MMWAVE_L3RAM_NUM_BANK=6
MMWAVE_SHMEM_TCMA_NUM_BANK=0
MMWAVE_SHMEM_TCMB_NUM_BANK=0
MMWAVE_SHMEM_BANK_SIZE=0x20000
DOWNLOAD_FROM_CCS
DebugP_ASSERT_ENABLED
_LITTLE_ENDIAN
OBJDET_NO_RANGE
AOP
MMWAVE_L3_CODEMEM_SIZE=0x100
MMWAVE_MSSUSED_L3RAM_SIZE=0x90000
Build->C6000 Linker->File Search Path,上方添加如下内容(一样可以直接复制过去)
dsplib.ae64P
mathlib.ae674
libmathutils.ae674
libsoc_xwr68xx.ae674
libosal_xwr68xx.ae674
libcrc_xwr68xx.ae674
libmailbox_xwr68xx.ae674
libmmwavelink_xwr68xx.ae674
libmmwave_xwr68xx.ae674
libedma_xwr68xx.ae674
libadcbuf_xwr68xx.ae674
libcbuff_xwr68xx.ae674
libhsiheader_xwr68xx.ae674
libdpm_xwr68xx.ae674
libdpedma_hwa_xwr68xx.ae674
libmmwavealg_xwr68xx.ae674
rts6740_elf.lib
下方添加如下内容,其中MMWAVE_SDK_DIR和另外三个DIR变量和前面设定Linked Resources时添加的变量名保持一致即可。
${MMWAVE_SDK_DIR}/packages/ti/control/mmwave/lib
${MMWAVE_SDK_DIR}/packages/ti/control/mmwavelink/lib
${MMWAVE_SDK_DIR}/packages/ti/control/dpm/lib
${MMWAVE_SDK_DIR}/packages/ti/drivers/adcbuf/lib
${MMWAVE_SDK_DIR}/packages/ti/drivers/crc/lib
${MMWAVE_SDK_DIR}/packages/ti/drivers/dma/lib
${MMWAVE_SDK_DIR}/packages/ti/drivers/edma/lib
${MMWAVE_SDK_DIR}/packages/ti/drivers/esm/lib
${MMWAVE_SDK_DIR}/packages/ti/drivers/gpio/lib
${MMWAVE_SDK_DIR}/packages/ti/drivers/hwa/lib
${MMWAVE_SDK_DIR}/packages/ti/drivers/mailbox/lib
${MMWAVE_SDK_DIR}/packages/ti/drivers/osal/lib
${MMWAVE_SDK_DIR}/packages/ti/drivers/pinmux/lib
${MMWAVE_SDK_DIR}/packages/ti/drivers/soc/lib
${MMWAVE_SDK_DIR}/packages/ti/drivers/uart/lib
${MMWAVE_SDK_DIR}/packages/ti/utils/cli/lib
${MMWAVE_SDK_DIR}/packages/ti/utils/mathutils/lib
${MMWAVE_SDK_DIR}/packages/ti/datapath/dpu/rangeproc/lib
${MMWAVE_SDK_DIR}/packages/ti/datapath/dpedma/lib
${MMWAVE_SDK_DIR}/packages/ti/drivers/cbuff/lib
${MMWAVE_SDK_DIR}/packages/ti/utils/hsiheader/lib
${MMWAVE_SDK_DIR}/packages/ti/drivers/qspi/lib
${MMWAVE_SDK_DIR}/packages/ti/drivers/qspiflash/lib
${MMWAVE_SDK_DIR}/packages/ti/utils/libsleep/lib
${MMWAVE_SDK_DIR}/packages/ti/utils/testlogger/lib
${MMWAVE_SDK_DIR}/packages/ti/alg/mmwavelib/lib
${DSPLIB_C64Px_DIR}/packages/ti/dsplib/lib
${MATHLIB_C674x_DIR}/packages/ti/mathlib/lib
${DSPLIB_C674x_DIR}/packages/ti/dsplib/lib
7. 同样地,在此处也需要填入一些预定义的符号,比如c674x_linker.cmd文件中用到的几个宏的大小。
Build->C6000 Linker->Advanced Options->Command File PreProcess,上方添加
MMWAVE_L3RAM_NUM_BANK=6
MMWAVE_SHMEM_TCMA_NUM_BANK=0
MMWAVE_SHMEM_TCMB_NUM_BANK=0
MMWAVE_SHMEM_BANK_SIZE=0x20000
其中 如果需要指定L3代码和MSS用的大小 则配置:
MMWAVE_L3_CODEMEM_SIZE=0x100
MMWAVE_MSSUSED_L3RAM_SIZE=0x90000
systemHeap : {} >> L2SRAM_UMAP0 | L2SRAM_UMAP1
之后再编译就不会出现问题了。