Other Parts Discussed in Thread: SYSBIOS
Tool/software: TI-RTOS
My aplication raises an E_dataAbort exception at line 391 of function EMAC_rxPacket of "ti\pdk_am437x_1_0_10\packages\ti\drv\emac\src\v4\emac_drv_v4.c"
#391 -> memcpy((void *)p_cslPkt_desc, (void *)p_new_pkt_desc, sizeof(EMAC_PKT_DESC_T));
E_dataAbort exception on EmacPollPkt task.
Exception occurred in ThreadType_Task.
Task handle: 0x800e30e8.
Task stack base: 0x800e3138.
Task stack size: 0x800.
R0 = 0x8004ee1c R8 = 0x80183d80
R1 = 0x0000005c R9 = 0x8003e6a0
R2 = 0x00000000 R10 = 0x00000000
R3 = 0x000030bc R11 = 0x800e3874
R4 = 0x800dab44 R12 = 0x00000060
R5 = 0x8017e738 SP(R13) = 0x800e3860
R6 = 0x800dabac LR(R14) = 0x800390f8
R7 = 0x80183dd0 PC(R15) = 0x80038364
PSR = 0x200001df
DFSR = 0x00000805 IFSR = 0x0000100e
DFAR = 0x00000018 IFAR = 0x6c1bfafc
ti.sysbios.family.arm.exc.Exception: line 205: E_dataAbort: pc = 0x80038364, lr = 0x800390f8.
xdc.runtime.Error.raise: terminating execution
The problem was observed during the integration tests. It is rare to happen. The external environment may be creating a situation that spots it.
I´ve made the follwing change in EMAC_rxPacket and the exception stopped happen.
static EMAC_PKT_DESC_T* EMAC_rxPacket(Handle hApplication, EMAC_PKT_DESC_T* p_cslPkt_desc)
{
EMAC_PKT_DESC_T* p_new_pkt_desc;
uint32_t from_port = 0U;
// MB: 2018-06-22
#if 0
uint32_t bufLen = 0U;
uint8_t* bufPtr = NULL;
#endif
from_port = ((p_cslPkt_desc->Flags & EMAC_PKT_FLAG_FROM_PORT_MASK) >> EMAC_PKT_FLAG_FROM_PORT_SHIFT) -1U;
if( from_port < EMAC_NUM_MAX_MAC_PORTS )
{
/* Allocate the PKT to replenish the RX_FREE_QUEUE queue first.
* Only provide packet to the applicaton if EMAC_ALLOC_PKT suceeds,
* otherwise re-use the packet descriptor */
p_new_pkt_desc = EMAC_ALLOC_PKT(from_port, EMAC_PKT_SIZE(from_port));
if (p_new_pkt_desc != NULL)
{
EMAC_RX_PKT(from_port, p_cslPkt_desc);
memcpy((void *)p_cslPkt_desc, (void *)p_new_pkt_desc, sizeof(EMAC_PKT_DESC_T));
}
else
{
// MB: 2018-06-22
#if 0
bufLen = p_cslPkt_desc->BufferLen;
bufPtr = p_cslPkt_desc->pDataBuffer;
memset(p_cslPkt_desc, 0, sizeof(EMAC_PKT_DESC_T));
p_cslPkt_desc->BufferLen = bufLen;
p_cslPkt_desc->pDataBuffer = bufPtr;
p_cslPkt_desc->AppPrivate = ( uint32_t)p_cslPkt_desc;
#endif
gRxDropCounter++;
}
}
return p_cslPkt_desc;
}
My test application is attached. The PDK is 1.0.10.
Regards,
Marcio.