avinash-gupta-in / stm32f401-lwip-tcp-echo-server

A simple TCP echo server written for STM32F401 blackpill board using lwIP TCP/IP stack

Repository from Github https://github.comavinash-gupta-in/stm32f401-lwip-tcp-echo-serverRepository from Github https://github.comavinash-gupta-in/stm32f401-lwip-tcp-echo-server

This is a part of code samples for course available on www.stm32tutorials.com

SIMPLE TCP ECHO SERVER USING LWIP

This tcp server listens on TCP port 5000 you can then connect using Hercules TCP client and send data to this server. The server will echo back the same data to the client which will be visible on Hercules. The aim of this sample code is to teach the students how to write a TCP Server in lwIP

Hardware

MCU: STM32F401CC (48 PIN) Board: STM32F401CC Black-pill Crystal: 25MHz CPU Speed: 84MHz RAM: 64KB Core: ARM Cortx-M4

Ethernet Controller

ENC28J60 (From Microchip)

Interface: SPI SPI Instance: SPI1

PINS

MCU ENC28J60
PA5 (SPI1_SCK) SCK
PA6 (SPI1_MISO) MISO (SO)
PA7 (SPI1_MOSI) MOSI (SI)
PB2 (EXTI) INT
PA4 CS
PA8 RESET

USART Debug

Debug messages are printed on USART2 Baud Rate: 115200 (8N1) PA2 (TX) PA3 (RX)

Output of the program (on Serial Terminal)

Using Hercules TCP Client to send data to our server for testing.

Hercules used for testing our TCP server

About

A simple TCP echo server written for STM32F401 blackpill board using lwIP TCP/IP stack


Languages

Language:C 99.6%Language:Assembly 0.4%