element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • Experts & Guidance
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • Product Groups
  • Store
    Store
    • Visit Your Store
    • 'Choose another store...'
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
Personal Blogs
  • Members
  • More
Personal Blogs
Legacy Personal Blogs TI SensorTag CC2650 - Firmware Debug while Connected to Smartphone App
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Blog Post Actions
  • Subscribe by email
  • More
  • Cancel
  • Share
  • Subscribe by email
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Jan Cumps
  • Date Created: 1 Jun 2016 7:40 PM Date Created
  • Views 728 views
  • Likes 11 likes
  • Comments 2 comments
  • android
  • bluetooth
  • ble
  • ccs
  • c2650
  • app
  • debugging
  • arm
  • feature_tutorial
  • simplelink_sensortag
Related
Recommended

TI SensorTag CC2650 - Firmware Debug while Connected to Smartphone App

Jan Cumps
Jan Cumps
1 Jun 2016

There are many opinions on the good and bad of debugging. I use it constantly. My development is a constant round-trip between editor and debugger. I like to step through code in a debugger to grasp what's happening in firmware.

 

This blog explains how I set up my tool chain to debug the SensorTag Out-of-box firmware while the device is in a Bluetooth conversation.

 

        
You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

 

The SimpleLink SensorTag is a tiny evaluation kit with an ARM Cortex controller with embedded BLE, and a number of sensors.

Out of the box, it runs an application that collects environmental data and send the measurements over Bluetooth Low Energy.

In my exercise, the receiving part is an Android smartphone with an App that shows the data.

 

You need a hardware debugger to do this exercise. I use the SimpleLink Debug DevPack - made specific for the SensorTag.

 

imageimage

image obviously adapted from TI product page I never succeed in making such flashy images myself

 

The Breakpoint

 

Both the Android App and the SensorTag firmware have many source files, in multiple folders, with loads of code.

Finding a good breakpoint isn't just a straightforward exercise (believe me, I've read umphteen source files and tried many breakpoints before I found a good one)

But once we have a good breakpoint, a world opens. We can trace back in the stack to see how we got at this point in code, and we can step through to learn what's next.

 

The breakpoint I've chosen is in the code of the IR Sensor - the part that glues the sensor driver to the BLE stack.

There are many other good candidates (each sensor has a similar setup).

But I settled for this one because

  • it's a good one for digging in the stack and
  • you can see that the app is halted while you are halting the firmware in the debugger - a good visual cue.

 

We'll see in the next section how to get at the project, but here's the give-away if you have that already working:

You'll find the breakpoint in the sensor_WriteAttrCB() function in source file PROFILES/irtempservice.c of the project SensorTag.

 

image

Where to Get the Firmware?

 

trick:

 

You can use the TI Cloud tools to do this exercise. You only need the SensorTag, the debugger and a computer with browser and one USB port. You don't need an IDE.

Navigate to the Resource Explorer, then import these two SensorTags in CCS cloud:

- SensorTag

- SensorTagStack

 

image

 

Build and Debug SensorTagStack project (this step is needed to get the stack uploaded to the Tag)

Change the properties of the SensorTag project to set the optimize level to 0,

 

To do that, follow the instructions of this help request I raised at e2e: asked the question on the TI E2E forum.

 

Build and Debug it and put the breakpoint as described above.

 

Kick off the debugger

Take your phone and connect to the tag.

Watch the debugger stop. Have Fun!

 

image

 

If you want to run this exercise from a CCS installation on your computer:

 

On the SensorTag's product page, there's a link to a software download that contains the BLE stack, Documentation and Sample applications.

Check under the Software section, and click on Bluetooth Low Energy Software Stack.

You will have to give your personal info and why you'll use this software - the same as for CCS.

I have kept all settings default when installing. Just take care that you know where you've installed it, because our firmware projects are in that folder.

 

I didn't do a full check on dependencies, because I've been working with this tag for a while.

Here is a relevant plug-in that I have installed in CCS (check via View -> CCS App Center).

I can't remember if I selected it via App Center or that it came via the Bluetooth Low Energy Software Stack.

image

 

 

 

Load and Fine-Tune the Projects

 

The projects can b found in the install folder of the SensorTag software pack.

On my PC, it's at C:\ti\simplelink\ble_cc26xx_2_00_00_42893\Projects\ble\SensorTag\CC26xx\CCS.

The simplest way to import both the SensorTag and SensorTag projects is via the Resource Explorer (Veiw -> Resource Explorer)

 

image

 

The wizard will help you trough all the steps.

  • Import both.
  • Check if the debugger is set to XDS110 for both projects,

 

 

image

 

  • For the SensorTag project, set optimize level to 0 after importing.

image

 

  • Build both
  • First debug SensorTagStack. This will get the stack loaded on your tag.
  • Stop the debugger.
  • Then debug SensorTag. Set the breakpoint as indicated in the beginning of the blog.
  • Kick off the debugger?
  • Start your SmartApp. Connect to the tag.
  • The app will detect the services on your tag. Then your program will halt.
  • The display of the app will not show data before you continue the program in the debugger.

 

Happy Debugging. The video at the beginning of the blog shows what to expect.

  • Sign in to reply
  • Jan Cumps
    Jan Cumps over 5 years ago

    fixed the video link

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps over 7 years ago

    Now that my help request at e2e.ti is resolved, I've added a screenprint of the Cloud IDE.
    question on the TI E2E forum

     

    image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2023 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube