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:
Figure 100 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:
Figure 101 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:
Figure 102 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 0x1D000
. 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 theapp_suotar.h
file as follows: #define PRODUCT_HEADER_POSITION 0x1D000
- 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 thebootloader.h
file as follows: #define PRODUCT_HEADER_POSITION 0x1D000
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.