STM32 Ethernet Demo

This forum is dedicated to feedback, discussions about ongoing or future developments, ideas and suggestions regarding the ChibiOS projects are welcome. This forum is NOT for support.
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32 Ethernet Demo

Post 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
mabl
Posts: 417
Joined: Tue Dec 21, 2010 10:19 am
Been thanked: 1 time

Re: STM32 Ethernet Demo

Post 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.
brian360
Posts: 27
Joined: Wed Dec 08, 2010 5:47 pm

Re: STM32 Ethernet Demo

Post 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.
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32 Ethernet Demo

Post by Giovanni »

Thanks Brian,

I have to admit I am a bit lost in that ST driver.

Giovanni
brian360
Posts: 27
Joined: Wed Dec 08, 2010 5:47 pm

Re: STM32 Ethernet Demo

Post 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 :)
mabl
Posts: 417
Joined: Tue Dec 21, 2010 10:19 am
Been thanked: 1 time

Re: STM32 Ethernet Demo

Post 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
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32 Ethernet Demo

Post 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
brian360
Posts: 27
Joined: Wed Dec 08, 2010 5:47 pm

Re: STM32 Ethernet Demo

Post 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
mabl
Posts: 417
Joined: Tue Dec 21, 2010 10:19 am
Been thanked: 1 time

Re: STM32 Ethernet Demo

Post by mabl »

Wow, that would be awesome! Thank you very much! :)
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32 Ethernet Demo

Post 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
Post Reply