28. SUOTA Memory Size Modifications

Different sizes of non-volatile memory can be used with just a few small changes to the users application, secondary bootloader and the parameters used when creating a multipart image. Lets assume a 1Mb (128K byte) memory is used instead of the default 2Mb device.

In this case we could use the following memory layout:
_images/small-mem-layout.png

Figure 109 1Mb Memory Layout

This next sections describe the changes that user needs to make in order to run SUOTA on the DA1453x module. These changes are due to the fact that the flash size which is embed in the DA14531 or DA14535 module is 128 Kbytes (1-MBit).

The Hardware connection when the module is connected to the DA14531 devkitP is shown in the following figure:
Multi image summary

Figure 110 The DA14531 module connected to the DA14531 DevkitP

The Hardware connection when the module is connected to the DA1453x devkitP is shown in the following figure:
Multi image summary

Figure 111 The DA14535 module connected to the DA1453x DevkitP

28.1. Application Modifications

As can be seen from the memory layout above, the location of the product header has been changed from the default value of 0x38000 (when using a 2Mb flash) to 0x1F000. The SUOTA service implementation has to be modified so it can find the header in this new location.

To do this simply change the value of the PRODUCT_HEADER_POSITION macro in the app_suotar.h file as follows:
#define PRODUCT_HEADER_POSITION     0x1F000
Next, change the SPI flash memory size macro in the user_periph_setup.h file as follows:
#define SPI_FLASH_DEV_SIZE          (128 * 1024)

28.2. Secondary Bootloader Modifications

Now a modification has to be made to the secondary bootloader.

Change the value of the PRODUCT_HEADER_POSITION macro in the bootloader.h file as follows:
#define PRODUCT_HEADER_POSITION     0x1F000

Then, rebuild the secondary bootloader for the target you are using (DA1453x, DA14585 or DA14586). The resulting binary file will be used when creating a multipart image, see below.

28.3. Multipart Image Generation

Once the above modifications have been made, follow the instructions SUOTA Demonstration section to create the SUOTA images and perform a software update over-the-air. Just note the following modifications to the process.

28.3.1. Secondary Bootloader

When creating a multipart image the secondary bootloader created above must be used instead of the default bootloader.

To do this, use a custom bootloader and select the binary you created when you rebuilt the secondary bootloader:
_images/multi_sec_bootloader_cust.png

Figure 112 Custom Secondary bootloader

28.3.2. Memory Offsets

When prompted for the memory offsets use the following values:
_images/multi_offsets_1mb.png

Figure 113 1Mb Memory offsets for firmware images and product header