NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.
Using Keil MDK-ARM with CC13xx/CC26xx
This article describes how to get device and debug support for CC13xx and CC26xx devices in Keil MDK-ARM using Segger J-Link.
Contents
Supported debuggers and devices[edit]
The following debug probes are supported:
- Segger J-Link
The following devices are supported:
- CC2650F128, CC2640F128, CC2630F128, CC2620F128
- CC1310F128, CC1310F64, CC1310F32
Hardware and software[edit]
The steps described in this article are tested using the following hardware and software components
- SmartRF06EB + CC2650EM-7ID and CC1310EM
- Keil MDK-ARM 5.14 Pro
- Segger J-Link debug probe (driver version 6.00g or later recommended)
- CC26xxWare v2.22.00.16101
- CC13xx and CC26xx Device Family Pack v0.0.2
It is in the following assumed that you already have MDK-ARM installed on your computer.
Installing/updating J-Link driver[edit]
CC26xx and CC13xx support requires J-Link driver version 6.00g or higher. The latest drivers are recommended and can be downloaded from here.
- Run the J-Link installer as administrator
- During installation you should be prompted to update existing J-Link DLLs on your system, make sure you select the J-Link DLL in your MDK-ARM installation.
If you are not prompted to update DLL during installation: Make sure you have MDK-ARM installed. The Segger DLL Updater can be found in the SEGGER folder of your Start Menu.
Installing CC13xx/CC26xx Device Family Pack[edit]
This section describes the steps to install the CC13xx/CC26xx Device Family Pack into MDK-ARM v5.
- Download CC13xx/CC26xx Device Family Pack: File:MDKARM-DFP-TexasInstruments.CC13xxCC26xx.0.0.2.zip.
- Open MDK-ARM
- Open the Pack installer (Project > Manage > Pack Installer...)
- In the Pack installer, select File > Import... and browse to the CC13xx/CC26xx Device Family Pack
- You should now be able to see CC26xx and CC13xx devices in the "Devices" tab
- Close the Pack installer and return to MDK-ARM
- If MDK-ARM prompts to update device definitions, click yes
Note: CC13xx and CC26xx devices require the Customer configuration area (CCFG) to be correctly set up for the device to boot. The following sections explain how to create an empty MDK-ARM project.
Create µVision project for CC26xx[edit]
This section describes how to create a new project in MDK-ARM with CC2650F128 as device.
Prerequisites
- Download CC26xxWare 2.22.00.16101 and extract it to e.g. C:\ti\cc26xxware_2_22_00_16101
In MDK-ARM, go to Project > New µVision project... to create a new project.
Choose a location and name for your µVision project file. Click Save.
The Select Device dialog appears. Select CC2650F128 as your device and click OK.
The Manage Run-time Environment dialog appears. Don't select anything, just click OK.
Add necessary files[edit]
Create empty main.c
In your project, expand the "Target 1" folder.
- Right click "Source Group 1" and select "Add New Item to Group 'Source Group 1'...".
- Select C File (.c)
- Specify "main.c" as name
- Click Add
Add the following content to main.c file and save the changes (Ctrl + S):
#include <stdint.h> int main(void) { while(1); }
Add startup file and required CC26xxWare files
- Right click "Source Group 1" and select "Add Existing item to Group 'Source Group 1'...".
- In the appearing dialog, browse and add the following folders (make sure you show "All files")
- Select <cc26xxware_dir>\startup_files\startup_keil.s and click Add
- Select <cc26xxware_dir>\startup_files\ccfg.c and click Add
- Select <cc26xxware_dir>\driverlib\bin\keil\driverlib.lib and click Add
- Close the dialog
Configure project options[edit]
Right click "Target 1" and select "Options for Target 'Target 1'..." to open the configuration dialog.
Add CC26xxWare to project include path
- Go to the C/C++ tab
- In the Include path field, add the CC26xxWare installation directory
- The include path should specify the folder containing the 'driverlib' and 'inc' folders, e.g. "C:\ti\cc26xxware_2_22_00_16101".
- Multiple include paths can be separated by semicolon
- It is recommended to enable the "C99 Mode" checkbox
Use scatter load file
To correctly place the CCFG area (in ccfg.c), the scatter load file included in CC13xx/CC26xx Device Family Pack should be used.
- Go to the Linker tab
- Uncheck "Use Memory Layout from Target Dialog"
- Select scatter file by clicking "..."
- Browse to <cc26xxware_dir>\linker_files\cc26x0f128.sct and click Open.
Note: If you are using CC26xxWare 2.20.06.14829 or older: Use the scatter file included in the CC13xx/CC26xx Device Family pack: <mdk_arm_dir>\ARM\Pack\TexasInstruments\CC13xxCC26xx\<version>\Device\Linker\cc26x0f128.sct
Click OK to close the Options dialog.
Build the project[edit]
In MDK-ARM, build the project by selecting Project > Build target.
You may get some warning messages. This is expected and will be fixed in future versions of CC26xxWare.
Configure Segger J-Link as debugger[edit]
This section describes how to configure your µVision project to use Segger J-Link as debugger.
1. In your MDK-ARM project, open the target options (e.g. Project > Options for Target 1 'Target 1'...).
2. Go to the "Utilities" tab and uncheck "Update Target before debugging".
3. Go to the "Debug" tab and select "J-LINK / J-TRACE Cortex" before clicking the Settings" button
4. In the Driver setup window, enable the Download options as shown below. Here you can also see the Segger J-Link debug probe driver version (if the probe is plugged into your computer).
5. Close the two dialogs by clicking OK twice.
You can now debug your target by selecting Debug > Start/Stop Debug Session from the menu.
Known issues[edit]
- Earlier versions of the Segger J-Link did not work reliable when low power modes were used. This has been fixed, and we recommend using version 6.00g or later of the drivers. Get the latest version here.
CC13xx/CC26xx Device Support Pack Versions[edit]
This section lists the available versions of the CC13xx/CC26xx Device Support Pack versions.