---
title: "STM32F446_W5500__FREERTOS"
url: "https://maker.wiznet.io/mason/projects/stm32f446-w5500-freertos/"
markdown_url: "https://maker.wiznet.io/mason/projects/stm32f446-w5500-freertos/md"
type: "UCC: User Created Content"
author: "jaisai1337"
author_url: "https://github.com/jaisai1337/STM32F446_W5500__FREERTOS"
editor: "WIZnet"
editor_url: "https://maker.wiznet.io/"
original_author: "jaisai1337"
original_url: "https://github.com/jaisai1337/STM32F446_W5500__FREERTOS"
published: "2025-11-18"
language: "en"
tags: ["W5500", "STM32"]
hardware: ["WIZnet W5500"]
likes: 0
views: 1252
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# STM32F446_W5500__FREERTOS

> STM32F446_W5500__FREERTOS

Original author: jaisai1337 (source: https://github.com/jaisai1337/STM32F446_W5500__FREERTOS)

## Components

- **WIZnet W5500** x 1 ([docs](https://docs.wiznet.io/Product/Chip/Ethernet/W5500))

WIZnet parts: W5500 ([Datasheet](https://docs.wiznet.io/Product/Chip/Ethernet/W5500/datasheet?utm_source=maker&utm_medium=project&utm_campaign=w5500), [product hub](https://maker.wiznet.io/products/w5500/))

## Documents and links

- [Github Code](https://github.com/jaisai1337/STM32F446_W5500__FREERTOS) (code)

## Article

## 프로젝트 개요

MCU: STM32F446RE (Cortex-M4F, 180MHz)
Ethernet: W5500 (SPI 기반 하드웨어 TCP/IP 스택)
주요 기능: FreeRTOS 멀티태스킹, DHCP/DNS 클라이언트, 메시지 큐 기반 태스크 통신
목적: 임베디드 네트워크 애플리케이션 개발용 기본 템플릿 제공
원본링크 : <https://github.com/jaisai1337/STM32F446_W5500__FREERTOS>

---

## 주요 특징

### 1. FreeRTOS 멀티태스킹 구조

#### 태스크 구성

| 태스크 | 역할 | 주기 |
| --- | --- | --- |
| vTaskSender1 | 메시지 전송 | 1초 |
| vTaskSender2 | 메시지 전송 | 1.5초 |
| vTaskReceiver | 메시지 수신 후 UART 출력 | - |

Queue 기반 메시지 전달
향후 소켓 처리 태스크로 확장 가능

---

### 2. DHCP / DNS 네트워크 초기화 기능

#### DHCP

USE_DHCP = 1 시 자동 IP 할당
실패 시 Static IP 폴백
콜백 기반 상태 추적 가능

#### DNS

소켓 6번 사용
도메인 이름 → IP 변환 기능 제공

#### 네트워크 스택

W5500 하드웨어 TCP/IP 사용

---

### 3. 구성 요소

FreeRTOS Kernel
W5500 드라이버
DHCP/DNS 모듈
HAL/Startup 코드

---

### 4. W5500 구성

소켓당 2KB 버퍼

용도
DHCP: Socket 7
DNS: Socket 6
Application: Socket 0~5

---

## 유의사항

FreeRTOS 스케줄러 시작 후에도 main의 while() 루프는 실행될 수 있으나, 태스크 스케줄링으로 인해 실행이 지속적으로 보장되지는 않습니다.

네트워크 관련 처리는 FreeRTOS 태스크 구조로 이관하는 것이 안정적입니다.

## Project Overview

**MCU:** STM32F446RE (Cortex-M4F, 180 MHz)

**Ethernet:** W5500 (SPI-based hardware TCP/IP stack)

**Key Features:** FreeRTOS multitasking, DHCP/DNS client, message queue–based task communication

**Purpose:** To provide a foundational template for developing embedded network applications

Original Link : <https://github.com/jaisai1337/STM32F446_W5500__FREERTOS>

---

## Main Features

### 1. FreeRTOS Multitasking Structure

#### Task Configuration

| Task Name | Role | Period |
| --- | --- | --- |
| vTaskSender1 | Message transmission | 1 sec |
| vTaskSender2 | Message transmission | 1.5 sec |
| vTaskReceiver | Receive message and print via UART | — |

Message delivery is handled through a FreeRTOS queue

Can be expanded into socket-handling tasks in the future

---

### 2. DHCP / DNS Network Initialization

#### DHCP

Automatically assigns IP when `USE_DHCP = 1`

Falls back to a static IP if DHCP fails

Supports callback-based status monitoring

#### DNS

Uses socket 6

Provides domain name → IP address resolution

#### Network Stack

Uses the W5500 hardware TCP/IP stack

---

### 3. Components

FreeRTOS Kernel

W5500 Driver

DHCP/DNS Modules

HAL and Startup Code

---

### 4. W5500 Configuration

2 KB buffer per socket

#### Socket Allocation

DHCP: Socket 7

DNS: Socket 6

Application: Socket 0–5

---

## Notes

The `while()` loop in `main` may still execute after the FreeRTOS scheduler starts, but its execution is **not guaranteed** due to task scheduling.

For stability, network-related processing should be migrated into FreeRTOS task structures.

---

Source: https://maker.wiznet.io/mason/projects/stm32f446-w5500-freertos/
