o every working field to update the software by on-line programming. This will be very unconvenient and will waste a lot of human and material resources. While IAP based on HTTP, can do all the updating work remotely on the web, which is very convenient and saves a lot of human and material resources. This kind of simple way is very customer-friendly, which will no doubt increase the competitive power of the embedded products.
III. SYSTEM MODEL DESIGN系统模型设计
A. Hardware platform
This IAP method uses STM32F107 MCU as the experiment hardware platform.
1) STM32F107 MCU introdution
STM32F107 is 32-bit microcontroller, it features a high-quality 10/100M Ethernet peripheral to interface the PHY. It has an internal UART bootloader on chip which can be used for ISP as the ultimate programming method. It has 256 Kbytes of on-chip Flash memory, up to 64 Kbytes of SRAM. Its internal flash memory can be written protected in 4Kbytes, erased in 1Kbytes or 2Kbytes and written in 2bytes. Program running in one block can write to another block. So STM32F107 is very suitable for IAP applications [2].
2) system model overview
![](/scPhotoFile/2016/0420/20160420124918901890.jpg)
Figure 1. system model
The system model is described in figure 1. Every embedded product in the network has a different IP address. Engineers can access each different terminal with a web browser and upload the firmware into it remotely and don’t affect the normal working of the embedded system. The IP address can be set either as a static address or as a dynamic address assigned by a DHCP server. After IP address assignment, the user can start the IAP process.
B. IAP software model
This IAP implementation consists of a simple HTTP web server on top of the LwIP stack, allowing users to update the firmware program by a web browser on the web remotely.
1) LwIP introdution
The LwIP is a free lightweight TCP/IP stack developed by Adam Dunkels at the Swedish institute of computer science (SICS) and licensed under the BSD license. While retaining the main function of TCP/IP, LwIP reduces the employment of RAM. It only needs several hundred bytes of RAM and about 40Kbytes of ROM to run smoothly, which makes it very suitable for an embedded system [3]. The LwIP supports the following protocols: IPv4, IPv6, UDP, TCP, ICMP, IGMP, SNMP, ARP and PPP. But it does not include protocols from the application layer, like HTTP or TFTP. The official release of the LwIP does not provide any port to any microcontroller. We need to do it by ourselves.
2) Principles of IAP
In the IAP implementation, there are two parts of code in the flash. The first part is the IAP code, which doesn’t relate to the application function. It is placed at the starting address of the flash. The only function of this part of code is to receive user application firmware from Ethernet interface, and to update the second part of code. The second part of code is the user application code, and it is placed behind the IAP code.
![](/scPhotoFile/2016/0420/20160420124961756175.jpg)
Figure 2. IAP operation flow
Figure 2 shows the IAP operatinon flow chart. IAP code is firstly executed after MCU powered on. During the execution of the IAP code, a flag bit as the operation condition will be checked to decide if to update the user application code or not. This flag bit can be a connected jumper, a down pressed b
本论文由英语论文网提供整理,提供论文代写,英语论文代写,代写论文,代写英语论文,代写留学生论文,代写英文论文,留学生论文代写相关核心关键词搜索。