cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 can't transmit using ethernet

khorght
Associate II
Posted on August 02, 2013 at 22:54

Hi to Alli'm trying to get to work the ethernet periphery in MCU, i can successfully init DP83848i , can read regiter, and even(i think) receive packets, but mcu does not transmit any packets outside. the code i've used as a sample is here_h_t_t_p_://www.sendspace.com/file/8guchn, sorry there are plenty of files and i've forgot where i found it. this is standart example except that in my own code a've removed the part related to INT pin, uart, lcd and leds. i've tryed lwip with no luck andtryed to simply send dummy packet like below and sniff it with wireshark (the function is placed in ethernetif.c with all DMA desctiptors definitions)

if ((DMATxDscrTab->Status & ETH_DMARxDesc_OWN) == 0)

{

ETH_DMATransmissionCmd(DISABLE);

Tx_Buff[0][0]=0xff;

Tx_Buff[0][1]=0xff;

Tx_Buff[0][2]=0xff;

Tx_Buff[0][3]=0xff;

Tx_Buff[0][4]=0xff;

Tx_Buff[0][5]=0xff;

// dst addr

Tx_Buff[0][6]=0x00;

Tx_Buff[0][7]=0x22;

Tx_Buff[0][8]=0x15;

Tx_Buff[0][9]=0xf4;

Tx_Buff[0][10]=0xe7;

Tx_Buff[0][11]=0x9a;

// pkt length

Tx_Buff[0][6]=0x0;

Tx_Buff[0][7]=0x55;

DMATxDscrTab->Status = ETH_DMARxDesc_OWN | ETH_DMATxDesc_TCH | ETH_DMATxDesc_TTSE |

ETH_DMATxDesc_LS | ETH_DMATxDesc_FS;

ETH_DMATransmissionCmd(ENABLE);

while(ETH_GetDMAFlagStatus(ETH_DMA_FLAG_T) == SET);

}

but the if() is always false and enabled Tx interrupt never fires,i've tryed to enable Rx interrupt and there are some reaction, i think mostly arp requests and junk in may network from damn torrents, so it seems mcu receiving something but never transmits. what am i doing wrong and is there any good info except really poor pdf on this site mostly doubling comments inside sourcecode without any snippets.

thanx.and good luck for all in developing.
0 REPLIES 0