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)

The following points must be considered for On-chip OAD applications:

  • 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

  • Search for the proper image in FLASH

  • Ensure validity and security of image before running

  • Jump to the valid and newest image

Persistent application

  • Providing lightweight application that implements the OAD profile

  • Permanent resident on the device

Stack (2)

  • BLE protocol stack implementation

User application

  • User application

  • Must implement OAD reset service

  • Implementing customer defined behavior

../_images/ditaa-9eb071e583f421cbedbda9744819be25b1dd5f31.png

Note

Based on different devices, the address of each component listed above might vary. The address used in the persistent application linker file should match the settings in the flash_map_backend.h file.

Listing 161. Flash addresses for various components
#define BOOTLOADER_BASE_ADDRESS            0x00000000
#define BOOT_BOOTLOADER_SIZE               0x00006000
#define BOOT_PRIMARY_1_BASE_ADDRESS        0x00006000
#define BOOT_PRIMARY_1_SIZE                0x00076000
#define BOOT_SECONDARY_1_BASE_ADDRESS      0x00043000
#define BOOT_SECONDARY_1_SIZE              0x0003d000