2. Implementation

This section provides the steps required to execute application images of 1 MB in size. The first step involves writing the appropriate entry in the Configuration Script section in OTP. To do so, execute the following steps:

  1. On the SmartSnippets Welcome page, click SmartSnippets Toolbox (latest version - currently SmartSnippets Studio 2.0.18).

  1. In the newly displayed window open a new instance of SmartSnippets Studio. To do so, execute the following steps:

    1. (Optional) Select New to create a new project (1). In the New Project window, enter a name for the project (2). This step is optional if a project has already been created.

    2. Choose an available project (4).

    3. Choose a communication interface (3) and a port (5).

    4. Select the family of devices to use (6). This should be the DA1469x-00.

    5. Open the selected project (7).

'Opening SmartSnippets Toolbox'

Figure 2 Opening a Project in the SmartSnippets Toolbox

  1. Switch to the OTP Programmer window located under the Tools menu bar.

'Enabling Secure Boot Manually - Opening OPT Programmer'

Figure 3 Opening OPT Programmer

  1. In the OTP Header [Device: DA1469x-00] window, click Connect:

    1. A cursor should start rotating waiting for the device to reboot.

    2. Press the RESET button on the DA1469x daughterboard and wait for the SmartSnippets Toolbox to connect to the target chip.

    3. Once connected, the cursor should stop rotating.

'Enabling Secure Boot Manually - Connecting to the Device'

Figure 4 Connecting to the Device

  1. Being at the same window click on the icon as illustrated below:

'Enabling Secure Boot Manually - Opening Configuration Script'

Figure 5 Opening Configuration Script

  1. In the Manage Configuration Script window, select Register Configuration (1) and then click Add (2):

'Enabling Secure Boot Manually - Adding New Entry'

Figure 6 Adding New Entry

  1. In the pop-up window click Select (3). In the newly displayed window search for CACHE_FLASH_REG (4). Once the register is found, click on it (5) and then select OK (6). Next, declare the register’s value as illustrated below (7) and finally click OK (8).

'Enabling Secure Boot Manually - Declaring New Entry'

Figure 7 Declaring New Entry

  1. In the Manage Configuration Script window, select OK (9).

  2. In the OTP Header [Device: DA1469x-00] window, click Burn to write the newly defined entry in OTP.

'Enabling Secure Boot Manually - Writing to the OTP #1'

Figure 8 Writing to the OTP

  1. In the pop-up window select Burn to write the previously defined entries in the OTP memory.

'Enabling Secure Boot Manually - Writing to the OTP #2'

Figure 9 Burning the OTP

  1. After burning the OTP header, the partition table used should be changed accordingly. In general, all partition entries that contain application code and are accessed by the cache controller should be aligned to FLASH_REGION_SIZE. An offset of up to 0x4000 is allowed. For this demonstration, both the firmware and generic partition entries, that is NVMS_FIRMWARE and NVMS_GENERIC_PART respectively, should be 1 MB aligned. A reference partition table is illustrating below:

Note

The NVMS_PRODUCT_HEADER entry should always start at 0x0000 and its size should be 0x2000. The rest of the partition entries can be modified according to user’s needs.

/*1MB partition table*/

#define NVMS_PRODUCT_HEADER_PART_START  0x000000
#define NVMS_PRODUCT_HEADER_PART_SIZE   0x002000

/*
* Alignment to 1MB is dictated by the default FLASH_REGION_SIZE.
*
* \note: NVMS_FIRMWARE_PART_SIZE = 0x100000 - 0x2000 = 0x0FE000
*/
#define NVMS_FIRMWARE_PART_START        0x002000
#define NVMS_FIRMWARE_PART_SIZE         0x0FE000

/*
* Only areas that accessed by the cache controller should be 1MB aligned.
* The generic partition is accessed via the QSPI controller directly,
* so there is no need to be 1MB alligned .
*/
#define NVMS_GENERIC_PART_START         0x100000
#define NVMS_GENERIC_PART_SIZE          0x020000

/*User definitions*/
#define NVMS_PLATFORM_PARAMS_PART_START 0x120000
#define NVMS_PLATFORM_PARAMS_PART_SIZE  0x020000

#define NVMS_PARAM_PART_START           0x140000
#define NVMS_PARAM_PART_SIZE            0x001000

#define NVMS_LOG_PART_START             0x141000
#define NVMS_LOG_PART_SIZE              0x2BC000
#define NVMS_BIN_PART_START             0x3FD000
#define NVMS_BIN_PART_SIZE              0x002000

/*
* Should be placed 4 kBytes (1 FLASH sector size) before the end
* of the selected FLASH size.
*
* \note: If this is not the case, then Toolbox will not recognize
*        your new partition scheme!!!
*/
#define NVMS_PARTITION_TABLE_START      0x3FF000
#define NVMS_PARTITION_TABLE_SIZE       0x001000

PARTITION2( NVMS_PRODUCT_HEADER_PART  , 0 )
PARTITION2( NVMS_FIRMWARE_PART        , 0 )
PARTITION2( NVMS_GENERIC_PART         , PARTITION_FLAG_VES )
PARTITION2( NVMS_PLATFORM_PARAMS_PART , PARTITION_FLAG_READ_ONLY )
PARTITION2( NVMS_PARAM_PART           , 0 )
PARTITION2( NVMS_LOG_PART             , 0 )
PARTITION2( NVMS_BIN_PART             , 0 )
PARTITION2( NVMS_PARTITION_TABLE      , PARTITION_FLAG_READ_ONLY )

Refer to Flash Adapter tutorial for more information on the Non-Volatile memory storage and how to create custom partition tables.

Warning

The NVMS_PARTITION_TABLE_START partition entry should occupy the last section of the FLASH device used in order for the SmartSnippets Toolbox to recognize the new partition scheme.

  1. By default, the SDK expects that the FW image size is 512 KB. However, if an application image of different size is to be supported, the dg_configQSPI_CODE_SIZE_AA macro in bsp_memory_defaults.h should be changed accordingly:

#ifndef dg_configQSPI_MAX_IMAGE_SIZE
#define dg_configQSPI_MAX_IMAGE_SIZE       ( IMAGE_PARTITION_SIZE )
#endif

#ifndef dg_configQSPI_CODE_SIZE_AA
#define dg_configQSPI_CODE_SIZE_AA         ( dg_configQSPI_MAX_IMAGE_SIZE )
#endif

Note

The CMAC code is included as a library in the QSPI build and is a part of the image. To do so, the dg_configQSPI_CODE_SIZE_AA should be equal to dg_configQSPI_MAX_IMAGE_SIZE.