{"id":4164,"date":"2026-01-17T08:10:54","date_gmt":"2026-01-17T08:10:54","guid":{"rendered":"https:\/\/blog.embeddedexpert.io\/?p=4164"},"modified":"2026-01-17T08:10:55","modified_gmt":"2026-01-17T08:10:55","slug":"stm32-and-mongoose-web-server-part1-introduction-and-hardware-setup","status":"publish","type":"post","link":"https:\/\/blog.embeddedexpert.io\/?p=4164","title":{"rendered":"STM32 and Mongoose Web server Part1: Introduction and Hardware Setup"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"683\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/ChatGPT-Image-Jan-17-2026-at-10_13_02-AM-1024x683.png\" alt=\"\" class=\"wp-image-4165\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/ChatGPT-Image-Jan-17-2026-at-10_13_02-AM-1024x683.png 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/ChatGPT-Image-Jan-17-2026-at-10_13_02-AM-300x200.png 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/ChatGPT-Image-Jan-17-2026-at-10_13_02-AM-768x512.png 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/ChatGPT-Image-Jan-17-2026-at-10_13_02-AM-1150x767.png 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/ChatGPT-Image-Jan-17-2026-at-10_13_02-AM-750x500.png 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/ChatGPT-Image-Jan-17-2026-at-10_13_02-AM-400x267.png 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/ChatGPT-Image-Jan-17-2026-at-10_13_02-AM-250x167.png 250w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/ChatGPT-Image-Jan-17-2026-at-10_13_02-AM.png 1536w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><br>In this first part of the Mongoose guide for STM32, we focus on the foundational steps required to get the platform up and running, starting with the hardware setup and basic system initialization. We also cover UART configuration to enable reliable serial communication for debugging and early-stage validation.<\/p>\n\n\n\n<p>In this guide, we shall cover the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Introduction.<\/li>\n\n\n\n<li>STM32CubeMX setup.<\/li>\n\n\n\n<li>Importing project to STM32CubeIDE.<\/li>\n\n\n\n<li>Basic code setup and test.<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1. Introduction:<\/h2>\n\n\n\n<p>Mongoose is a lightweight, event-driven networking library designed to simplify the development of connected applications on resource-constrained systems as well as full-featured operating systems. It provides a unified, consistent API for implementing common network protocols such as TCP\/IP, UDP, HTTP\/HTTPS, WebSocket, MQTT, and others, allowing developers to build robust networked firmware without needing to manage low-level socket handling, state machines, or protocol parsing manually. By abstracting these complexities, Mongoose enables engineers to focus on application logic rather than infrastructure, significantly reducing development time and potential sources of error.<\/p>\n\n\n\n<p>One of Mongoose\u2019s key strengths is its suitability for embedded systems, including microcontrollers like STM32. It is written in portable C, has a small memory footprint, and can be integrated with popular embedded TCP\/IP stacks such as lwIP. This makes it particularly well-suited for Ethernet-enabled STM32 platforms, where deterministic behavior, low RAM usage, and clear control over execution flow are critical. Its non-blocking, event-based architecture aligns well with embedded design best practices, ensuring that networking tasks do not interfere with real-time constraints or peripheral handling.<\/p>\n\n\n\n<p>In addition to its technical efficiency, Mongoose is designed with scalability and maintainability in mind. The same core API can be used across vastly different environments, from bare-metal or RTOS-based microcontrollers to Linux, macOS, and Windows systems. This consistency allows developers to prototype, test, and debug applications on a desktop environment before deploying them to embedded hardware, reducing risk and improving overall software quality.<\/p>\n\n\n\n<p>Within the context of STM32 development, Mongoose serves as a powerful foundation for building modern connected devices, including IoT nodes, industrial controllers, gateways, and diagnostic tools. Whether the goal is to expose a simple HTTP configuration interface, stream data over WebSockets, or implement a secure cloud-connected service, Mongoose provides the essential building blocks in a compact and well-structured form. This guide aims to introduce Mongoose step by step, starting from hardware and basic initialization, and gradually progressing toward fully functional networked applications on STM32 platforms.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">2. STM32CubeMX Setup:<\/h2>\n\n\n\n<p>In this guide, STM32F767ZI Nucleo-144 shall be used to develop the ethernet firmware.<\/p>\n\n\n\n<p>We shall use the default setup offered by STM32CubeMX. <\/p>\n\n\n\n<p>Please note that you need to configure the ethernet manually in case of custom board.<\/p>\n\n\n\n<p>Open STM32CubeMX and click on Access to board select as follows:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"662\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-33-26-1024x662.jpg\" alt=\"\" class=\"wp-image-4166\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-33-26-1024x662.jpg 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-33-26-300x194.jpg 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-33-26-768x497.jpg 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-33-26-1536x993.jpg 1536w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-33-26-2048x1324.jpg 2048w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-33-26-1150x744.jpg 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-33-26-750x485.jpg 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-33-26-400x259.jpg 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-33-26-250x162.jpg 250w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Type Nucleo-F767ZI, double click on the board as follows:<\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"723\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-34-53-1024x723.jpg\" alt=\"\" class=\"wp-image-4167\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-34-53-1024x723.jpg 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-34-53-300x212.jpg 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-34-53-768x542.jpg 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-34-53-1536x1084.jpg 1536w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-34-53-2048x1445.jpg 2048w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-34-53-1150x812.jpg 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-34-53-750x529.jpg 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-34-53-400x282.jpg 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-34-53-250x176.jpg 250w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Initialize the peripheral to their default mode as follows:<\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"723\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-28-06-1024x723.jpg\" alt=\"\" class=\"wp-image-4168\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-28-06-1024x723.jpg 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-28-06-300x212.jpg 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-28-06-768x542.jpg 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-28-06-1536x1084.jpg 1536w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-28-06-2048x1445.jpg 2048w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-28-06-1150x812.jpg 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-28-06-750x529.jpg 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-28-06-400x282.jpg 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-28-06-250x176.jpg 250w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>It will ask you to enable the MPU click on yes as follows:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"239\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-28-13-1024x239.jpg\" alt=\"\" class=\"wp-image-4169\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-28-13-1024x239.jpg 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-28-13-300x70.jpg 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-28-13-768x179.jpg 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-28-13-1150x268.jpg 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-28-13-750x175.jpg 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-28-13-400x93.jpg 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-28-13-250x58.jpg 250w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-28-13.jpg 1346w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Next, from Clock Configuration Tab, set the speed to maximum of 216Hz for STM32F767Zi as follows:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"662\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-40-20-1024x662.jpg\" alt=\"\" class=\"wp-image-4170\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-40-20-1024x662.jpg 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-40-20-300x194.jpg 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-40-20-768x497.jpg 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-40-20-1536x993.jpg 1536w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-40-20-2048x1324.jpg 2048w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-40-20-1150x744.jpg 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-40-20-750x485.jpg 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-40-20-400x259.jpg 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-40-20-250x162.jpg 250w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Next, from Pinout &amp; Configuration, select connectivity, ETH and select NVIC settings tab and enable global interrupt for ETH as follows:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"662\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-44-13-1024x662.jpg\" alt=\"\" class=\"wp-image-4171\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-44-13-1024x662.jpg 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-44-13-300x194.jpg 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-44-13-768x497.jpg 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-44-13-1536x993.jpg 1536w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-44-13-2048x1324.jpg 2048w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-44-13-1150x744.jpg 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-44-13-750x485.jpg 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-44-13-400x259.jpg 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-44-13-250x162.jpg 250w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Next, from System Core, NVIC, select Code generation and uncheck Generate IRQ handler. The interrupt handler is handled by mangoose itself.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"662\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-47-52-1024x662.jpg\" alt=\"\" class=\"wp-image-4172\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-47-52-1024x662.jpg 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-47-52-300x194.jpg 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-47-52-768x497.jpg 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-47-52-1536x993.jpg 1536w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-47-52-2048x1324.jpg 2048w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-47-52-1150x744.jpg 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-47-52-750x485.jpg 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-47-52-400x259.jpg 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-47-52-250x162.jpg 250w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Next, from Security, enable RNG peripheral as follows:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"662\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-50-25-1024x662.jpg\" alt=\"\" class=\"wp-image-4173\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-50-25-1024x662.jpg 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-50-25-300x194.jpg 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-50-25-768x497.jpg 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-50-25-1536x993.jpg 1536w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-50-25-2048x1324.jpg 2048w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-50-25-1150x744.jpg 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-50-25-750x485.jpg 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-50-25-400x259.jpg 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-50-25-250x162.jpg 250w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Next, from Project Manager tab, select code generation and enable Generate peripheral as pair of &#8220;.c\/.h&#8221; files per peripheral as follows:<\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"662\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-53-22-1024x662.jpg\" alt=\"\" class=\"wp-image-4174\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-53-22-1024x662.jpg 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-53-22-300x194.jpg 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-53-22-768x497.jpg 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-53-22-1536x993.jpg 1536w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-53-22-2048x1324.jpg 2048w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-53-22-1150x744.jpg 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-53-22-750x485.jpg 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-53-22-400x259.jpg 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-53-22-250x162.jpg 250w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Next, from project, give the project a name, select toolchain\/IDE to be STM32CubeIDE and click on generate code as follows:<\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"662\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-55-24-1024x662.jpg\" alt=\"\" class=\"wp-image-4175\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-55-24-1024x662.jpg 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-55-24-300x194.jpg 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-55-24-768x497.jpg 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-55-24-1536x993.jpg 1536w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-55-24-2048x1324.jpg 2048w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-55-24-1150x744.jpg 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-55-24-750x485.jpg 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-55-24-400x259.jpg 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_10-55-24-250x162.jpg 250w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>This will generate the code.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">3. Importing Project to STM32CubeIDE:<\/h2>\n\n\n\n<p>Open STM32CubeIDE, select your workspace and click on Launch.<\/p>\n\n\n\n<p>From the IDE, click File and select STM32 Project Create\/Import as follows:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"873\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2025\/11\/2025-11-26_16-57-21-1024x873.jpg\" alt=\"\" class=\"wp-image-3997\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2025\/11\/2025-11-26_16-57-21-1024x873.jpg 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2025\/11\/2025-11-26_16-57-21-300x256.jpg 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2025\/11\/2025-11-26_16-57-21-768x655.jpg 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2025\/11\/2025-11-26_16-57-21-1150x981.jpg 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2025\/11\/2025-11-26_16-57-21-750x640.jpg 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2025\/11\/2025-11-26_16-57-21-400x341.jpg 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2025\/11\/2025-11-26_16-57-21-250x213.jpg 250w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2025\/11\/2025-11-26_16-57-21.jpg 1524w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Next, from Import STM32 Project, select STM32CubeMX\/STM32CubeIDE Project and click on Next as follows:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"769\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2025\/11\/2025-11-26_17-00-37-1024x769.jpg\" alt=\"\" class=\"wp-image-3998\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2025\/11\/2025-11-26_17-00-37-1024x769.jpg 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2025\/11\/2025-11-26_17-00-37-300x225.jpg 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2025\/11\/2025-11-26_17-00-37-768x577.jpg 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2025\/11\/2025-11-26_17-00-37-1150x863.jpg 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2025\/11\/2025-11-26_17-00-37-750x563.jpg 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2025\/11\/2025-11-26_17-00-37-400x300.jpg 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2025\/11\/2025-11-26_17-00-37-250x188.jpg 250w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2025\/11\/2025-11-26_17-00-37.jpg 1172w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Next, select the folder that contains the .ioc file and click on Finish as follows:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"652\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_11-00-34-1024x652.jpg\" alt=\"\" class=\"wp-image-4176\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_11-00-34-1024x652.jpg 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_11-00-34-300x191.jpg 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_11-00-34-768x489.jpg 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_11-00-34-1536x977.jpg 1536w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_11-00-34-1150x732.jpg 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_11-00-34-750x477.jpg 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_11-00-34-400x255.jpg 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_11-00-34-250x159.jpg 250w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_11-00-34.jpg 1760w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>The project now shall appear in project window.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">4. Basic Code Setup and Test:<\/h2>\n\n\n\n<p><\/p>\n\n\n\n<p>Open main.c file.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>In user begin Includes, include stdio.h as follows:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;C&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">#include &quot;stdio.h&quot;<\/pre><\/div>\n\n\n\n<p>In user code begin 0, declare the following two functions:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;C&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">int _write(int fd, unsigned char *buf, int len)\n{\n  if (fd == 1 || fd == 2)\n  {                     \/\/ stdout or stderr ?\n    HAL_UART_Transmit(&amp;huart3, buf, len, 999);  \/\/ Print to the UART\n  }\n  return len;\n}\n\nuint64_t mg_millis(void)\n{\n  return HAL_GetTick();\n}<\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>In while 1 loop in user code begin 3:<\/p>\n\n\n\n<p><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;C&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">printf(&quot;Tick: %lu\\r\\n&quot;, HAL_GetTick());\nHAL_Delay(500);<\/pre><\/div>\n\n\n\n<p>Save, build and run the project as follows:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"34\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2025\/12\/2025-12-31_11-12-13-1024x34.jpg\" alt=\"\" class=\"wp-image-4132\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2025\/12\/2025-12-31_11-12-13-1024x34.jpg 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2025\/12\/2025-12-31_11-12-13-300x10.jpg 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2025\/12\/2025-12-31_11-12-13-768x26.jpg 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2025\/12\/2025-12-31_11-12-13-1536x51.jpg 1536w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2025\/12\/2025-12-31_11-12-13-1150x38.jpg 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2025\/12\/2025-12-31_11-12-13-750x25.jpg 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2025\/12\/2025-12-31_11-12-13-400x13.jpg 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2025\/12\/2025-12-31_11-12-13-250x8.jpg 250w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2025\/12\/2025-12-31_11-12-13.jpg 1986w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>You should get the following results:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"707\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_11-05-38-1024x707.jpg\" alt=\"\" class=\"wp-image-4177\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_11-05-38-1024x707.jpg 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_11-05-38-300x207.jpg 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_11-05-38-768x530.jpg 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_11-05-38-1536x1060.jpg 1536w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_11-05-38-1150x794.jpg 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_11-05-38-750x518.jpg 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_11-05-38-400x276.jpg 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_11-05-38-250x173.jpg 250w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/01\/2026-01-17_11-05-38.jpg 1866w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Now, the minimal firmware is working.<\/p>\n\n\n\n<p>Next, we shall include mangoose itself and ping test the ethernet.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Stay tuned.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Happy coding \ud83d\ude09<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this first part of the Mongoose guide for STM32, we focus on the foundational steps required to get the platform up and running, starting with the hardware setup and basic system initialization. We also cover UART configuration to enable reliable serial communication for debugging and early-stage validation. In this guide, we shall cover the [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,11,12],"tags":[],"class_list":["post-4164","post","type-post","status-publish","format-standard","hentry","category-embedded-systems","category-peripheral-drivers","category-stm32"],"_links":{"self":[{"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/posts\/4164"}],"collection":[{"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4164"}],"version-history":[{"count":1,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/posts\/4164\/revisions"}],"predecessor-version":[{"id":4178,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/posts\/4164\/revisions\/4178"}],"wp:attachment":[{"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4164"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4164"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4164"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}