> For the complete documentation index, see [llms.txt](https://tk233.gitbook.io/notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tk233.gitbook.io/notes/stm32/connectivity/ethernet/ethernet.md).

# Ethernet - LWIP

## Setting up Ethernet PHY Layer

Under "Connectivity" tab, select ETH.

Set ETH mode to RMII, and make sure the pin mapping corresponds to the one on the Nucleo board

<figure><img src="/files/x1MW6wF2D1a9B6afklTN" alt=""><figcaption></figcaption></figure>

{% tabs %}
{% tab title="NUCLEO-F429ZI" %}

<figure><img src="/files/vwhKherQIJDSAqaf8oh7" alt=""><figcaption></figcaption></figure>

On the F429ZI Nucleo board, the pin mapping should look as follows.

<figure><img src="/files/nlkYW6AkcLRc7pCrgS6e" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="NUCLEO-H755ZI" %}

<figure><img src="/files/wZwN052TXJC3KBzE7oIO" alt=""><figcaption></figcaption></figure>

On the H755ZI Nucleo board, the pin mapping should look as follows.

<figure><img src="/files/5aUM7xQDRJfph3JZqDwj" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

## Setting up Middleware LWIP Protocol Layer

Under "Middleware and Software Packs" tab, select LWIP (Lightweight IP).

Enable the Lightweight IP functionality.

The Platform Settings will mark a warning icon. We will configure this at the last step.

<figure><img src="/files/mnOdADUvirgmlAOW4lVM" alt=""><figcaption></figcaption></figure>

Disable DHCP and manually set the IP

<figure><img src="/files/arZ8MiHOVrCJ2En0Duhz" alt=""><figcaption></figcaption></figure>

set MEM\_SIZE to 10K

<figure><img src="/files/OrQm0TvKxXBhT3IOJCdY" alt=""><figcaption></figcaption></figure>

Now, we configure the Platform Settings. For Nucleo 144 boards (F429, H755 etc.), we need to set to LAN8742, which corresponds to the U9 PHY IC on the board.

<figure><img src="/files/m7Wspgb6dI3hVhohX9Wb" alt=""><figcaption></figcaption></figure>

```c
/* USER CODE BEGIN 0 */

extern struct netif gnetif;

/* USER CODE END 0 */

...

  /* USER CODE BEGIN WHILE */
  while (1)
  {
    /* USER CODE END WHILE */


    /* USER CODE BEGIN 3 */
    ethernetif_input(&gnetif);
  }
  /* USER CODE END 3 */

```

## Testing

After configuration, the STM32 should be able to respond to ping requests.

## Reference

{% embed url="<https://controllerstech.com/stm32-ethernet-tutorials/>" %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://tk233.gitbook.io/notes/stm32/connectivity/ethernet/ethernet.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
