一、DM8168及本文简介
将helloWorld添加到 INCLUDE_EXERNAL_INTERFACES的列表
INCLUDE_EXERNAL_INTERFACES= bios xdc ipc syslink iss hdvpss ipnc_rdk fc xdais h264enc h264dec swosdhelloWorldedma3lld mpeg4enc
添加‘Makefile’ 文件和include directory:
INCDIR += $(MODULE_SRC_BASE_PATH)/alg/helloWorld
include $(MODULE_SRC_BASE_PATH)/alg/helloWorldAlg/SRC_FILES.MK
3.在\mcfw\src_bios6\links_c6xdsp\system\system_c6xdsp.c
添加helloWorldLink头文件包含
#include<mcfw/interfaces/link_api/helloWorldLink.h>
在System_initLinks() 函数中添加HelloWorldLink_init(),System_deInitLinks() 添加HelloWorldLink_deInit()
4.在
ipnc_rdk\ipnc_mcfw\mcfw\interfaces\link_api\system_linkId.h
为helloWorld link在DSPcore一端定义link ids
#defineSYSTEM_LINK_ID_HELLOWORLD_0 DSP_LINK(SYSTEM_LINK_COMMON_LINKS_MAX_ID+4) (由于提示procId < SYSTEM_PROC_MAX : failed !!!)
#defineSYSTEM_LINK_ID_HELLOWORLD_START (SYSTEM_LINK_ID_HELLOWORLD_0)
#defineSYSTEM_LINK_ID_HELLOWORLD_END (SYSTEM_LINK_ID_HELLOWORLD_0)
#defineSYSTEM_LINK_ID_HELLOWORLD_COUNT (SYSTEM_LINK_ID_ALG_END - \
SYSTEM_LINK_ID_ALG_START)+ 1
5在ipnc_rdk\ipnc_mcfw\mcfw\src_bios6\links_common\system\system_priv_common.h
定义任务优先级和栈的大小
#defineHELLOWORLD_LINK_TSK_PRI (2)
#defineHELLOWORLD_LINK_TSK_STACK_SIZE (SYSTEM_DEFAULT_TSK_STACK_SIZE)
6在ipnc_rdk\ipnc_mcfw\mcfw\src_linux\mcfw_api\ti_vsys_priv.h
包含头文件
All header filesunder interface folder needs to be included in this file. Include thehelloWorldLink header file here
#include<mcfw/interfaces/link_api/helloWorldLink.h>
7在ipnc_rdk\ipnc_mcfw\mcfw\src_bios6\links_c6xdsp\SRC_FILES.MK
Add the helloWorlddirectory to the list of SRCDIR
SRCDIR +=links_c6xdsp/system links_c6xdsp/utils/src \
links_c6xdsp/alg_linklinks_c6xdsp/alg_link/swosd links_c6xdsp/alg_link/scd \
links_c6xdsp/valinks_c6xdsp/helloWorld
SRCS_HELLOWORLD =helloWorldLink_tsk.c helloWorldLink_priv.c
SRCS_c6xdsp +=$(SRCS_SYSTEMDSP) $(SRCS_UTILS) $(SRCS_ALGLINK) $(SRCS_OSDLINK) $(SRCS_SCDLINK)$(SRCS_VALINK)$(SRCS_HELLOWORLD)
8.修改内存:
mcfw\src_bios6\cfg\ti81xx\config_2G.bld.(文件名对应内存大小)
找到下面代码段,将LINUX_SIZE的大小调小一点分出来给DSP_CODE_SIZE、DSP_DATA_SIZE
/* first 512MB */
LINUX_SIZE = 128*MB;
SR1_SIZE = 336.5*MB;
SR3_INTRADUCATI_IPC_SIZE = 124*KB;
VIDEO_M3_CODE_SIZE = 2.5*MB;
VIDEO_M3_DATA_SIZE = 12*MB;
DSS_M3_CODE_SIZE = 1.5*MB;
DSS_M3_DATA_SIZE = 17*MB;
DSP_CODE_SIZE = 900*KB;
DSP_DATA_SIZE = 13.5*MB;
9.编译,因为修改了原有的makefile文件,所以按原有编译方法,即可直接编译进库,编出的库所在目录一般在target中的firmware中名字为dvr_rdk_fw_c6xdsp.xe674的库。
如果想运行此算法,还需仿照OSD的初始化与调用,来进行Helloworld算法的调用。
执行结果:
会在终端不停的打印:HELLO WORLD ALG: Process frame
由HELLORWORLDALG_TI_process中 "Vps_printf("HELLO WORLD ALG: Process frame\n");"输出
编译中可能遇到的错误:
1.
"/home/dm8168/dvr_rdk/../dvr_rdk/build/dvr_rdk/obj/ti816x-evm/c6xdsp/debug/dvr_rdk_configuro/linker_mod.cmd",line 242: error:
placement fails for object ".switch", size 0x32a (page0). Available
ranges:
DDR3_DSP size: 0xd80000 unused: 0xc max hole: 0x4
"/home/dm8168/dvr_rdk/../dvr_rdk/build/dvr_rdk/obj/ti816x-evm/c6xdsp/debug/dvr_rdk_configuro/linker_mod.cmd",line 230: error:
placement fails for object "GROUP_1", size 0x13c (page0). Available
ranges:
DDR3_DSP size: 0xd80000 unused: 0xc max hole: 0x4
warning: entry-point symbol other than"_c_int00" specified:
"ti_sysbios_family_c64p_Hwi0"
error: errors encountered during linking;
"/home/dm8168/dvr_rdk/../dvr_rdk/build/dvr_rdk/bin/ti816x-evm/dvr_rdk_c6xdsp
_debug.xe674" not built
make[2]: ***[/home/dm8168/dvr_rdk/../dvr_rdk/build/dvr_rdk/bin/ti816x-evm/dvr_rdk_c6xdsp_debug.xe674]Error 1
make[1]: *** [apps] Error 2
make: *** [dvr_rdk_bios6] Error 2
####
#### [DM816X_ETV] platform build [] ERROR!!!
内存不足,修改内存。
Top level memory requirement for DSP code and data size is done in mcfw\src_bios6\cfg\ti81xx\config_<DDRsize>M.bld. Please refer to appnote on memoryMap for further details on changing the size of these sections as per your DSP algorithms requirement.
2.
需要首先编译内核
3.
[m3vpss ] 13780: CAPTURE: Start Done !!!
[m3vpss ] 13907: SYSTEM: Opening MsgQ [HOST_MSGQ] ...
[c6xdsp ] 10802: Assertion @ Line: 61 inlinks_common/system/system_linkApi.c:
procId < SYSTEM_PROC_MAX :failed !!!
[m3vpss ] 113897: CAPTURE: Stop in progress !!!
[m3vpss ] 113897: CAPTURE: Stop Done !!!
解决由于link之间没有连接设置正确的prelink和nextlink!!
在chain中忘记设置!!!!pcFramesInDspPrm.baseCreateParams.outQueParams[0].nextLink=helloId;
(http://blog.csdn.net/guo8113/article/details/20149191转载请注明)
=======================================================================================================
http://blog.csdn.net/guo8113/article/details/20149191转载请注明
有任何问题和意见可以在评论区给我留言,我们一起探讨和学习。
今天了解到大部分资料可能来源于NDA文档,所以不能讲的太细,想了解
更多,请联系TI FAE或者代理商。本人纯属研究,不存在商业目的,但愿
没有泄露商业秘密。
=======================================================================================================