Flash Layout for On-Chip OAD¶
This section will describe the method for placing images in internal flash when using on-chip OAD.
Constraints and Requirements for On-chip OAD (dual image)¶
In order to perform an on-chip OAD:
The active application must be sufficiently small in order to fit into the flash layout system described below
Only one operational user application image may be stored in flash at any time.
Internal Flash Memory Layout¶
The internal flash of the device contains the active application, the active application’s stack, the download application, the download stack, and the BIM. Each application’s role is defined below.
Note
As we have assumed the dual-image approach, the stack images referenced below are a part of each application image (i.e. the active and download apps have their own dedicated stack)
Application Name |
Description |
BIM |
|
Download application |
|
Stack (2) |
|
Active application |
|
The active application (referred to as OAD_IMG_B) pictured above is responsible for the following:
Implementing the protocol stack definition of the OAD reset service
Implementing customer defined behavior
The download application (referred to as OAD_IMG_A) pictured above is responsible for the following:
Memory area equivalent to the active application flash which is available for storage once the over-the-air download begins
The location of the download application varies depending on the flash size
available for the selected device variant. This is done to maximize the active
application space. Refer to the linker command file (.cmd) define IMG_A_FLASH_START
to further determine where precisely the download application is located.
Warning
The description above provides the starting flash layout for dual images. Once a download image has been completed, the BIM will switch the roles of the active and download applications. Thus the download application area will be marked as active to become the active application, whereas the active application memory will be prepared for the new download application. This will continue to toggle for each new image downloaded over-the-air.