Other Parts Discussed in Thread: HALCOGEN, DP83640
Hello, I'm trying to enable the EMAC/MDIO interfaces in a RM48 HDK.
I've follwed the http://processors.wiki.ti.com/index.php/HALCoGen_Ethernet_Driver_and_lwIP_Integration_Demonstration
"Programming Sequence using HALCoGen generated drivers", using the LwIp code as a base, but not enabling LwIP, just phy and emac.
I will run other protocol over ethernet rather than IP, so I don't need it. But I'm not able to transmit a packet. I Have made a simple example using a static buffer just to test it.
----------------------
...
int eth_transmit(uint8_t* buf,uint32_t length)
{
if( length > 1500 )
return -1;
else
{
tx_buffer->next = NULL;
tx_buffer->bufptr = buf;
tx_buffer->bufoff_len = length;
tx_buffer->flags_pktlen = length;
tx_buffer->flags_pktlen |= EMAC_DSC_FLAG_EOP | EMAC_DSC_FLAG_SOP;
EMACTxHdrDescPtrWrite(MDIO_0_BASE, (unsigned int)(tx_buffer), 1);
return 0;
}
}
uint8_t vec[80] = { 0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,
0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,
0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,
0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,
0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,
0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,
0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,
0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,
0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,
0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,
};
int eth_example_send()
{
eth_transmit(vec,80);
return 0;
}
---------------------------
When I run eth_example_send(), I got a Data Abort error from the processor in line of the emac.c file :
------
valHDPbefWrite = HWREG(emacBase + EMAC_TXHDP(channel));
------
What I'm doing wrong ? I'm missing something ?
Thanks.