Complexity: medium
What do you need:
- two CC1310 LaunchPads Out of Box
- Code Composer Studio
- TI RTOS
This blog explains how you can debug two LaunchPads at the same time, on one computer. This is particularly useful for the CC1310, where you try out radio conversations between two controllers.
You'll learn how to address the LaunchPads individually. You'll learn how to run two debug sessions on the same computer |
Make one LaunchPad the Sender, the other Receiver
Label one Launchpad as sender and the other as receiver. Just put a label on with the text TX and RX.
From that moment on, you have a visual indicator that tells who is who.
To make the computer know who is who, you need to retrieve the serial number of the on-board debugger.
There is a command line tool in CCS to query that code.
Plug in the TX launchPad only, and run the following command from the OS prompt:
cd C:\ti\ccsv6\ccs_base\common\uscif\xds110 xdsdfu /e
You will get the Serial Num back of your TX Launchpad. Write this code on that label that you just taped on the board.
Unplug TX and plug in the RX board.
Run the xdsdfu /e command again.
You will get a different number. Write that on the RX board.
Our first step is done. You and the computer can identify the individual LaunchPads.
You can now connect both LaunchPads at the same time to your computer. In the next section you 'll see how CCS will talk to each one in isolation.
Two Code Composer Studio Workspaces for TX and RX
CCS can only run one instance of itself in a workspace.
If we want to run two debuggers at the same time, we 'll need two separate workspaces. Let's create one workspace for the RX projects and one for the TX ones.
Let's tell CCS it has to prompt for a workspace when starting up:
Window -> Preferences
Confirm your settings and close the dialog and also CCS. You can now start it again, and it will prompt for a workspace.
Create a workspace. I've placed mine in the same folder as the original workspace (your OS home folder) and called it workspace_v6_tx.
You can immediately load one of the TX examples.
Click on the Browse Examples button on the startup screen (if this doesn't show at startup, open it via View -> Getting started).
Load a TX example.
Once the example is loaded, navigate to targetConfigs -> CC1310F128.ccxml
Change Debug Probe Selection to: Select by serial number.
Enter the serial number of your TX launchPad (the one you wrote on the TX label in the previous step).
Press Save and press Test. Look at the TX and RX LaunchPad during the test.
Only the debug LED of the TX one should blink during the test cycle.
TX is done. You can now start a brand new CCS session and do the same exercise for the RX LaunchPad when CCS prompts for the workspace.
I called the workspace workspace_v6_rx.
I imported the corresponding RX project and changed its target configuration file to use the serial number written on the RX LaunchPad's label.
During the test, this time the debug LED of the RX LaunchPad should blink. The TX one shouldn't activate at all during this exercise.
All the hard work is done. We have two CCS sessions running, each with a project that talks to one specific LaunchPad.
Debug two LaunchPads at the Same Time
Yes, That's possible from now on.
We have the two sessions active. We just need to push the Debug button in each CCS session to load the firmware to the right controller and start stepping trough both sender and receiver.
All settings are persistent. Each time you start CCS, it will show a list of available workspaces, and you can select the one(s) you want to work with.
Side note 1: The fact that you have multiple workspaces doesn't mean that your source code has to reside on different locations on your computer.
The only requirement of CCS is that your project structure is in that workspace.
You can freely use Eclipse's Link Folder functionality to place your source files wherever you like.
This will come in handy when you are using version control systems, or if your RX and TX firmware share common files.
Side note 2: You can use the same target configuration files in UniFlash. The flash tool will take over all sessions of your debugger configuration.
This is handy if you want to program a whole stack of launchpads :<) and also if you just want to reprogram one.
Plug in the LaunchPad, open the target config file in UniFlash, press Program and rest assured that the code is flashed to the correct LaunchPad, not just a random LaunchPad.
Happy Debugging.
Top Comments