Forum : ARM
Original Post
Post Information | Post |
---|---|
September 27, 2011 - 1:39pm
|
Hello, I have started to port the an3226 (STM32F107_LwIP_IAP_V1.0.0) from ST (originally for STM3210C-Evalm Board). At first I just wanted to run the lwip with the http module. So I have commented unnecessary code like lcd, led usage etc. I supposed that the original IO config for ethernet (stm32f107.c) should work with the reva board, but it doesn't. Are they some ethernet examples available for this board? If yes i could check if the ethernet hardware works proper and compare the io initialization. thx |
Hi,
The Ethernet PHY is not the same chip on the ST Eval board. You need to port the code to the STPE100M which is used on the REva DB.
Notice that there are some documented problems on this chip (check the ST Web site). Most noticeably, you will be limited to 10mbps, as the 100mbps interface is buggy.
I hope this helps,
Hello Bruno,
I have already noticed that the PHY is a bit differ. Therefore I have used the HSE Clock (25Mhz) instead of 50MHz PLL3 to drive the PHY. The rest like pinout, seems to be the same as used in the Keil examples. Thx for you tip about the buggy chip. I'm going to check the pinout and code again than i will reply about my success or my disappointment. How did you tested ethernet on the daughter board?
Greets
Hi,
We have manufacturing tests that perform a, Ethernet-level ping-pong of each STM32F107 REva DB. This does NOT check that the 100mbps is active or not.
Best Regards,
And it was never tested with a real App, not even just for fun?
I have still no success to run the LWIP IAP demo.
Following things I have done:
- flatten the whole app (no buttons, no STM EVAL-C Code, just LwIP, printf and http server)
- Checked the IO's between STM32 and PHY
- Set the mode in the App to MII
- Checked the Phy Address (0x01 is the right i guess, the same addr is used by the Phy of STMEVAL-C Board)
The Clock for the Phy seems to be right:
GPIO_ETH_MediaInterfaceConfig(GPIO_ETH_MediaInterface_MII);
RCC_MCOConfig(RCC_MCO_HSE); // 25Mhz to the PHY
But if I start the demo the ledc is blinking. It means that a collision is available. I have tried an other MAC address, with DHCP, without DHCP but without success.
I have bad or maybe good news why the App doesn't run. I tried to read all register of the PHY, and received just all ones. int PhyVar, c; for(c = 0; c < 20; c++) { PhyVar = ETH_ReadPHYRegister(0x01, c); printf("\r\nReg %d: \t %d", c, PhyVar); }
Hi again :)
I found the address for the PHY on my board is 7. Now the STM32 is able to communicate trough this address. Also the IO initialization seems to be well. But the collision led is still blinking.
Here is the register dump after initialization:
0 - 0x1000
1 - 0x7849
2 - 0x1c04
3 - 0x0011
4 - 0x05E1
5 - 0x81E1
6 - 0x09
17 - 0x0200
18 - 0
19 - 0x01c0
Hi everybody.
a_funk80 you need to change some registers on stm32_eth.h file.
#define PHY_Speed_Status ((u16)0x0004) /*!< Configured information of Speed: 10Mbps */
#define PHY_Duplex_Status ((u16)0x0010) /*!< Configured information of Duplex: Full-duplex */
Is the same for LAN8700.
And you have to add this
#define PHY_SR 19 /*!< Tranceiver Status Register */
As you say Phy address is 7 and it works on MII interface.
I only made it works at 10Mbs without autonegotiation.
Sorry for my english, but i think that with this notes you can run lwip demo. I did it, and for uiP, Niche Lite and Keil TCP/IP stacks
Hello mariojim22,
Thank you for your support! I can understand you very well.
I have followed your suggestion and changed the data in the stm32_eth.h file. I thought all PHY registers are defined by a standard, now I see that they are some differences.
Sadly, the Yellow LED on the LAN jack is still blinking. [on,off/sec]
"LED display for Full Duplex or Collision status. This pin will be driven on
continually when a full duplex configuration is detected. This pin will be driven on
at a 20 Hz blinking frequency when a collision status is detected in the half duplex
configuration."
I wonder because after the try to initialize the PHY in full duplex mode, 10 Mbit without auto-negation, the control register XCR shouldn't have a value of 0x3000
/*------------------------ MAC -----------------------------------*/
ETH_InitStructure.ETH_AutoNegotiation = ETH_AutoNegotiation_Disable;
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_Disable;
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;
ETH_InitStructure.ETH_Mode = ETH_Mode_FullDuplex;
ETH_InitStructure.ETH_Speed = ETH_Speed_10M;
Hi,
I'm using a configurable switch to test stm32f107. And i notice that, my switch, it is configured with 10Mb full duplex, without autonegotiation. So My STM is config like that:
/*------------------------ MAC -----------------------------------*/
ETH_InitStructure.ETH_AutoNegotiation = ETH_AutoNegotiation_Enable ;
//ETH_InitStructure.ETH_Speed = ETH_Speed_10M;
ETH_InitStructure.ETH_LoopbackMode = ETH_LoopbackMode_Disable;
//ETH_InitStructure.ETH_Mode = ETH_Mode_FullDuplex;
ETH_InitStructure.ETH_RetryTransmission = ETH_RetryTransmission_Disable;
ETH_InitStructure.ETH_AutomaticPadCRCStrip = ETH_AutomaticPadCRCStrip_Disable;
ETH_InitStructure.ETH_ReceiveAll = ETH_ReceiveAll_Disable;
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;
if you don't have a configurable switch, try to connect REVA directly with your PC and configure the ethernet card to 10Mb Full if you don't have a configurable switch.
Thank you, i use the board in my company network and there is no switch on my site. I've tried to connect the board directly to my PC (with changed settings: 10Mbit/Full duplex). The Link-LED (green) is blinking now while I sent a ping from my PC. But this can't be a solution for me. I've bought the reva board especially for an Ethernet project, it's too bad about a lot of wasted time. I will switch to an other board with a well installed PHY. Because I need a board as a reference. It's a pity that there is no information about the PHY problems with this daughter board. The website offers sample programs to help users get their own application started quickly and easily, but there are no ethernet examples. But the main board is very well. Maybe the reva kit is a good decision to program a STMF103. I looked for an other board they are a lot for less money but to minimize the design risk I will get a STM3210C-EVAL i guess.
Thank you all for your support, especially mariojim22 :)
Motivated by Bruno to investigate the problem I've spend just a bit more time to get LAN connection. Now the LAN seems to run (limited to 10Mbit). You can find the whole project as a zip File for Ride7. Note: - The origin example was IAP over LAN from ST - MII connection to STE100P was used - No DHCP -> Check IP Settings on your PC and make changes (if required) in the project source - set your PC LAN settings or of your router/switch to 10Mbit Fullduplex. - The PHY address is "7" - Changed PHY settings in stm32_eth.h to: #define PHY_SR 17 /*!< Tranceiver Status Register */ #define PHY_Speed_Status ((u16)0x0200) /*!< Configured information of Speed: 10Mbps */ #define PHY_Duplex_Status ((u16)0x0100) /*!< Configured information of Duplex: Full-duplex */ - After compilation run the demo and type the board address in your browser. Or Use hercules_3-2-4.exe (Terminal program) and connect to the board IP and port23 you will see a hallo message. Another point is, I've desoldered the pin7 on the LAN jack, in accordance to ste100p errata from an other board, try this at least if the example don't works! PS: the LED blinking what I've described above seems to be caused by permanent PHY resets if 100Mbit connection to the board is used.
a bit old post but i wish i will get a reaction here
I have a similar problem,
have different samples based on stm32f107 and a Ethernet PHY from TI named TLK105.
most of the samples works fine, some of them had issues resettting the Ethernet resulted to register were corrupted, I made a hardware reset and they work fine.
Now the big mistery ... some few samples they dont reset the Ethernet all the time ... most of the time I get currupted register (all one or all zeros) ...
I do not if the problem if communication problem (but the software works on most of the samples) or hardware problem which explains the ambiguis behaviro of the minoroty of samples.
any discussion is welcome.
thanks