1. Introduction

This document describes how to enable the support for flashing over SEGGER JLink GDB server. This tutorial applies to the DA1469x product family.

The document will guide you through the steps required to set up your environment. This feature improves the productivity as it shortens the rebuild and reload cycle during a debug session.

The required steps to set up the environment are:

  • Update the SDK to generate a bootable QSPI image from the GCC

  • Update Eclipse configuration to flash loading

The document concludes with 5. Troubleshooting.

Note

The minimum required SEGGER JLink version is 7.60h.

2. Environment Setup

Please make sure you have followed the Getting Started Guide and your environment is correctly configured.

You should be able to:

  • Compile an application both in RAM and QSPI mode

  • Use the QSPI scripts to program the flash of the DA1469x device

  • Run a debug session both in RAM or QSPI mode

SmartSnippets™ Studio 2.0.7 facilitates to install JLink 6.40. However, this version does not support the DA1469x flash. So, you will need to upgrade the JLink toolchain. The minimum required JLink version is 6.43c.

3. Application Configuration

In order to successfully load the built code in the QSPI flash, it is necessary to build the firmware with the necessary flash headers. In the DA1469x case, this means the product header and the image headers. These headers are described in FLASH section of the DA1469x datasheet.

3.1 Adding Headers to the ELF File

The linker can be configured to add headers to the ELF file. To do this, add the following definition in config/custom_config_qspi.h of your application.

#define dg_configUSE_SEGGER_FLASH_LOADER (1)

In the sdk/bsp/ldscripts/ble_projects/sections_da1469x.ld.h you need to apply the following change

--- a/sdk/bsp/ldscripts/ble_projects/sections_da1469x.ld.h
+++ b/sdk/bsp/ldscripts/ble_projects/sections_da1469x.ld.h
@@ -50,7 +50,7 @@ GROUP(libgcc.a libc.a libm.a libnosys.a)
#endif

#if ( dg_configUSE_SEGGER_FLASH_LOADER == 1 )
-#define QSPI_FLASH_ADDRESS 0x0
+#define QSPI_FLASH_ADDRESS 0x16000000
#define QSPI_FW_BASE_OFFSET 0x2000

For more details on how this step modifies the generated application image, please look into the linker script, sdk/bsp/ldscripts/ble_projects/sections_da1469x.ld.h, of the DA1469x SDK.

Note

The application with the flash header set cannot be written in the flash using the qspi python scripts.

3.2 SDK Wide Configuration

It is possible to configure the SDK to compile all applications with the flash loader. In order to do this, add the following statement at the beginning of <SDKROOT>/sdk/bsp/config/bsp_defaults.h:

#if (dg_configCODE_LOCATION == NON_VOLATILE_IS_FLASH)
#ifndef dg_configUSE_SEGGER_FLASH_LOADER
#define dg_configUSE_SEGGER_FLASH_LOADER (1)
#endif
#endif

It only adds the loader when the code is built in QSPI mode (not in RAM mode). The value in the application can be overridden if required.