完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
本帖最后由 一只耳朵怪 于 2018-6-19 15:27 编辑
c6657core1通过外设接收新的数据,在core1中来做信号处理;处理的结果再在core2中做数据处理,core2处理结果通过网口上报上位机。这里core1处理结果放在共享存储区,只需要core1在处理结束后发一个IPC中断来通知core2来读取数据;core2在处理结束后发一个IPC中断来通知core1开始读取新的数据。 1、core1要发中断,如何触发?2、现在core1要给core2发IPC中断,中断服务程序挂接是在哪个core里设置 ,中断服务程序是放在哪个core的工程里面? |
|
相关推荐
1个回答
|
|
请参考实例代码,C6657上事件号可能不一样,需根据datasheet进行修改
#include "ti/csl/csl_chip.h" #include "ti/csl/csl_chipAux.h" #include #include #include #include CSL_IntcContext intcContext; CSL_IntcEventHandlerRecord EventHandler[30]; CSL_IntcObj intcObj; CSL_IntcHandle hTest; CSL_IntcGlobalEnableState state; CSL_IntcEventHandlerRecord EventRecord; CSL_IntcParam vectId; #pragma DATA_SECTION(int_flag,".data"); int volatile int_flag = 0; interrupt void intIsr() [ unsigned int index = 0; unsigned int srcId = 0; unsigned int retVal = 0; switch (DNUM) [ case 0: index = 0; srcId = 1; break; case 1: index = 1; srcId = 0; break; default: printf("incorrect core numbern"); break; ] retVal = CSL_IPC_isGEMInterruptSourceSet (index, srcId); if (retVal == 0) [ //Clear INTC interrupt CSL_intcHwControl(hTest,CSL_INTC_CMD_EVTCLEAR, NULL); int_flag = 0; // Maybe continue waiting for the IPC/message ] else [ /* This function clears the interrupt source IDs by setting the SRCCx bit of * the IPC Acknowledgment Register (IPCARx) and SRCSx bit of IPC Generation Register (IPCGRx) * corresponding to the CorePac index and Source ID specified. */ CSL_IPC_clearGEMInterruptSource (index, srcId); //Clear INTC interrupt CSL_intcHwControl(hTest,CSL_INTC_CMD_EVTCLEAR, NULL); int_flag++; // Do the needful processing. ] return ; ] void IPC_Init (void) [ /* INTC module initialization */ intcContext.eventhandlerRecord = EventHandler; intcContext.numEvtEntries = 10; if (CSL_intcInit(&intcContext) != CSL_SOK) [ printf("Error: CorePac-INTC initialization failedn"); return; ] /* Enable NMIs */ if (CSL_intcGlobalNmiEnable() != CSL_SOK) [ printf("Error: CorePac-INTC global NMI enable failedn"); return; ] /* Enable global interrupts */ if (CSL_intcGlobalEnable(&state) != CSL_SOK) [ printf ("Error: CorePac-INTC global enable failedn"); return; ] /* Open the INTC Module for Vector ID: 4 and Event ID: 91 (IPCn in C6678)*/ vectId = CSL_INTC_VECTID_4; hTest = CSL_intcOpen (&intcObj, 90/*91*/, &vectId , NULL); if (hTest == NULL) [ printf("Error: CorePac-INTC Open failedn"); return; ] /* Register an call-back handler which is invoked when the event occurs. */ EventRecord.handler = &intIsr; EventRecord.arg = 0; if (CSL_intcPlugEventHandler(hTest,&EventRecord) != CSL_SOK) [ printf("Error: CorePac-INTC Plug event handler failedn"); return; ] /* Enabling the events. */ if (CSL_intcHwControl(hTest,CSL_INTC_CMD_EVTENABLE, NULL) != CSL_SOK) [ printf("Error: CorePac-INTC CSL_INTC_CMD_EVTENABLE command failedn"); return; ] ] void IPC_Trigger (void) [ unsigned int index = 0; unsigned int srcId = 0; switch (DNUM) [ case 0: index = 1; srcId = 0; /*This function sets the IPCG bit of the IPC Generation Register (IPCGRx) * to create an inter-DSP pulse to the CorePac corresponding to the index * specified here. This API also configures the source ID for this * interrupt by setting the SRCSx bit of the IPCGRx register based on * the source ID specified. */ CSL_IPC_genGEMInterrupt(index,srcId); //IPC generation from Core0 to Core1 break; case 1: index = 0; srcId = 1; CSL_IPC_genGEMInterrupt(index,srcId); //IPC generation from Core1 to Core0 break; default: printf("incorrect core numbern"); break; ] ] void main(void) [ unsigned int i=0; IPC_Init(); //add some delay here to make sure both cores finish IPC_Init() for (i=0;i<20000;i++); IPC_Trigger(); while (int_flag != 1) []; printf("IPC interrupt occurred on Core %dn", DNUM); IPC_Trigger(); while (int_flag != 2) []; printf("IPC interrupt occurred on Core %d, again.n", DNUM); printf("end of testn"); return; ] |
|
|
|
只有小组成员才能发言,加入小组>>
2913个成员聚集在这个小组
加入小组369 浏览 1 评论
564 浏览 2 评论
NA555DR VCC最低电压需要在5V供电,为什么用3.3V供电搭了个单稳态触发器也使用正常?
809 浏览 3 评论
MSP430F249TPMR出现高温存储后失效了的情况,怎么解决?
677 浏览 1 评论
对于多级放大威廉希尔官方网站 板,在PCB布局中,电源摆放的位置应该注意什么?
1149 浏览 1 评论
AT32F407在USART2 DMA发送数据时,接包接到了要发送的数据,程序还是处于等待传输完成的标识判断中,为什么?
108浏览 29评论
511浏览 23评论
请问下tpa3220实际测试引脚功能和官方资料不符,哪位大佬可以帮忙解答下
273浏览 20评论
请教下关于TAS5825PEVM评估模块原理图中不太明白的地方,寻求答疑
224浏览 14评论
两个TMP117传感器一个可以正常读取温度值,一个读取的值一直是0,为什么?
83浏览 13评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-1-4 15:19 , Processed in 0.850572 second(s), Total 47, Slave 41 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (威廉希尔官方网站 图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号