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

Re: STM32 Ethernet Demo

Post by mabl »

I'm not sure if tkj means oocd problems, Tectu. The debugging chain itself should be virtually identical between FreeRTOS and ChibiOS. Also the Olimex E407 is fully supported by ChibiOS - I cannot see how any other RTOS can be more easy. I have never used FreeRTOS, so I'd very much appreciate feedback by tkj why he finds FreeRTOS easier.

DeusExMachina wrote:I tried to mix ARMCM4-STM32F407-LWIP with STM32F407-DISCOVERY demos using Thomas connections layout, but I cant win :( I think it's worth to create STM32F407-DISCOVERY-LWIP demo in Chibios distribution, but I am afraid it's too complicated task for me.

It should actually not be so hard. Keep trying - you will learn a lot from it.

  • Start from the default F4DISCOVERY board file.
  • Check which media interface you need, probably RMII which uses a 50MHz clock for its databus
  • Check where you need to generate the 50MHz. Some Ethernet boards have their own generator.
  • Assign the pins in the map file. Remember to use the correct alternate IO.
  • Maybe you need to desolder some conflicting chips.
  • Add your MAC chip to your board file - it is used by the mac driver to autodetect your mac.
  • Debug your mac startup. The driver is nicely written. By finding where it fails, you will get insight what is still wrong.
  • Spend 2 days and few less hair -> You will *definitly* have a working project afterwards.
  • The LWIP and Ethernet stuff can be used *directly* from the other demo. There is nothing specific to it.
  • Always ask questions :-)
User avatar
DeusExMachina
Posts: 223
Joined: Tue Apr 03, 2012 5:08 am
Has thanked: 3 times
Been thanked: 3 times

Re: STM32 Ethernet Demo

Post by DeusExMachina »

mabl wrote:
  • Start from the default F4DISCOVERY board file.
  • Check which media interface you need, probably RMII which uses a 50MHz clock for its databus
  • Check where you need to generate the 50MHz. Some Ethernet boards have their own generator.
  • Assign the pins in the map file. Remember to use the correct alternate IO.
  • Maybe you need to desolder some conflicting chips.
  • Add your MAC chip to your board file - it is used by the mac driver to autodetect your mac.
  • Debug your mac startup. The driver is nicely written. By finding where it fails, you will get insight what is still wrong.
  • Spend 2 days and few less hair -> You will *definitly* have a working project afterwards.
  • The LWIP and Ethernet stuff can be used *directly* from the other demo. There is nothing specific to it.
  • Always ask questions :-)

OK, I'll try to do it. :)
mabl
Posts: 417
Joined: Tue Dec 21, 2010 10:19 am
Been thanked: 1 time

Re: STM32 Ethernet Demo

Post by mabl »

Maybe it's also a possible idea to think about using the Olimex STM32E407. It's a great board:
http://chibios.org/dokuwiki/doku.php?id ... ry_vs_e407

You can easily buy it on ebay.
tkj
Posts: 11
Joined: Tue Oct 30, 2012 11:46 pm

Re: STM32 Ethernet Demo

Post by tkj »

@mabl, I definitely don't think FreeRTOS is any easier than ChbiOS.
But for now I can only get debugging with our J-link and using CooCox to work with FreeRTOS.
But if it worked for ChibiOS I would definitely use that too!
mabl
Posts: 417
Joined: Tue Dec 21, 2010 10:19 am
Been thanked: 1 time

Re: STM32 Ethernet Demo

Post by mabl »

@tki:
If you like you can open a new topic about your issues. I used JLink with the Segger gdbserver and openocd - both worked fine for me and ChibiOS. Your troubles should be easy to solve.
tkj
Posts: 11
Joined: Tue Oct 30, 2012 11:46 pm

Re: STM32 Ethernet Demo

Post by tkj »

mabl wrote:@tki:
If you like you can open a new topic about your issues. I used JLink with the Segger gdbserver and openocd - both worked fine for me and ChibiOS. Your troubles should be easy to solve.

To me the debugging of ChibiOS also worked in the beginning (demo projects).
But when I started filling my own code and threads into the project it suddenly stopped working.
User avatar
DeusExMachina
Posts: 223
Joined: Tue Apr 03, 2012 5:08 am
Has thanked: 3 times
Been thanked: 3 times

Re: STM32 Ethernet Demo

Post by DeusExMachina »

After some issues I've got working stm32f4discovery with DP83848. Thanks for mabl and tkj!
I got ARMCM4-STM32F407-LWIP demo, changed link to ST_STM32F4_DISCOVERY board. After, I thoroughly checked board.h, assigning right alternate function values according datasheet.
mabl
Posts: 417
Joined: Tue Dec 21, 2010 10:19 am
Been thanked: 1 time

Re: STM32 Ethernet Demo

Post by mabl »

DeusExMachina wrote:After some issues I've got working stm32f4discovery with DP83848. Thanks for mabl and tkj!
I got ARMCM4-STM32F407-LWIP demo, changed link to ST_STM32F4_DISCOVERY board. After, I thoroughly checked board.h, assigning right alternate function values according datasheet.

Great! I'm sure you also learnt a lot ;) Maybe upload your working project files here. Then somebody else can build upon your work.
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 »

It would be a nice idea to write a small guide for Ethernet on the Discovery.

Giovanni
tkj
Posts: 11
Joined: Tue Oct 30, 2012 11:46 pm

Re: STM32 Ethernet Demo

Post by tkj »

Giovanni wrote:It would be a nice idea to write a small guide for Ethernet on the Discovery.

Giovanni

Yeah.
If you could upload the project I could combine it with the guide/blog-post I've already made: http://blog.tkjelectronics.dk/2012/08/e ... ernal-phy/
Post Reply