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)

Only one user application image may be stored in flash at any time.

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 BIM. 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

BIM

  • Search for the proper image in FLASH

  • Copy new user image

  • Ensure validity and optionally security of image before running

Persistent application

  • Providing lightweight application that implements the OAD profile

Stack (2)

  • BLE protocol stack implementation

User application

  • User application

  • Must implement OAD reset service

../_images/ditaa-c1b70737d72609533669b5da1c7f9fda7f576eaf.png

The user 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 persistent application (referred to as OAD_IMG_A) pictured above is responsible for the following:

  • Implementing the protocol stack definition of the OAD service This image

  • is permanently resident on the device

The location of the persistent application varies depending on the flash size available for the selected device variant. This is done to maximize the user’s application space. Refer to the linker cmd file define IMG_A_FLASH_START to further determine where precisely the persistent application is located.