5. CodeLess SDK Information

5.1. Introduction

Although the purpose of CodeLess is to not have to go through the source code, some general information could be useful.

5.2. CodeLess Development Environment

CodeLess has been developed using the Keil® Microcontroller Development Kit (mainly μVision IDE and ARM C compiler). The CodeLess project (codeless_585.uvprojx) within the \projects/target_apps/codeless/codeless_5xx directory. The project is common for both DA14585 and DA14531, but different targets (codeless_585, codeless_586, codeless_531_datapump, codeless_531_standalone) can be selected when the project opens. Note that as of now the codeless_586 target is not supported. The project consists of the SDK files prefixed with sdk_ and the application files that begin with the user_ prefix.

If you are not familiar with Dialog projects, DA14585 Getting Started and DA14531 Getting Started may be useful. The application related files are named after their respective functionality.

_images/structure.png

Figure 38 Keil® µVision® IDE Showing CodeLess Project Structure

5.3. DA145xx RAM Resources and CodeLess

The CodeLess software has been heavily optimized but contains a large number of features: binary data transfer, SUOTA, spi flash storage for bonding database, events, handlers and connection parameters, several additional AT Commands as compared to previous versions, and so on. DA14585 has 96 kB of system RAM whereas DA14531 has more limited resources and in particular 48 kB of system RAM. Although the DA14585 resources are enough for the complete CodeLess software, this is not the case for DA14531. This is the reason behind the different DA14531 targets. The following paragraphs describe ways of reducing the memory footprint of the source code.

5.4. Configuring CodeLess Source Code

CodeLess is a complex piece of software containing many services and AT commands. To make the software as configurable as possible several #define directives have been included within the source code. An example of such configuration is the configuration of the DA14531 in the standalone mode. This section explains certain directives having to do with an external flash, SUOTA, and AT Commands. Note that to make use of the information included in this section the user should be familiar with the uVision® IDE and the Keil embedded development tools for ARM® since building of the source code is required for the changes to take effect.

5.5. Flash Memory Support, SUOTA and SPI Commands

CodeLess uses external SPI flash memory by default. Apart from supporting the SUOTA service, several AT commands (events, handlers, bonding database management, connection parameters) use the flash memory to store information that will be available when the device loses power or reboots.

However, the CodeLess software can also work without external flash memory by storing all information in RAM resulting in a reduced memory footprint. In this case, the SUOTA service will not be available and the user will have to reconfigure CodeLess on boot. To disable support for flash memory the user must undefine two symbols within the user_profiles_config.h file.

Table 6 Macros about Flash and SUOTA

Symbol

Description

File

CFG_SPI_FLASH_ENABLE

If this macro is defined, then the CodeLess software will support external flash memory

user_profiles_config.h

CFG_PRF_SUOTAR

If this macro is defined the CodeLess software will support the SUOTA service

user_profiles_config.h

Note that the SUOTA service cannot operate without external flash memory thus a warning will be issued in that case. On the contrary it is possible to remove support for the SUOTA service while keeping support for the spi flash memory. Re-building the source code and generation of a new binary file will be necessary for the changes to take effect. Finally, when the SPI flash is enabled the set of SPI commands (AT+SPICFG, AT+SPIWR, AT+SPIRD, AT+SPITR) will not be available. If the SPI flash is disabled, then the commands will be included by default in the DA14585 case.

Note

For DA1453x the commands will be available in the standalone version provided that the second set of commands is used.

5.6. Enabling/Disabling Specific AT Commands

Specific AT commands can be disabled and enabled AT using #define directives. The related source code is found in the user_at_commands.h header file. There are two configurations, one for the DA14585 and one for the DA14531. As mentioned in the DA14585 case, all commands are available and therefore there is no need to exclude certain commands.

However, in the DA1453x datapump/standalone cases where memory is limited specific commands or acombination of commands may be needed in a special use case. It is up to the user to ensure that any changes provide meaningful results (for example, ensure that connections are feasible) and that fit in the DA1453x available memory.