cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F107 ethernet interrupt problem

wfu
Associate
Posted on December 17, 2012 at 19:55

I am a newbie of STM32 developer. I use STM32 F107 in one of my self-designed boards. Several weeks ago, I bought

STM3210c Evaluation board, and I use the downloaded stm32f107_eth_lwIP, it works well. But when I port the code to my boards. I found following problems:

1) When I connect to a computer using a cross-over cable, the network seems good. it displays 100M/Full duplex mode. But I found there are only output data from pc, no received data from my boards. when I ping my boards. it returned: destination unreachable.

2) I begin to debug the firmware (the firmware is the same as stm32f107_eth_lwIP,except I change some of the physical register address definition in ''stm32_ETH.h'', I use Lan8710 as the physical layer IC ), and find ETH_IRQHandler never being called. I measured the signal on MII, clock, Txenable & data, Err etc, all works well.

I add some code in the mail loop to read DMASR

,

DMAIER

,

DMACHRDR values, and find DMAIER=0x1004;

DMASR=0x00660404. From DMASR, bit 6 is set, so it seems data is received, but bit 16 is not set, which is the reason not trigger the interrupt, from DMAIER value, data receiving interrput is enabled. So why bit 16 is not set?

According to bit 16 definition:

Bit 16 NIS: Normal interrupt summary

 

The normal interrupt summary bit value is the logical OR of the following when the

 

corresponding interrupt bits are enabled in the ETH_DMAIER register:

 

– ETH_DMASR [0]: Transmit interrupt

 

– ETH_DMASR [2]: Transmit buffer unavailable

 

– ETH_DMASR [6]: Receive interrupt

 

– ETH_DMASR [14]: Early receive interrupt

 

Only unmasked bits affect the normal interrupt summary bit. This is a sticky bit and it must be cleared (by writing a 1 to this bit) each time a corresponding

 

Bit 16 is only reset in ETH_IRQHandler and ETH_IRQHandler never being executed.

I have 2 questions.

1) is there a global interrupt in the stm32f107, which need to be enabled?

2) I did not disable the code that runs LCD controller, IO expander , button and keys. My board may use these pins for other use, is this the cause for above problem?

Thanks, any idea shed on above problem will be appreciated, I am frustrated to get this to work.

 

 

 

1 REPLY 1
wfu
Associate
Posted on December 18, 2012 at 21:28

This problem is resolved, the reason is RX_DV signal is route wrong. In the description of problem, there are also a mistake:

DMASR=0x00660404

, bit 6 is 0, receive status is not set. After I re-route the RX_DV, Ethernet works.

Thanks all you guys!