This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/LAUNCHXL-CC2650: No BLE_SDK sample projects work with this board

Part Number: LAUNCHXL-CC2650
Other Parts Discussed in Thread: CC2650, CC2640, BLE-STACK

Tool/software: Code Composer Studio

I have been unsuccessful getting any BLE sample apps to run on the Launchpad CC2650 board. (we cannot use the 2nd gen part) The pre-loaded code seems to work but of course there is no source reference for that. I suspect it is an old binary that might not even build correctly today with the latest tool versions.

I am beginning to suspect backwards-compatibility tool/library issues since you consider the CC2640/50 legacy products.

I have tried the simple_peripheral_cc2650lp_app, simple_peripheral_cc2650lp_app, simple_peripheral_cc2650lp_stack, sensortag_cc2650lp_app, and sensortag_cc2650lp_stack. Nothing works.


Focusing on simple_peripheral_cc2650lp_stack:

Compiler: TI v5.2.6
RTOS: Tried 2.21.0.06 and 2.20.1.08
XDCTools: 3.32.2.25_core (also tried 3.32.1.22 and 3.32.0.06)
BLE_SDK: 2_2_1_18


2) There is no linker file associated with this project when loaded:

A) Searching the project, there is no main() to be found and the debugger starts at startup_entry(). The arg values passed to it are invalid which is probably the reason for:

* The code does not return from CommonROM_Init(), probably because we are missing setup info

* If I skip that call, the code seems to progress - but the call to stack_main(arg1) is clearly invalid since arg1 is bad.

B) The BLE code looks like it needs missing definitions. I added HOST_CONFIG=1 and PERIPHERAL_CFG=1, just because it looked like they should be there, but I am not sure. What is the deal here?

C) If I add the appropriate linker file I get a "missing ResetISR() error" which occurs because the link script calls that out as a starting point. Without a main() this cannot work because we still don't have the parameters to pass to startup_entry().


3) Can you verify that the packages still work with this board?

All I need is to get one successful build that makes the Launchpad work. If you can, A list of EXACTLY what versions of the various libraries and packages that are used would probably solve the issue.

I have scanned your guides until I am dizzy and I have found no path to victory. Guides that are for the CC2650 refer to the 2nd gen part etc.

4) What is the difference between the BLE _app and _stack sample applications?

simple_peripheral project files:

