Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / examples / lock-app / cc13x2x7_26x2x7 / doc / programming-ccs.md
1 # Programming and Debugging with CCS
2
3 -   Download and install [Code Composer Studio][ccs].
4
5 -   Use `xdsdfu` to determine the XDS110 serial number to identify the device.
6     This may be skipped if there is only one LaunchPad connected to your PC, but
7     it is recommended.
8
9     ```
10     C:\>cd \ti\ccs1010\ccs\ccs_base\common\uscif\xds110
11
12     C:\ti\ccs1010\ccs\ccs_base\common\uscif\xds110>xdsdfu.exe -e
13
14     USB Device Firmware Upgrade Utility
15     Copyright (c) 2008-2019 Texas Instruments Incorporated.  All rights reserved.
16
17     Scanning USB buses for supported XDS110 devices...
18     ```
19
20 <<<< Device 0 >>>>
21
22 VID: 0x0451 PID: 0xbef3 Device Name: XDS110 Embed with CMSIS-DAP Version:
23 3.0.0.13 Manufacturer: Texas Instruments Serial Num: L4100652 Mode: Runtime
24 Configuration: Standard
25
26 Found 1 device.
27
28 ```
29 In this example, my LaunchPad's XDS110 has a serial number of `L4100652`.
30
31 - Start a new Code Composer Studio Workspace. This can be named anything you
32 would like. But it is recommended that you use a blank workspace.
33
34 ![CCS step 1](images/ccs-1.jpg)
35
36 - Create a new Target Configuration File by selecting `File` >> `New` >>
37 `Target Configuration File`. This file can also be exported from UniFlash
38 with the `download ccxml` function.
39
40 ![CCS step 2](images/ccs-2.jpg)
41
42 - Name the new ccxml file a useful name. Here I use the XDS110 serial number
43 from before. Leave the Location as the shared location and click `Finish` to
44 create the file.
45
46 ![CCS step 3](images/ccs-3.jpg)
47
48 - In the new ccxml, select the `Connection` and the `Board or Device`. This may
49 be different for your setup, but all LaunchPads will use the `Texas
50 Instruments XDS110 USB Debug Probe` for the target connection. And the and a
51 `CC1352R1F3` is mounted on the `CC1352R1_LAUNCHXL` LaunchPads. Builds for
52 other LaunchPads should use the corresponding SoC name.
53
54 ![CCS step 4](images/ccs-4.jpg)
55
56 - Now set the XDS110 serial number in the advanced tab of the ccxml. First
57 select the `Advanced` tab at the bottom of the window. Then select the Debug
58 Probe in the connection tree. Then select `Select by serial number` in the
59 `Debug Probe Selection`. Then enter the serial number from `xdsdfu` earlier
60 in the `Enter the serial number` text field. Finally click `Save` to save
61 your ccxml.
62
63 ![CCS step 5](images/ccs-5.jpg)
64
65 - Clicking `Test Connection` with the LaunchPad connected will cause a JTAG
66 Integrity scan with the Debug Probe. This is a nice way to check that your
67 ccxml is setup correctly.
68
69 ![CCS step 6](images/ccs-6.jpg)
70
71 - Now open the Debug Configurations dialog to setup a new debug configuration.
72 Select `Run` >> `Debug Configurations...`.
73
74 ![CCS step 7](images/ccs-7.jpg)
75
76 - Create a new launch configuration from the default CCS launch configuration.
77 Select `Code Composer Studio - Device Debugging` and then create a new launch
78 configuration with the `New launch configuration` button.
79
80 ![CCS step 8](images/ccs-8.jpg)
81
82 - Name your new configuration. Update the `Target Configuration` field with the
83 ccxml you created earlier. Click `Apply` to save the launch configuration.
84
85 Once the launch configuration is created you do not need to re-create it
86 every time. The Debug session can be started with the `Debug` button in the
87 `Debug Configurations` dialog, or by selecting `Run` >> `Debug History` >>
88 `<launch configuration name>`.
89
90 ![CCS step 9](images/ccs-9.jpg)
91
92 - Now that the Debug session is started we can connect to the target. Make sure
93 that the right Debug Probe is selected in the `Debug` window and click
94 `Connect Target`.
95
96 ![CCS step 9](images/ccs-10.jpg)
97
98 - The target MCU is connected. The MCU is halted on connection by default.
99 Select the `Load Program...` option to select the ELF image to load.
100
101 ![CCS step 9](images/ccs-11.jpg)
102
103 - Navigate to the ELF file
104 (`${connectedhomeip}/examples/lock-app/cc13x2_26x2/out/debug/chip-cc13x2_26x2-lock-example.out`
105 file) in the `Load Program` dialog. Click `OK` to begin loading the target.
106
107 ![CCS step 9](images/ccs-12.jpg)
108
109 - After loacating the source file for `main.cpp` we can step through the code
110 as it executes.
111
112 ![CCS step 9](images/ccs-13.jpg)
113
114 [ccs]: https://www.ti.com/tool/CCSTUDIO
115 ```