AN2078
1
IAP overview
IAP overview
1.1
Principle
The IAP driver must be programmed by the user in the Flash base address (0x00) via JTAG
using a flasher toolset.
Using the UART, the IAP driver loads a binary file from the HyperTerminal to the STR7xx
internal Flash, and then jumps to execute it.
1.2
IAP driver description
The following table shows the IAP driver code size for each STR7xx MCU.
STR71x
7.2 Kbytes
STR73x
8.3 Kbytes
STR75x
5.8 Kbytes
The IAP driver contains a set of source files:
● main.c: where the UART initialization and PLL configuration are set. Then, a main
menu is executed from the common.c file.
● common.c: contains display functions and the main menu routine. The main menu
gives the choice between loading a new binary file and executing the binary file already
loaded.
● ymodem.c and download.c: they allow all data to be received from the HyperTerminal
application (using the YMODEM protocol1)), then loaded into STR7 internal RAM. In
the event of a failure in data receival, the ‘Failed to receive the file’ error message is
displayed on the HyperTerminal window. However, if successful, the data is then
programmed into internal Flash at the appropriate address. A comparison between
internal RAM and internal Flash contents is performed to check the data intergrity. If
there is any discrepency, the ‘Verification failed’ error message is displayed on
HyperTerminal window. Other error messages are also displayed when the image size
is higher than the allowed space memory and when there is an abort by the user.
Note: 1 Ymodem protocol sends data in 1024-byte blocks. A check for errors in data blocks
transmitted to the STR7xx Internal RAM is applied: A comparison between the transmitted
and received data is achieved. Blocks received unsuccessfully are acknowledged with a
NAK (Negative Acknowledgement). For more details about the Ymodem protocol, refer to
existing documentation.
● Some STR7xx Standard library and Flash library files.
A pin connected to a push button is used to select between jumping to the user application
and executing the IAP for reprogramming purpose:
● Push button is not pressed at reset: jump to the user application
● Push button is pressed at reset: the IAP main menu is displayed
Figure 1 shows the IAP flowchart.
3/13