Page 2 of 26
Re: STM32 Ethernet Demo
Posted: Sat Mar 12, 2011 12:57 pm
by Giovanni
Hi,
I am trying to execute your demo but it goes into an unhandled exception almost immediately after start, the LED does not have the time to complete a single cycle.
Is this the same behavior you are experiencing?
Giovanni
Re: STM32 Ethernet Demo
Posted: Sat Mar 12, 2011 1:08 pm
by mabl
Indeed, it does not do this when I also execute the webserver thread. If no lwip is started then the mac detects at least the link and does not crash... Naturally I cannot ping the board then.
Re: STM32 Ethernet Demo
Posted: Sat Mar 12, 2011 8:52 pm
by brian360
I've got the Olimex STM32 Ethernet board on order, too, so hopefully I'll be able to help out and test as well soon.
I will note that I am running lwip-1.4.0-RC1 now rather than the included version of lwip in ChibiOS. Enabling stack overflow detection in ChibiOS helped greatly for debugging, as well.
Re: STM32 Ethernet Demo
Posted: Sat Mar 12, 2011 9:40 pm
by Giovanni
Thanks Brian,
I have to admit I am a bit lost in that ST driver.
Giovanni
Re: STM32 Ethernet Demo
Posted: Sat Mar 12, 2011 11:48 pm
by brian360
Don't worry, me too

A native mac driver would most certainly improve readability of the code, that's for sure. It would also help to abstract the phy layer, too.
The mac lld driver & initialization code was largely ported from ST's sample code of an STM32F107 LwIP demo (AN3102
http://www.st.com/internet/com/SOFTWARE_RESOURCES/SW_COMPONENT/FIRMWARE/an3102.zip) and the ChibiOS AT91 mac driver implementation. The file "stm32_eth.c" obviously is ST's own driver code and equally hard-to-follow.
Improvements most certainly are welcome, and I'll help out anywhere I can

Re: STM32 Ethernet Demo
Posted: Thu Apr 07, 2011 8:33 am
by mabl
Some information regarding the olimex board: The schematics on the websites are outdated! I had problems using the SD slot, as it was impossible to use them according the the old schematics. They still have not updated their website - therefore I attached [1] (pdf extension is not allowed here..) the schematic I got from their support.
PS: Any progress regarding the ethernet?
[1]
http://leute.server.de/mabldata/etc/STM ... ematic.pdf
Re: STM32 Ethernet Demo
Posted: Thu Apr 07, 2011 8:39 am
by Giovanni
Thanks, I noticed the problem with the schematic, it made impossible to use the SD slot.
About the Ethernet, I prefer to write a native driver rather that mess with the ST library, may be Brian will update us about the status of the transition driver.
Giovanni
Re: STM32 Ethernet Demo
Posted: Thu Apr 07, 2011 5:16 pm
by brian360
Hi,
I did receive my Olimex board and do have the Ethernet working with my project. The ST wrapper driver didn't really need any changes beyond what you had already posted. I will separate out my project files, try to figure out what is different about my project and the uploaded project, and update the branch with a working demo for the Olimex board this weekend.
- Brian
Re: STM32 Ethernet Demo
Posted: Thu Apr 07, 2011 5:46 pm
by mabl
Wow, that would be awesome! Thank you very much!

Re: STM32 Ethernet Demo
Posted: Thu Apr 07, 2011 6:54 pm
by Giovanni
Great news, thanks Brian.
Note that the HAL in 2.3.1 supports the PLL3 initialization and the generation of the 50MHz through the MCO pin, part of that ad-hoc initialization code probably is no more required.
Giovanni