How can I configure and initialize the ethernet connector (RJ45) and send/receive packets with the ethernet connector of the STM32F107 evaluation board (ARM Cortex-M3). I searched for tutorials, but I found nothing. For example, for the RS-232, USART and LEDs there are a lot tutorials, but there aren't such tutorials for sending/receiving ethernet frames/packets.

Can anyone explain how to do that or suggest tutorials and papers?

  • \$\begingroup\$ This question is too broad, it would take a few pages to describe how to do this which is beyond the scope of this forum. Ethernet isn't trivial to implement. If you've never done it before it could take a weeks worth of time. The easiest\best thing to do is find a dev board with an example project and build off of that. \$\endgroup\$
    – Voltage Spike
    Sep 16, 2016 at 19:48

1 Answer 1


I searched for tutorials, but I found nothing.

That might be because the amount of work is quite large, if you try to do it all yourself.

Although the STM32F107 includes some of the elements needed for Ethernet connectivity, it does not include a TCP/IP stack in the chip. Therefore this needs to be added, if you intended to have the F107 communicate on a typical network.

[Note that the specific Ethernet "Phy" which you have on your board (to link the F107 to the "magnetics" and RJ45 connector) can require changing any sample code which you use, if that sample code was written for a different Phy.]

I'm aware of some different ways to get the necessary TCP/IP stack code (some people call it "middleware") for an F107:

  • Many OS/RTOS include a TCP/IP stack for their supported MCUs. So find an RTOS which supports the F107 and you are likely to find some TCP/IP code. Remember what I said above about potentially needing to change the supplied code, unless the intended Phy IC in the code, matches the Phy IC on your board. Here is one example using FreeRTOS.
  • ST provide a downloadable example of lwIP for the F107 under their code STSW-STM32026 with application note AN3102 here or here.
  • ST provide a downloadable example of NicheLite TCP/IP stack for the F107 under their code STSW-STM32045 with application note AN3000 here.


  • This was a similar question I found on EE.SE for the STM32F103, but which recommends using the F107 and TCP/IP stacks.
  • This engineer's blog (Andy's Workshop) has a page where he adds a Phy to an STM32F107 board. He has also created his own object-oriented C++ TCP/IP stack called stm32plus::net. You may find these articles useful.

Not the answer you're looking for? Browse other questions tagged or ask your own question.