This repository contains source files and patches to make SDK10 an installable CMake package. It allows you use CMake together with ezFlashCLI for building and flashing code instead of SmartSnippets studio or e2 studio.
Make sure you have patched the SDK and have working installations of--
- CMake
- ezFlashCLI
- GNU ARM toolchain (7-2018-q2-update recommended).
The CMake package can be installed by running
$ cmake -P /dir/to/sdk10/sdk/cmake/sdk10-export.cmake
After installing, SDK10 CMake projects should build like any other CMake project.
Note
At this point, any IDE with CMake support can be used to build SDK10 projects, including Visual Studio Code with the CMake extension. Make sure to set the toolchain detection to unspecified so the SDK10 toolchain detection script is used instead of CMake's built-in mechanism.
After following the installation instructions, all projects in the SDK10 folder can be built as standard CMake projects. The DA1459X examples repository contains additional examples and empty template projects that can be used as starting points for developing new applications.
In order to flash the target, build the flash utility target.
This target automatically builds the raw binary and calls ezFlashCLI to flash the target device.
Because projects may not require specific devices or toolchain versions, these should be left out of the project's CMakeLists.txt when possible. In order to allow these options to be configured on a per-user basis, environment variables are used. See options for more details on which options are supported and/or required by the SDK10 CMake package.
Most regular CMake options still apply (e.g. CMAKE_BUILD_TYPE, CMAKE_EXPORT_COMPILE_COMMANDS, etc.).
SDK10 specific variables can be set in the project CMakeLists.txt before importing the SDK10 CMake package, and are listed below.
DEVICE(string)Device identifier (e.g.
DA14592,DA14594). Required to be defined. The value ofDEVICEis sourced from:- the project's CMakeLists.txt if
DEVICEis explicitly set - the
SDK10_DEVICEenvironment variable if it is set
- the project's CMakeLists.txt if
TOOLCHAIN_HOME(path)- Path to toolchain home (e.g.
C:/Program Files (x86)/GNU Tools Arm Embedded/7 2018-q2-update,/opt/toolchains/gcc_arm/7_2018q2/gcc-arm-none-eabi-7-2018-q2-update). An ARM toolchain is required, but settingTOOLCHAIN_HOMEis only required if the arm-none-eabi toolchain is not available in$PATH. SDK10_INCLUDE_FILES(path list)- List of files included for all SDK sources (i.e. through the
-includecompiler flag). Optional, but likely required to build most projects (i.e.custom_config_eflash.h). SDK10_INCLUDE_DIRECTORIES(path list)- List of directories to add to the SDK10 sources' include path.
Optional, but required for some projects (i.e.
app_nvparam.h). CONFIG_USE_BLE(boolean)- Enable BLE support (must mirror C macro equivalent). Off by default.
SDK10_NVPARAM_CONFIG_DIR(path list)- List of directories used to find
app_nvparam.handapp_nvparam_values.h. The default NVPARAM values will be used if this list is not provided. SDK10_SECURE_KEYS(path)- Path to product keys XML file.
Set to
product_keys.xml(inside source directory) by default. SDK10_SECURE_CONFIG(path)- Path to security configuration XML file.
Set to
secure_cfg.xml(inside source directory) by default. SDK10_SW_VERSION(path)- Path to software version header file.
Set to
sw_version.h(inside source directory) by default. SDK10_SECURITY(boolean)- Enable secure image generation.
Enabled by default if
SDK10_SECURE_KEYS,SDK10_SECURE_CONFIGandSDK10_SW_VERSIONall point to existing files. SDK10_IMAGE(boolean)- Enable regular image generation.
Enabled by default if
SDK10_SW_VERSIONpoints to an existing file.