This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS570LC4357: 使用LWIP协议栈 emac功能收发数据,发送数据始终正常,接收数据在接收一段时间后不再进入中断接收

Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN

你好,我在使用TMS570lc457芯片通过emac模块收发数据。在测试的过程中发现在初始化后一段时间内收发都正常,但是在通道0的接收缓存区计数寄存器计数到0x000000CD后再发送数据不再进入接收中断。(我使用通道0来接收数据并使能了中断)同时发送功能始终正常。您能帮我分析一下为什么emac模块不再中断接收吗?

如图:

我的接收中断函数如下:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#pragma INTERRUPT(EMACCore0RxIsr, IRQ)
uint32 countrxisr = 0;
void EMACCore0RxIsr(void)
{
char* tmpptr;
uint32_t CurFinishCP = HWREG(EMAC_BASE + EMAC_RXCP(0)); /**/
EMACDesc_t* RXCP = EMAC_SL_CurRXCP;/**/
MACFrame_t* MacFramePtr = NULL;
ECTRL_C0RXEN = 0U; /**/
HWREG(EMAC_BASE + EMAC_RXCP(0)) = CurFinishCP; /*CP*/
HWREG(EMAC_BASE + EMAC_MACEOIVECTOR) = 1U; /**/
if ( countrxisr == 0U ) //first frame
{
HWREG(EMAC_BASE + EMAC_RXHDP(0)) = CurFinishCP;
EMAC_SL_CurRXCP = (EMACDesc_t*)CurFinishCP;
RXCP = (EMACDesc_t*)CurFinishCP;
countrxisr = 1;
}/**/
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

我的LWIP的初始化函数是这样写的:

void EMAC_LwIP_init (uint8_t * macAddress)
{
unsigned int ipAddr;
uint32 emacCtrlBase = 0xFCF78800U;
uint32 emacBase = 0xFCF78000U;

EMACInit(emacCtrlBase,emacBase);
IntMasterIRQEnable();//中断

/* for static IP address. Change address as required, and uncomment the previous statement. */
uint8 ip_addr[4] = { 172, 22, 1, 1 };
uint8 netmask[4] = { 255, 255, 255, 0 };
uint8 gateway[4] = { 172, 22, 1, 1 }; //网关 路由器端口
ipAddr = lwIPInit(0, macAddress,
*((uint32_t *)ip_addr),
*((uint32_t *)netmask),
*((uint32_t *)gateway),
IPADDR_USE_STATIC );