This application note is intended for developers using the STM32F407/STM32F417
microcontroller. It provides implementation solutions for In-Application Programming (IAP)
using the STM32F407/STM32F417 Ethernet communications interface.
Two possible solutions are provided on top of the LwIP TCP/IP stack:
In-Application Programming (IAP) is a means of upgrading firmware in the field using the
MCU communication interfaces such as UART, USB, CAN and Ethernet.
When you boot the microcontroller, you can choose to put it in either:
●IAP mode in order to execute the IAP code,
●normal mode in order to execute the application code.
Both the IAP code and the application code are in the embedded Flash memory of the
microcontroller. The IAP code is usually stored in the first pages of the MCU Flash, and the
user application code occupies the remaining Flash area.
Figure 1 illustrates the IAP operation flow:
Figure 1.IAP operation flow
-#5RESET
%NTER)!0MODE
)!0INITIALIZATION
)!0REQUEST
9E S
2ECEIVEBINARYIMAGEAND
PROGRAMITINTOUSER&LASHAREA
.O
.O
2.2 IAP using the MCU Ethernet interface
When it is available, Ethernet is often the preferred interface for implementing IAP capability
in an embedded application. The advantages are:
●High speed communication interface (10/100 Mbit/s)
●Remote programming through the network (LAN or WAN)
●Standardized application protocols such as FTP, TFTP, HTTP on top of the TCP/IP
stack that can be used for implementing the IAP
%XECUTEAPPLICATIONCODE
-36
Doc ID 022107 Rev 15/19
IAP overviewAN3968
2.3 Implementing IAP over the Ethernet on the
STM32F407/STM32F417
This application note describes two solutions that implement IAP for the
STM32F407/STM32F417 using the Ethernet communication peripheral:
●IAP using TFTP (Trivial File Transfer Protocol)
●IAP using HTTP (Hypertext Transfer Protocol)
Both solutions run on top of the LwIP stack (v1.3.2), which is a light-weight implementation
of the TCP/IP protocol suite.
2.3.1 IAP method using TFTP
The IAP method using TFTP is widely used in embedded applications that require a
firmware upgrade capability (for example, in embedded Linux bootloaders).
TFTP is a simple file transfer protocol that works on top of the UDP transport layer. It is
intended to be used in a LAN environment. It is based on a client/server architecture, where
a client requests a file transfer (read or write operation) from a file server.
In this case the server only processes write requests from a PC TFTP client, so a simple
TFTP server is implemented on top of the LwIP stack.
2.3.2 IAP method using HTTP
A firmware upgrade using the HTTP protocol is less common than with TFTP, but it can be a
useful solution when remote programming over the Internet is needed. In this case, the TCP
transport protocol is needed to ensure optimum operation.
HTTP works on top of TCP, and offers a way of sending a binary file from a Web client
(Mozilla Firefox or Microsoft Internet Explorer) using HTML Forms. This is called HTTP Fileupload (RFC 1867).
The following sections of this document provide details about the implementation of both
IAP methods, and an explanation of how to use the software.
6/19Doc ID 022107 Rev 1
Loading...
+ 13 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.