2475.simple_peripheral.zip

  • Hi Mark,

    The CC26x0 and LaunchPad are still completely supported, these parts and kits are supported by the BLE-Stack 2.2.x SDK, it can be downloaded from here:
    http://www.ti.com/ble-stack

    For the list of supported tools/ please see: www.ti.com/.../release_notes_BLE_Stack_2_2_1.html
    These are: tirtos_cc13xx_cc26xx_2_20_01_08
    CCS: 6.2.0 (build 50) or later, including TI ARM Compiler 5.2.6
    IAR: 7.70.2

    The installer will install the proper version of TI-RTOS into C:\ti and the stack into C:\ti\simplelink\

    From there it is recommended to begin evaluating using the sample applications provided by the SDK, for CC2650 LaunchPad these are found in the examples/cc2650lp folder.

    In terms of using/flashing the applications, I would refer to www.ti.com/.../swru393, Chapter 2.

    Please note that the stack project is a separate executable and must be build and flashed before the application project. Once they are built and flashed the application should work as intended.
  • FOLLOWED INSTRUCTIONS AND STILL NO EVIDENCE OF BLE ACTIVITY


    I reinstalled ble_sdk_2_02_01_18 and created a new workspace to start clean. I imported the simple_peripheral_cc2650lp_stack and simple_peripheral_cc2650lp_app projects into the new workspace.

    both projects had build issues with xdctools:

    Error: Can't load C:\ti\xdctools_3_32_00_06_core\packages\xdc\utils.js

    So I changed the xdctools version to xdctools_3_32_01_22 to get a clean builds.

    Other than this I followed the instructions in section 2.6.3.3.3. of SWRU393D to the letter.

    1) stack: Run->debug (do not start execution)
    2) app: Run->debug (I did run here as something has to get things going, right?)

    Things seem to be running but I do not see the device in the Android Simplelink Starter app (It did work when running the board with the preprogrammed out-of-the-box executable).

    I exited the debugger and cycled power on the board letting it run on it's own and still no BLE device appears on the app.

    I also tried pressing the side buttons on the board in case they needed that as a trigger.

    Compiler: TI v5.2.6
    RTOS: 2.20.01.08 
    XDCTools: 3.32.1.22
    BLE_SDK: 2_2_1_18

    1) Am I using the correct app (Android Simplelink Starter)?  Should I be using something else to communicate with the board?

    2) The stack code looks like it needs missing definitions. (HOST_CONFIG, PERIPHERAL_CFG, etc.).  Without these it looks like critical (to my BLE beginner eye) code is omitted.

  • Hi Mark,

    1) It sounds like you have an environment issue if you are not experiencing clean builds, can you clean out everything in your C:\ti directory and reinstall and try to build again, you should be able to build the example project without errors or warnings.

    2) Looks like you are loading the project correctly based on your description, when you load the application (after having loaded the stack) if you press pause on the debugger what is the state? Has the device encountered an exception?

    3) The examples will use UART display to print information about their state, if you open a putty terminal to the user/UART COM port from the lauchpad, do you see output?

    4) I would recommend BLE scanner or lightblue on android.

    5) The stack code is conditionally defined based on which features are compiled in, these are controlled via the build_config.opt and a tool called lib_search, this is explained in the software developer's guide, but is beyond the scope of getting a project to build and run out of the box.
  • I was able to verify that SimpleBLEPeripheral_taskFxn() is getting called periodically so the RTOS part looks like it is running OK (I had to disable optimizations in the app to get the breakpoints in source established). Should I start stepping down into the BLE stack? I don't really know what to look for there.....

    So far I don't see anything in putty - I tried 115200, 57600, 19200 and 9600 (8N1, no flow-ctl) on the "XDS Class Application/User UART" which appears on COM11. Should I add a "wakeup" message at startup here? I don't know the format for that.

    Environment issue - I had this xdctools issue from the start which is how I knew how to correct it. Do you really think xdctools version could be causing a problem? It seems unlikely (Ids like to avoid having to start all over with the installs but if I must I will). Also the error wasn't about an environment setting, the .js file was missing from the xdctools directory.
  • Also, I was already using BLE Scanner as a 2nd check and added lightblue per your advice. Still nothing shows the Launchpad board.
  • I stepped into GAP_DeviceInit() and it looks like it executes without error and GAPRole_StartDevice() returns "SUCCESS".

    I stepped thru GAPBondMgr_Register(), GAP_RegisterForMsgs(), GATT_RegisterForMsgs(), and hciSendCmd() to make sure buffers are getting allocated OK.

    I stepped thru hciSendCmd() to make sure that ICall_dispatcher() was returning "SUCCESS".

    So to sum up it looks like SimpleBLEPeripheral_init() thinks everything went OK. Shouldn't the radio be discoverable at this point?

    * I have to think that I am missing something very elementary here. Something so simple that you would not even think to mention it. Something like not having BT turned on on my phone (it is). Keep in mind that this is my first time stumbling around BT and I could be missing something very elementary (like not knowing that the _stack project must be loaded separately before loading the _app project).
  • After my last post where I was single stepping I hit the run button on the debugger when finished and BOOM there it is! Why????

    I did not make any changes to the code. I powered down the device and repowered and its still there. I think maybe the issue was on my phone with the competing BT apps I had running BLE Scanner still did not see the device but the Launchpad App and light blue did se it. Launchpad could only connect after closing lightblue.

    Still no UART output though - I am in a virtual Windows machine and maybe that is part of the problem although if it shows up in device manager and the debugger works through USB I would not expect this to be the case. Any Ideas on the UART? Debug info on that channel would be helpful. COM11 seems out there. There is also a COM12 Auxiliary data port, any idea about that?.
  • Oh yeah - I have to port this over to my target board which has a 2640 on it, small package (10 GPIOs). Should I change anything (other than the GPIO table, or just not enable GPIO) to start?
  • Just to be clear, is the UART output redirected through the USB connection or do I need to wire it from the board?
  • Hi Mark,

    The stack will be unable to schedule radio events while single stepping, so it will not advertise.
    As you mentioned, it seemed like you had an issue with the setup on your phone as it is now working as expected.

    Regarding the UART display you want to use the User/UART COM port on your PC with settings 115200 8N1. The XDS110 will handle routing the UART to USB if you are using the standard configuration.

    Looking at the simple_peripheral build from 2.2.1 it looks like the display is turned off by default. My apologies.
    You can enable it by changing the Display_open() call to use Display_Type_UART instead of LCD and removing the following defines from your project: Display_DISABLE_ALL and BOARD_DISPLAY_EXCLUDE_UART.

    In any case, if you are able to scan and connect, then the device is working as expected.
  • Thanks for the help. I am at least at a starting point now.

    I do have a few more questions, if you dont mind:

    1) The application transmits a beacon, I can see it on my phone. However I cannot seem to connect and discover services. Any ideas on what to look at for that? Is there a specific place I should look for the connection handshake packets coming in? It seems like whatever background process that would handle the pairing/negotiation is not executing.

    2) All I will need this thing to do is connect to a phone and act as a text wedge between a phone and it's serial port. In other words the an IOS/android phone will send text data in a payload and the 2640 will echo the payload out of it's UART (also Rx from the UART and transmit BLE to the phone). I am guessing a GATT string characteristic would be the mechanism for this but I am not sure. Is there an example that would show me how to implement this.

    3) We have devices in the field with no code in them, and we plan to program them through the UART. Will these devices require separate programming sequences for the stack and app, or should their hex files be combined with a utility and programmed as one file?

    Thanks,
    Mark
  • Hi Mark,

    1). I would first look for the GAPROLE_CONNECTED event in your application. This indicates that you have successfully established a link. To simplify your debugging I would disable pairing and bonding for now and see if you can connect, after that is confirmed, I would re-enable and see the behavior. The software developers' guide section 5.4 has a nice summary of the various pariging states, their events, and what is going over the air. www.ti.com/.../swru393

    2) I would refer to the SPP over BLE example this is peroforming emulated UART over BLE. See here: github.com/.../ble_examples-2.2

    3) I would first combine your app and stack files into a single hex image, see section 2.7 of the software develpper's guide for some tips on how to do this.
  • Hi Sean,

    I can see the board's beacon but it will not connect. Not sure why.

    The UART to BLE Bridge (SPP over BLE) project looks exactly like what I need but I don't see it in ble_sdk_2_02_01_18. Is it in there or so I need to go back to a later SDK?

    Mark
  • Hi Mark,

    I sent some steps for debugging why the device is not connecting. Can you determine if any of the mentioned events are being received by your application?

    SPP over BLE is provided on our github page that I linked to, you can download it from there.
  • Hi Sean,

    Oh crap I don't know git, just SVN. Any advice for a git newbie? I can't screw anything up there can I?

    I am restarting with a fresh install of everything. Maybe the connections problem will magically disappear. I will look for the connection event.

    Mark
  • Mark,

    You can download the package as a zip file, please refer to the readme/faq page on the Github.

  • Hi Sean,

    I started with a clean CCS install, BLE SDK, RTOS.  I built the simple_peripheral example for the Launchpad again ant it ran fine.

    I took the EXACT same code and loaded into out OEM 2640 board and it advertised but did not connect.  What to do?  I tried on two boards so there is no reason to suspect HW; and since it is an OEM I am pretty sure it works.  

    I did have to change the CPU settings so that the debugger would connect.  I made sure no linker file was selected.

    Also I have yet to see any UART data output (I did remove the predefine).

    At this point I am skeptical that this project actually works on this CPU.  I know the radios are different, Are you SURE there isn't something different special that has to be done for the 2640?

    I feel like I am missing the secret sauce here.

    Mark

  • HI Mark,

    Following up here. I believe we have resolved the issue in other threads, but are you sure that you have rebuilt the stack and then app and flashed both the stack and app to the board?

    By the way, there should be no changes to the device or CPU settings in order for the board to work. These projects are intended to work out of the box. The CC2640 and CC2650 are identical for the purposes of these projects.