
Demonstrates downloading CubeIDE from the official site, including accepting the license, creating a free account, logging in, and starting the Windows installer download for a 729 MB file.
Install CubeIDE by extracting the downloaded package, running the installer, and choosing a destination with required drivers. Launch, allow firewall access, and set a workspace to complete the setup.
Download the STM32CubeF7 documentation, datasheet, and reference manual, then organize the library and user guides for HAL-based embedded ethernet and LWIP integration.
Learn how to prepare the HAL package for embedded ethernet by extracting the driver and lwip middleware, trimming to needed peripherals, and integrating the library into your project.
Create a correct project tree for an stm32 hal lwip project by organizing include and source folders and lwip middleware. Set up startup and system files to enable clean builds.
Configure the system clock to 200 MHz using the RCC PLL, choosing high-speed external or internal sources, and visualize the clock tree for APB1 50 MHz and APB2 100 MHz.
Configure the system clock with HAL by initializing RCC structures, enabling the power regulator, enabling overdrive, and configuring the PLL and APB1/APB2 dividers.
Configure and initialize the gpio output driver by mapping leds to port pins, defining symbolic names, and implementing a gpio init and on/off function using the hardware abstraction layer.
Develop the gpio output driver by implementing a switch-based function to turn on and off green, blue, red, and custom leds via gpio pins, including header prototypes and initialization.
Configure uart module 3 in HAL by setting gpio as alternate function, enabling RCC clock, and initializing baud rate, word length, stop bits, parity, and tx for debugging output.
Develop and retarget a HAL UART driver with a putchar function to transmit data and compute baud rates, then align system core clock to 200 MHz for accurate SysTick timing.
Configure the adc pair and set up adc1 channel four with 12-bit resolution using a software trigger. Initialize the adc and configure the regular channel with sampling time.
Configure and initialize the ATC adc driver, start conversions, and read converted values in a loop. Test with a potentiometer or jumper to verify readings from the adc.
Explore the fundamentals of networking, including hosts with unique addresses, LAN and WAN types, VPN security, and the roles of IP addresses, routers, gateways, and packets.
Explore the seven-layer iso model and the tcp/ip five-layer model, and see how physical, link, network, transport, and application layers shape communication, addressing, and protocols.
Explore tcp/ip concepts, including ipv4 and ipv6 addresses, network id and host id, netmasks and gateways, and udp vs tcp for multicast, voice over ip, and reliable delivery.
Explore the stm32f7 ethernet mac features, including ieee 802.3 compliance, dma for automatic data flow, and mii or rmii transfers at 10/100 mbps. Review smi access via mdio/mdc for the phy registers and csma/cd operation.
Configure the stm32f7 ethernet mac by mapping pins to alternate function 11, selecting rmii or mii modes, and interfacing with an external phy via mdc and mdio.
Explore how the embedded Ethernet module supports 10/100 mbps, full/half duplex, CSMA/CD, and IEEE 802.3 flow control. Review CRC, padding, address filtering, VLAN tagging, and IPv4/IPv6 checksum checks.
Configure the ethernet GPIOs and clocks, and initialize the HAL ethernet handle. Set alternate functions, enable interrupts, and outline the low-level init to connect to the IP stack.
Implement the ethernet low-level init function using the lwIP network interface structure. Configure mac address, auto negotiation, speed, duplex, and link status to mark the interface up.
Develop the ethernet low-level init function by configuring dma descriptor lists and buffers, setting mac address and mtu, enabling arp and broadcast, and enabling interrupts for the hal ethernet stack.
Develop a low level dma ethernet transmit function by duplicating the project, fixing build errors, and implementing a dedicated output routine that uses dma descriptors and frame copies.
Develop the dma ethernet low level transmit function by copying the payload into the text buffer with proper offsets and descriptors, then handle errors and resume dma on underflow.
Develop a low level ethernet receive function that allocates a PBF from the lwip pool, retrieves the rx frame info via DMA, and copies payload into buffers with proper offsets.
Develop the DMA ethernet low level receive function by copying data to the PBF, updating DMA descriptors, and handling bytes left to copy and payload offset to resume reception.
Implement the ethernet interface input function for lwIP in a hal-based embedded project, moving received packets into pbufs, handling errors, and integrating a current tick function for lwIP timing.
Implement ethernet interface init by setting netif name and wiring netif output to low level functions; initialize hardware with the low level init, and incorporate ARP and netif fields.
Implement the ethernet interface update config function as a link-change callback, check link status, manage auto negotiation, set duplex and speed via hardware registers, and restart the MAC.
lwip provides a free, lightweight tcp/ip stack for embedded devices, supporting ipv4/ipv6, tcp, udp, dns, dhcp, arp, and offering raw, netconn, and socket APIs for flexible networking.
Explore the lwIP architecture and how the stack maps to the sdm32 microcontroller, including the network interface layer and tcp/udp transport. Review pbuf structures and memory configurations.
Develop the lwip init function to configure ip parameters, including ip address, netmask, and gateway, and register the network interface with the lwip stack, including the link callback for updates.
Test the lwip ip driver to detect ethernet cable status using a connection-change callback, initialize the lwip library, and print cable status, preparing for a future simple web server lesson.
Acquire an IP address dynamically using DHCP in an lwip-based embedded project, enable DHCP in the lwip options, remove static IP configuration, and verify the assigned address on the board.
Host a web page on an embedded device using httpd with lwip, creating html pages and a maintenance page to ensure reliable web access.
Explore how SSI and CGI enable dynamic content on the server by evaluating directives in HTML pages and passing form data to applications.
Display real-time data on webpages using server side includes (ssi) in lwip, showing current time via time.html and an ssi tag that updates every two seconds.
Learn to work with multiple SSI tags in embedded ethernet programming with HAL, configuring two tags to display time and ADC sensor values via ATC with a switch-case flow.
Add a new ssi tag page to display the push button state on pc13, refreshing every two seconds across three pages.
Combine multiple SSI tags into all modules in one page and observe that the same tags update across all pages, including the dashboard.
Learn how to control a microcontroller's peripherals via a web server using CGI, with HTML forms and an LCD control page, enabling browser-based commands and LED control.
Learn to inject HTML from firmware into a webpage using SSI and CGI, enabling programmatic image swaps and checkbox control on embedded Ethernet pages.
Demonstrates injecting HTML code into a webpage using SSI and CGI, applying on/off images for red, blue, green, yellow bulbs to reflect real-time flags.
Wrap up the course by acknowledging its end, invite questions or suggestions via the questions area, and express gratitude for reaching the end.
Welcome to Embedded Ethernet Programming with HAL Training.
This course is the intermediate level course of a 3 course learning path teaching you how to write drivers for the ethernet peripheral as well as write embedded ethernet firmware for different networking protocols such as http, dhcp etc.
The goal of this course is to teach you how to build real world embedded ethernet applications.
What make this course different from the beginner course ?
In this course we write all the ethernet drivers ourselves using the the STM32 HAL APIs. Unlike the beginner course, in this course we also implement the ethernet interface files linking our ethernet module to the LwIP library ourselves.
The STM32 Hardware Abstraction Layer (HAL) provides a simple, generic multi-instance set of APIs (application programming interfaces) to interact with the upper layers like the user application, libraries and stacks.
In this intermediate course we also implement more examples of embedded ethernet applications.
So with that understood, let me tell you…
Exactly What You’re Getting
This intermediate course can be divided into 4 major sections.
First Section
In the first section we give a short introduction to networking and then explore the ethernet capabilities of the STM32F7 microcontroller.
Second Section
In this section we write drivers for all the peripherals we will be using in the course. We write drivers for the ADC, UART, RCC and GPIO.
Third Section
In the third section we write all the drivers required to fully configure the ethernet module. We will implement a driver for configuring the ethernet gpio pins to operate in RMII mode, we will implement a driver for transmitting packets, another one for receiving packets etc.
It is in this section that we decide on the ethernet parameters such the speed, the duplex, whether to use auto-negotiation or not etc. After configuring the ethernet module we conclude this section by implementing a function that interfaces our ethernet module to the Light Weight IP (LwIP) library. LwIP is a small independent open-source implementation of the TCP/IP protocol stack designed for embedded systems.
Last Section
The final section begins by giving an introduction to Light Weight IP (LwIP) and then goes on to build embedded ethernet applications. Here are some the applications we shall build:
Programming : Checking if the cable is connected
Programming : Getting an IP address from DHCP
Programming : Hosting Webpages with httpd
Programming : Displaying Realtime Data on Webpages with SSI
Programming : Working with Multiple SSI Tags
Programming : Controlling Hardware from WebServers using CGI
Programming : Injecting HTML code into a Webpage using SSI and CGI