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 (stack library)¶
In order to perform an On-chip OAD the target system must have:
The user application must be sufficiently small in order to fit into the flash layout system described below
User app functionality is lost while performing OAD (Persistent app is running)
Internal Flash Memory Layout¶
The internal flash of the device contains the active user application, the user application’s stack, the persistent application, the persistent application’s stack, and the secure bootloader. Each application’s role is defined below.
Note
As we have assumed the stack-library approach, the stack images referenced below are a part of each application image (i.e. the user and persistent apps have their own dedicated stack)
Application Name |
Description |
MCUBoot bootloader |
|
Persistent application |
|
Stack (2) |
|
User application |
|
The user application pictured above is responsible for the following:
Implementing the protocol stack definition of the OAD reset service
Implementing customer defined behavior
The persistent application pictured above is responsible for the following:
Implementing the protocol stack definition of the OAD service
is permanently resident on the device
Note
Based on different device, the address of each component listed above might vary. The exact address can be found in the persistent application linker file.
#define PERSISTENT_BASE 0x6000
#define NVS_BASE 0x30000
#define APP_BASE 0x34000
#define MCU_HDR_SIZE 0x100
#define MCU_TLV_SIZE 0x120
#define MCUBOOT_SIZE 0x6000
#define NVS_SIZE 0x4000
#define MCU_OVERHEADS (MCU_HDR_SIZE + MCU_TLV_SIZE)