cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F439II RMII ethernet not working

christophe1
Associate II
Posted on December 16, 2014 at 14:15

My company has developed a board with a STM32F207IG and RMII ethernet which is working fine. Now they have given me the same board with a STM32F439II fitted, and here I can not get the ethernet to work. The CPUs should be pin compatible. After enabling the receive all packets and forward error frames flags, I can see the DMA writing in the receive buffer, but the data is not good. I have tried to use the same clock settings as the first board, but the error remained.

Fyi : 

IDE : Raisonce Ride 7 v7.48.13.0324, Rkit-ARM v1.52.13.0324

LwIP v1.4.1

Standard Peripheral Library : STM32F4xx_StdPeriph_Driver_v1.4.0 (project dates from before Cube)

  ETH_StructInit(&ETH_InitStructure);

  /* Fill ETH_InitStructure parametrs */

  /*------------------------   MAC   -----------------------------------*/

  ETH_InitStructure.ETH_AutoNegotiation = ETH_AutoNegotiation_Enable;

  ETH_InitStructure.ETH_LoopbackMode = ETH_LoopbackMode_Disable;

  ETH_InitStructure.ETH_RetryTransmission = ETH_RetryTransmission_Disable;

  ETH_InitStructure.ETH_AutomaticPadCRCStrip = ETH_AutomaticPadCRCStrip_Disable;

  ETH_InitStructure.ETH_ReceiveAll = ETH_ReceiveAll_Enable;

  ETH_InitStructure.ETH_BroadcastFramesReception = ETH_BroadcastFramesReception_Enable;

  ETH_InitStructure.ETH_PromiscuousMode = ETH_PromiscuousMode_Disable;

  ETH_InitStructure.ETH_MulticastFramesFilter = ETH_MulticastFramesFilter_Perfect;

  ETH_InitStructure.ETH_UnicastFramesFilter = ETH_UnicastFramesFilter_Perfect;

#ifdef CHECKSUM_BY_HARDWARE

  ETH_InitStructure.ETH_ChecksumOffload = ETH_ChecksumOffload_Enable;

#endif

  /*------------------------   DMA   -----------------------------------*/  

  

  /* When we use the Checksum offload feature, we need to enable the Store and Forward mode: 

  the store and forward guarantee that a whole frame is stored in the FIFO, so the MAC can insert/verify the checksum, 

  if the checksum is OK the DMA can handle the frame otherwise the frame is dropped */

  ETH_InitStructure.ETH_DropTCPIPChecksumErrorFrame = ETH_DropTCPIPChecksumErrorFrame_Enable;

  ETH_InitStructure.ETH_ReceiveStoreForward = ETH_ReceiveStoreForward_Enable;

  ETH_InitStructure.ETH_TransmitStoreForward = ETH_TransmitStoreForward_Enable;

  ETH_InitStructure.ETH_ForwardErrorFrames = ETH_ForwardErrorFrames_Enable;

  ETH_InitStructure.ETH_ForwardUndersizedGoodFrames = ETH_ForwardUndersizedGoodFrames_Enable;

  ETH_InitStructure.ETH_SecondFrameOperate = ETH_SecondFrameOperate_Enable;

  ETH_InitStructure.ETH_AddressAlignedBeats = ETH_AddressAlignedBeats_Enable;

  ETH_InitStructure.ETH_FixedBurst = ETH_FixedBurst_Enable;

  ETH_InitStructure.ETH_RxDMABurstLength = ETH_RxDMABurstLength_32Beat;

  ETH_InitStructure.ETH_TxDMABurstLength = ETH_TxDMABurstLength_32Beat;

  ETH_InitStructure.ETH_DMAArbitration = ETH_DMAArbitration_RoundRobin_RxTx_2_1;

  /* Configure Ethernet */

  EthStatus = ETH_Init(&ETH_InitStructure, DP83848_PHY_ADDRESS);

I created 3 small test projects, starting from the ''tcp echo server'' demo. One project for the each board I have here. On the STM324x9I-EVAL board the program is working with ethernet in MII mode. On our 207 board the code is also working with ethernet in RMII mode. But I can't get it to work on the 439. 

Am I overlooking a change in the 439 ? Does anybody have any idea ? 
3 REPLIES 3
stm32forum
Associate II
Posted on December 16, 2014 at 22:18

Are you shure they are pin compatible?

What about C6? Where is it connected to now....

207 RFU (reserver for future use)

439 PDR-On (power-down reset)

christophe1
Associate II
Posted on December 17, 2014 at 07:04

The C6 pin is not used in my test setup. It is not an ethernet related pin. But comparing the datasheets of the 2 CPUs It serves the same functions on both, plus soime extra on the 439.

christophe1
Associate II
Posted on December 17, 2014 at 12:25

The first tests were base on the tcp_echo_server example, a simple demo program that was polling the ethernet device for received frames. 

I wanted to see what happened when trying to send, so I took the tcp_echo_client demo and added a ''etharp_gratuitous'' to the systick interrupt every 1 second. Strangely enough this seems to work. The ARP packet is received correctly in wireshark, the received data matches the content of Tx_Buff in memory. But still all received data in Tx_Buff does not look good. I guess this means ETH DMA and CRC are ok, and I should focus on MAC and PHY.