2011-11-17 04:13 AM
hello friends
Can any body guide me on how can i use the ethernet module of stm32f407 on discovery kit? do i need something extra? #stm32f4-discovery #ethernet #lwip2013-01-23 01:50 AM
hi vaidas,
i have the same problem with you, in the debug mode the system enters the infinite ''while'' loop for packet handling but ETH_CheckFrameReceived() never returns 1 and packets are not handled. But i couldn't even get the webpage from browser, or couldn't get response to pings on the startup. I make the changes on lwip stack accordingly to the posts above, is there any other configuration or changes on the code? help please.. thanks in advance2013-02-09 08:56 AM
Hi,
I now spent many hours trying to compile the example code for the STM32F4 discovery following the instructions of this forum-thread.Unfortunately I do not get it running. I compile the code with GCC and used the ST example (tcpechoserver) and modified it following the instructions above. The code compiles, but according GDB-debug my board also enters the infinite loop in the HardFaultHandler.Does anbody have any ideas, what can be wrong?Thanks!RegardsFlorian2013-02-09 09:07 AM
Does anbody have any ideas, what can be wrong?
You don't have the IRQ handler set up right, or you're touching some memory inappropriately? Why don't you use the debugger to determine the faulting instruction and processor registers at the time? The hard fault stacks the processor state. Put in a proper fault handler if you have to, or dig through the stack. If you know what faulted you'll be half way to solving the issue. It could also be the while() loop is the general dumping ground for unhandled interrupt vectors.
2013-02-17 01:24 AM
Hi Kadir,
As I'm using my own made pcb with ethernet, I recomend You, to check pinout (I've attached my schematic and few more files) of your circuit and make wires as short as possible. Did You check this out?:[[this link/image has been flagged as malicious by our security scan software and has been deleted]]
First try to use http example, because it's the easiest way to find out that everything works fine. I'm using KEIL MDK-ARM , but it doesn't matter at all, example should work with all compilers and IDEs. I have attached part of my schematic and few files from my working example. 1) First of all(in main.c), I've reinitialized systik(it is done before main at startup, but still did it, just to be sure) and hold DP83848 reset pin low, then high and waited for a while, because it takes about 80ms to start up-maby this is not needed, but I left this part in my code... 2) Then (in main.h) I've changed board's IP address, that it appear in the same subnet as my PC(0.x, but different from my PC's IP), otherwise I should change my PC address every time I want to connect to board. And defined RMII mode. 3) In STM32f4x7_eth_bsp file changed everything as is in my board, by the example. 4) Changed HSE(external oscillator value to my Quartz value), I'm using 8MHz, this should be done in compiler's define list. If You don't know where this appears, You can just go to your project's directory and then to -> Libraries\CMSIS\Device\ST\STM32F4xx\Include, find file, named ''stm32f4xx.h'' , make ir writable(take off mark from: read only) and change the value of -> #define HSE_VALUE ((uint32_t)8000000). 5) Go to system_stm32f4xx.c file and change PLL_M value to your quartz value, mine looks like this: #define PLL_M 8. I guess this is it about how I made my board work. And somewhere I saw post about HardFaultHandler, mostly, this is due to uninitialized pointers. If You'll be using pointers or arrays, when You create it, you better point it somewhere, and do not leave blank... and if You don't use them, better comment. Good luck. Vaidas ________________ Attachments : ethernet_example.rar : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hz2A&d=%2Fa%2F0X0000000bQ0%2FyuRkirbz9P1wpVQYUukxMw0RwqIwTahZyLYYd6Cdrjg&asPdf=false2013-02-20 05:30 PM
I'd recommend the Waveshare ''motherboard'' now. It IS a bit more pricey, but worth it IMHO. IF you get a motherboard, they send you a DVD with working demo code of every single peripheral. The ethernet phy module you have is PROBABLY the one that was intended to plug into the Waveshare board. Waveshare's motherboard is entirely straight-wire to peripheral headers, there's no hard-wired hardware conflicts like this and the stuff plugs right into the connections the code example uses. If you get the 144 pin STM32 packages then there's probably no pin conflicts in hooking up all the stuff at once.
The Waveshare stuff is at but they sell under 2 names on eBay for slightly cheaper. These boards don't feature an ST-Link, at least mine doesn't seem to. AFAIK the USB on the ''core board'' is just attached to the low-speed USB peripheral. So you'll need a Segger J-Link, ULink2, or ST-Link to use is. You can just use the header off you STM32 Discovery board, EXCEPT that pulling the two jumpers will allow you to program and debug but not receive ITM printf/getc from the SWO pin- to get that to work, you'll need to clear solder bridge SB12 on the STM32F4 Discovery board.2013-02-20 05:30 PM
delete
2013-02-21 05:12 AM
It is nice to have a good quality development board, but it can be made to work on much worse conditions, here my original alpha prototype:
http://www.flickr.com/photos/80797729%40N04/8209914083/in/photostream/lightbox/
The old version of lwIP seems to work fine, the port of ST is well done. The main problems in my view are little stuff like: - software reset routines wrong(need some read of old topics in this forum) - too many while(1)'s that stall the code - hardware reset for the PHY missing, it is a must and need to be separate from the board reset(will take extra GPIO) - PHY address scanning is needed, before attempt to talk to the PHY So far i have small web server running, RTC calibration via NTP protocol and small http client. It was a struggle to make it work, but now works almost flawlessly. Regards2013-05-13 02:30 PM
Hi Monka,
I am working on an STM32F407 project for which I will need NTP or SNTP. Is it possible that you could share your experiences and code? Regards, Angel2013-05-13 04:29 PM
Getting NTP time stamp packets can be done fairly easily, what are you trying to achieve? Does your board have LSE and HSE crystals?
2017-06-15 11:13 AM
In 2017 a suggested method would be to use an STM32F4DIS-BB board, or one of the NUCLEO-144 boards with the Ethernet built on it, the latter being significantly cheaper than the DISCO and BB
https://www.digikey.com/product-detail/en/stmicroelectronics/STM32F4DIS-BB/497-13545-ND/3878236
The board is a partnership between EmBest and Element14, many example codes are available.