完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
工程师好! 我使用的是6678 mcsdk中example 的Helloworld例程,源程序中已有Ethernet interrupt(请见下面图1). 我自己在源程序中加入了外部中断,结果发现两个中断会产生中断嵌套,结果出现了中断堆栈溢出的问题。 中断堆栈溢出后,程序会停在Hwi_Stack.c文件中的ti_sy***ios_hal_Hwi_checkStack() 函数(请见图2) 我想问一下: 1.如何能够避免中断嵌套的问题呢? 可否关闭Ethernet interrupt ?应该如何关闭呢? 2.如果需要两个中断同时存在,则需要如何设置呢?(包括优先级等) 非常感谢! 截图如下: 图1 程序中显示已有Ethernet interrupt 图2 中断堆栈溢出后,程序会停在Hwi_Stack.c文件中的ti_sy***ios_hal_Hwi_checkStack() 函数 |
|
相关推荐
6 个讨论
|
|
zbb9612 发表于 2018-8-6 07:07 我换个问法吧,就是说,我在我的RTOS 工程中使用了外部中断方式来启动TCP协议中的send发送,例程参考的是cpintc.c。 感觉中断设置的不正确,使得程序在send()处阻塞。 我的中断初始化程序及中断服务程序如下,请看一下是否有问题呢? 另外我看到对于RTOS需要在SYS/BIOS中设置中断,我采用CSL API函数设置可以吗? 若不可以,有无相关RTOS配置中断的例程呢? 非常感谢! 中断初始化程序如下”: void Intc_Init(void) [ printf ("Debug: GEM-INTC Configuration...n"); /* INTC module initialization */ intcContext.eventhandlerRecord = EventHandler; intcContext.numEvtEntries = 10; if (CSL_intcInit(&intcContext) != CSL_SOK) [ printf("Error: GEM-INTC initialization failedn"); return; ] /* Enable NMIs */ if (CSL_intcGlobalNmiEnable() != CSL_SOK) [ printf("Error: GEM-INTC global NMI enable failedn"); return; ] /* Enable global interrupts */ if (CSL_intcGlobalEnable(&state) != CSL_SOK) [ printf ("Error: GEM-INTC global enable failedn"); return; ] /* Open the INTC Module for Vector ID: 4 and Event ID: 88 (C6678) GPIO_14 * Refer to the interrupt architecture and mapping document for the Event ID (INTC0_OUT3)*/ vectId = CSL_INTC_VECTID_4; hTest = CSL_intcOpen (&intcObj, 88, &vectId , NULL); if (hTest == NULL) [ printf("Error: GEM-INTC Open failedn"); return; ] /* Register an call-back handler which is invoked when the event occurs. */ EventRecord.handler = &test_isr_handler; EventRecord.arg = 0; if (CSL_intcPlugEventHandler(hTest,&EventRecord) != CSL_SOK) [ printf("Error: GEM-INTC Plug event handler failedn"); return; ] /* Enabling the events. */ if (CSL_intcHwControl(hTest,CSL_INTC_CMD_EVTENABLE, NULL) != CSL_SOK) [ printf("Error: GEM-INTC CSL_INTC_CMD_EVTENABLE command failedn"); return; ] printf ("Debug: GEM-INTC Configuration Completedn"); ] 中断服务程序如下: void test_isr_handler (void* handle) [ SPI_Read_Buffer(); l++; if(l == (ARRAYSIZE/27)) [ l = 0; flag = 1; ] ] |
|
|
|
|
|
|
|
zbb9612 发表于 2018-8-6 07:07 我换个问法吧,就是说,我在我的RTOS 工程中使用了外部中断方式来启动TCP协议中的send发送,例程参考的是cpintc.c。 感觉中断设置的不正确,使得程序在send()处阻塞。 我的中断初始化程序及中断服务程序如下,请看一下是否有问题呢? 另外我看到对于RTOS需要在SYS/BIOS中设置中断,我采用CSL API函数设置可以吗? 若不可以,有无相关RTOS配置中断的例程呢? 非常感谢! 中断初始化程序如下: void Intc_Init(void) [ printf ("Debug: GEM-INTC Configuration...n"); /* INTC module initialization */ intcContext.eventhandlerRecord = EventHandler; intcContext.numEvtEntries = 10; if (CSL_intcInit(&intcContext) != CSL_SOK) [ printf("Error: GEM-INTC initialization failedn"); return; ] /* Enable NMIs */ if (CSL_intcGlobalNmiEnable() != CSL_SOK) [ printf("Error: GEM-INTC global NMI enable failedn"); return; ] /* Enable global interrupts */ if (CSL_intcGlobalEnable(&state) != CSL_SOK) [ printf ("Error: GEM-INTC global enable failedn"); return; ] /* Open the INTC Module for Vector ID: 4 and Event ID: 88 (C6678) GPIO_14 * Refer to the interrupt architecture and mapping document for the Event ID (INTC0_OUT3)*/ vectId = CSL_INTC_VECTID_4; hTest = CSL_intcOpen (&intcObj, 88, &vectId , NULL); if (hTest == NULL) [ printf("Error: GEM-INTC Open failedn"); return; ] /* Register an call-back handler which is invoked when the event occurs. */ EventRecord.handler = &test_isr_handler; EventRecord.arg = 0; if (CSL_intcPlugEventHandler(hTest,&EventRecord) != CSL_SOK) [ printf("Error: GEM-INTC Plug event handler failedn"); return; ] /* Enabling the events. */ if (CSL_intcHwControl(hTest,CSL_INTC_CMD_EVTENABLE, NULL) != CSL_SOK) [ printf("Error: GEM-INTC CSL_INTC_CMD_EVTENABLE command failedn"); return; ] printf ("Debug: GEM-INTC Configuration Completedn"); ] 中断服务程序如下: void test_isr_handler (void* handle) [ SPI_Read_Buffer(); l++; if(l == (ARRAYSIZE/27)) [ l = 0; flag = 1; ] ] |
|
|
|
|
|
|
|
zbb9612 发表于 2018-8-6 07:07 我换个问法吧,就是说,我在我的RTOS 工程中使用了外部中断方式来启动TCP协议中的send发送,例程参考的是cpintc.c。 感觉中断设置的不正确,使得程序在send()处阻塞。 我的中断初始化程序及中断服务程序如下,请看一下是否有问题呢? 另外我看到对于RTOS需要在SYS/BIOS中设置中断,我采用CSL API函数设置可以吗? 若不可以,有无相关RTOS配置中断的例程呢? 非常感谢! 中断初始化程序如下: void Intc_Init(void) [ printf ("Debug: GEM-INTC Configuration...n"); /* INTC module initialization */ intcContext.eventhandlerRecord = EventHandler; intcContext.numEvtEntries = 10; if (CSL_intcInit(&intcContext) != CSL_SOK) [ printf("Error: GEM-INTC initialization failedn"); return; ] /* Enable NMIs */ if (CSL_intcGlobalNmiEnable() != CSL_SOK) [ printf("Error: GEM-INTC global NMI enable failedn"); return; ] /* Enable global interrupts */ if (CSL_intcGlobalEnable(&state) != CSL_SOK) [ printf ("Error: GEM-INTC global enable failedn"); return; ] /* Open the INTC Module for Vector ID: 4 and Event ID: 88 (C6678) GPIO_14 * Refer to the interrupt architecture and mapping document for the Event ID (INTC0_OUT3)*/ vectId = CSL_INTC_VECTID_4; hTest = CSL_intcOpen (&intcObj, 88, &vectId , NULL); if (hTest == NULL) [ printf("Error: GEM-INTC Open failedn"); return; ] /* Register an call-back handler which is invoked when the event occurs. */ EventRecord.handler = &test_isr_handler; EventRecord.arg = 0; if (CSL_intcPlugEventHandler(hTest,&EventRecord) != CSL_SOK) [ printf("Error: GEM-INTC Plug event handler failedn"); return; ] /* Enabling the events. */ if (CSL_intcHwControl(hTest,CSL_INTC_CMD_EVTENABLE, NULL) != CSL_SOK) [ printf("Error: GEM-INTC CSL_INTC_CMD_EVTENABLE command failedn"); return; ] printf ("Debug: GEM-INTC Configuration Completedn"); ] 中断服务程序如下: void test_isr_handler (void* handle) [ SPI_Read_Buffer(); l++; if(l == (ARRAYSIZE/27)) [ l = 0; flag = 1; ] ] |
|
|
|
|
|
|
|
看服务淡口味 发表于 2018-8-6 07:54 不可以在bios工程中使用CSL配置INTC,关于Bios及非Bios下中断配置参考: http://processors.wiki.ti.com/index.php/Configuring_Interrupts_on_Keystone_Devices |
|
|
|
|
|
|
|
只有小组成员才能发言,加入小组>>
553 浏览 0 评论
1616 浏览 0 评论
2049 浏览 0 评论
为啥BQ7693003DBTR芯片在和BQ769X0盒子通讯时收不到信号?
1516 浏览 0 评论
DSP 28027F 开发板 XDS100v2调试探针诊断日志显示了 Error -150 (SC_ERR_FTDI_FAIL)如何解决
1342 浏览 0 评论
AT32F407在USART2 DMA发送数据时,接包接到了要发送的数据,程序还是处于等待传输完成的标识判断中,为什么?
1759浏览 29评论
2786浏览 23评论
请问下tpa3220实际测试引脚功能和官方资料不符,哪位大佬可以帮忙解答下
1726浏览 20评论
请教下关于TAS5825PEVM评估模块原理图中不太明白的地方,寻求答疑
1636浏览 14评论
两个TMP117传感器一个可以正常读取温度值,一个读取的值一直是0,为什么?
1647浏览 13评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-2 23:49 , Processed in 1.245201 second(s), Total 57, Slave 47 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
4022