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.

RTOS/LAUNCHXL-CC2640R2: Bluetooth Low Energy Sensors BoosterPack Example (TMP007 Task 4 - Send Temperature Readings)

Part Number: LAUNCHXL-CC2640R2
Other Parts Discussed in Thread: SYSBIOS, CC2640R2F, CC2650

Tool/software: TI-RTOS

I have gone through the 'Bluetooth Low Energy Sensors BoosterPack' example and have made all of the specified changes.

The program compiles fine, and runs, but I am *not* getting any output to my BLE client nor to the UART-connected display. It seems that program execution never gets to the TMP007 task.

I have attached a screen-capture of the PuTTY output and the ROV output.

Regards,

Jim

Bluetooth Low Energy Sensors BoosterPack – Only Idle Loop is running

 

#000001 [ 0.011 ] INFO: (project_zero.c:401) Initializing the user task, hardware, BLE stack and services.

#000002 [ 0.013 ] INFO: (project_zero.c:480) Name in advertData array: Mouthguard 1

#000003 [ 0.016 ] INFO: (led_service.c:217) Registered service, 5 attributes

#000004 [ 0.016 ] INFO: (button_service.c:256) Registered service, 7 attributes

#000005 [ 0.016 ] INFO: (data_service.c:237) Registered service, 6 attributes

#000006 [ 0.016 ] INFO: (led_service.c:232) Registered callbacks to application. Struct @200007ec

#000007 [ 0.016 ] INFO: (button_service.c:273) Registered callbacks to application. Struct @200007f4

#000008 [ 0.016 ] INFO: (data_service.c:254) Registered callbacks to application. Struct @200007fc

#000009 [ 0.016 ] INFO: (led_service.c:267) SetParameter : LED0 len: 1

#000010 [ 0.016 ] INFO: (led_service.c:275) SetParameter : LED1 len: 1

#000011 [ 0.016 ] INFO: (button_service.c:314) SetParameter : BUTTON0 len: 1

#000012 [ 0.016 ] INFO: (button_service.c:345) Trying to send noti/ind: connHandle ffff, Noti/ind disabled

#000013 [ 0.016 ] INFO: (button_service.c:325) SetParameter : BUTTON1 len: 1

#000014 [ 0.016 ] INFO: (button_service.c:345) Trying to send noti/ind: connHandle ffff, Noti/ind disabled

#000015 [ 0.016 ] INFO: (data_service.c:292) SetParameter : String len: 40

#000016 [ 0.016 ] INFO: (data_service.c:303) SetParameter : Stream len: 20

#000017 [ 0.016 ] INFO: (data_service.c:323) Trying to send noti/ind: connHandle ffff, Noti/ind disabled

#000018 [ 0.020 ] INFO: (project_zero.c:1271) (CB) GAP State change: 1, Sending msg to app.

#000019 [ 0.021 ] INFO: (project_zero.c:1271) (CB) GAP State change: 2, Sending msg to app.

#000020 [ 0.022 ] INFO: (project_zero.c:780) GAP is started. Our address: 0x546C0E832DAA

#000021 [ 0.022 ] INFO: (project_zero.c:785) Advertising

#000022 [ 3.780 ] INFO: (project_zero.c:1271) (CB) GAP State change: 6, Sending msg to app.

#000023 [ 3.780 ] INFO: (project_zero.c:795) Connected. Peer address: 0x59FF26952A2D

#000024 [ 4.060 ] INFO: (project_zero.c:1091) HCI Command Complete Event received

#000025 [ 4.907 ] INFO: (project_zero.c:1091) HCI Command Complete Event received

 

TMP007BLE_NeedDiagnostic.pdf 

  • I suppose Object/IR is not available due to the TMP007 being EOL.
  • Good morning, YiKai,

    Again, just getting reacquainted with the CCS toolset - ('Object/IR' = Object Interrupt Request ???) If so, wouldn't that be embedded somewhere in the example ? Wouldn't I receive some sort of error if the program tried to call the routine if it didn't exist ?

    Without the full BLE functionality added I can: 1 - get temperature readings to the screen (using the 'empty' project, Tasks 1 - 2) so it is able to see the temperature sensor., 2 - see my service show up on my BLE scanner (Task 4). 

    This example is from SimpleLink Academy, so my thought would be that at some point it worked. What would I need to do to get back to that point ?

    I tried to paste in a copy of the ROV results. Every task is blocked except the 'ti.sysbios_knl_idl_Loop'. I put some 'LogInfo0's into the task. As far as I can tell the 'TMP007' task *never' starts as the only LogInfo which appears on the screen are those associated with the Project Zero code as shown in my original post. None of the TMP007 'LogInfo' information ever appears.

    Suggestions ?? I'm stuck. Actually, this isn't so much about getting this particular example going as it is about getting some sensor data transmitted via BLE. 

    Thanks,

    Jim

  • Hi James,

    Did you get the Sensors BoosterPack example program from Sensors and Actuator Plugin? The example program does not have bluetooth capability.

    Also the project zero does not have a Bluetooth Service for temperature sensor.

    -kel
  • Hi, Markel,

    Yes, you are correct. The first two Tasks of the example are just 'sanity checks', i.e., no BLE. Task 3 is to create a new Service. However, Task 4 of the example:

    dev.ti.com/.../ble_02_thermostat.html

    incorporates a modified version of the 'TMP007.c' program as a task which is called/started from 'Project_Zero' and *incorporates* the Project_Zero BLE stack. It really is a very nice template for adding BLE to a non-BLE program....if we can get it to work. I've been on this all day. One thing I notice in the 'appsnippets.c' is that there are two 'includes'  -

    #include <ti/sysbios/knl/Semaphore.h>
    #include <ti/sysbios/knl/Queue.h>

    with no mention of where to include them. I'm hoping they'll make all the difference. As you can see from the screen capture I sent earlier, everything is getting initialized, registered, .... but the program seems to be waiting for something; again, I'm hoping those two 'includes' will make a difference. Again, as far as I can tell, the program is never getting to the 'TMP007' task. Seems like I am THIS close.

    Have you tried this example ? (you'll probably need the SensorPack if you don't want to futz around with adding an external sensor). I've entered it twice just to double-check, and the results are the same. I'm surprised someone hasn't run into this before (or, maybe they have and they're not on E2E)

    Thanks, for your input.

    Jim

  • James,

    Just interjecting really quick, without seeing your code, I'm not sure if I can point you in a clear direction with regards to your exact issue, but I can provide some feedback on where it may be best to restart and move forward.

    First, grab a simple_peripheral project and the tmp007 project from the SAIL plugin.

    http://dev.ti.com/tirex/#/?link=Software%2FSimpleLink%20SDK%20Plugins%2FSimpleLink%20Sensor%20and%20Actuator%20Plugin%2FExamples%2FDevelopment%20Tools%2FCC2640R2%20LaunchPad%2FSAIL%2Fi2ctmp007

    From there, review how the i2ctmp007 example creates a posix thread and review simple_peripheral and how it creates threads in the Startup folder > main.c.

    Create a few new .c/.h files where you can put the tmp code into this file, and create a function like tmp_task_create(); in which you will call the POSIX thread create stuff etc and call this function from main.c

    Then, you will need to add posix to your project. To do this, you need to do a few things (we are working to improve this process).

    1) In simple_peripheral, under the TOOLS folder in the project, find app_ble.cfg. Change it according to this file:1401.app_ble.cfg

    2) Right click on project (simple_peripheral) > Properties > Build > ARM Compiler > Include Options and add this: ${COM_TI_SIMPLELINK_CC2640R2_SDK_INSTALL_DIR}/kernel/tirtos/packages/ti/sysbios/posix

    Then you will need to add the SAIL library and include references.

    1) Right click on project (simple_peripheral) > Properties > General > Products > Go down to Sensor and Actuator Plugin and select it

    2) Right click on project (simple_peripheral) > Properties > Build > ARM Linker > File Search Path > Add to "Include library file..."

    ${COM_TI_SAIL_INSTALL_DIR}/source/ti/sail/lib/ccs/cc26x0/sail.lib

    3) Under the same menu in "add <dir> etc.." add the following:

    ${COM_TI_SAIL_LIBRARY_PATH}

    Make sure that the threads that you do create, are not higher priority than the Icall task or else BLE will not run reliably.

    Then you need to modify the board files that you have (Board.h, CC2640R2_LAUNCHXL.c and CC2640R2_LAUNCHXL.h). Do a diff between the standard ones that come in your SDK and the ones available from the SAIL plugin. In simple_peripheral, exclude the board.c link from the startup folder. Copy the standard SDK Board.h CC2640R2_LAUNCHXL.c and CC2640R2_LAUNCHXL.h files and into the startup file so that you have a local version. This allows you to edit these files without editing the SDK source code for these files, which you would have done if you didn't exclude the board.c file from the Startup folder.

    When you copy all the new stuff from the SAIL board files into the new local version of your board files in simple_peripheral, you should be able to compile and run.

    Make the temp variable that is used as a return from measuring temp data global and then you can reference this in simple_peripheral. The easiest to start streaming data is by using the periodic event SBP_PERIODIC_EVT to run SimpleBLEPeripheral_performPeriodicTask() in which you can call something like this:

    uint8_t valueToCopy = (uint8_t)temp;
    
    SimpleProfile_SetParameter(SIMPLEPROFILE_CHAR4, sizeof(uint8_t),
                                 &valueToCopy);

    When you run this, Characteristic 4 expects notifications to be turned on. Use light blue app to connect to it, turn on notifications and boom, you should stream some temp data every now and then. 

    This was winded and i may have missed some small steps, but i think i got most of it and i hope it helps.

  • Hi Evan,

    Not sure I was quite clear in my last post - "....I am *not* getting any output to my BLE client nor to the UART-connected display....." Actually, I get *ALL* of the expected outputs in terms of the the connectivity, UUID's, .... to both the display and the Client (Samsung notepad). It's just that none of the *sensor* data gets through. If I was more proficient with the ROV tools I could maybe make a bit more headway on my own. The static veiw shows all of the tasks 'Blocked' except the idle task.

    My code looks/seems to be exactly that which results from going through the '....Add BLE...' section (paraphrased - not in front of my computer)

    I appreciate the time you put into your response and I will give your suggestions a try. Please accept the following comments in the vein in which they are intended - a frustrated user who was depending on the TI example to help get a problem solved. I went through 90% of the SimpleLink Academy exercises. They are truly a 'must-have/do' resource and I commend TI's effort. I went through these exercises hoping that by the time I got to one of the only practical examples of combining some actual hardware with a BLE template that I would have a fairly good chance of getting the example going and porting some of my code into the template. With that said, respectfully, it would be nice if TI would run the example and see *exactly* where it is broken (I could be 'all wet' and in actuality it works fine - however, I did enter it 3 times and obtained the exact same results, but who knows ? Maybe I made the same error all three times.) If it truly doesn't work, my feeling is it should be pulled from the 'Academy. It should only take *at most* an hour to make the various mods and it may only be a line, or, two that needs inserted/modified. Again, maybe I've made some error and the example works fine.

    Again, I'm truly appreciative of the information that you've sent and I'll give it a try.

    Regards,

    Jim

  • Jim,

    Thanks for the feedback. With regards to SimpleLink Academy, which one did you walk through that you'd like us to test? We update SimpeLink Academy (SLA) with every new SDK release for each device. That said, there hasn't been a new update to the CC2640R2F SDK in some time, but we are getting ready to do a new release and consequently a run through all the SLA's and ensure they work and add some new labs. What difficulties specifically do you have?
    I help develop SLA so I can make sure we get this incorporated into the feedback of stuff to review.

    Did you try using the periodic event like I said in my previous post?

    What were you referring to to the "...Add BLE.." section you mentioned.

    We are always looking to see how we can make our tools/documentation/code easier to use so any and all feedback is appreciated.
  • Good evening, Evan,

    Thanks for checking back in.

    I'm on a time-critical project. I've learned an incredible amount going through SLA, so again, for the most part it is absolutely invaluable, well written, and delivers the expected results. I went through all the Labs but focused primarily on the 'Bluetooth 4.2' stream. The particular lab that initiated my contact with you/the Forum was the 'Bluetooth Low Energy' + Sensors Booster Pack'. The first sections went smoothly enough, i.e., I could see the advertisements from the Project Zero part of the Lab. I could also get temperature output to Putty. The problem came with gluing the two together. Having followed the directions I was able to get the combined project to compile. Looking in PuTTY, I could see it advertising, reporting on services, .... it just *never* started/ran the Tmp007 task. Problem could have been just a making the interrupt priority higher, not sure. I tried to chase down the problem with ROV but didn't have the experience to get the real-time flow going.

    With regards to my current efforts and the information you sent, you did an unbelievable job. I spent a large part of Saturday night working on it. Everything is going according to expectations but I am having some trouble/getting a few errors adding/converting the TMP007.c to the project. 

    The first error is probably due to my C programming 'faults'. I'm having trouble with the function declaration and definition, i.e., what should be indirect, .... I am using

    //----- LOCAL FUNCTIONS

    void *tmp007TaskFxn(void *arg0); //Mimic original declaration of 12ctmp007 task 'mainThread'

    This was giving me an error with my task creation routine, in particular the parameter 'tmp007TaskFxn'.

    void Tmp007_createTask(void)
    {
    Task_Params taskParams;

    // Create the task for the state machine
    Task_Params_init(&taskParams);
    taskParams.stack = tmp007TaskStack;
    taskParams.stackSize = TMP007_TASKSTACKSIZE;
    taskParams.priority = TMP007_TASKPRIORITY;

    Task_construct(&tmp007Task, tmp007TaskFxn, &taskParams, NULL);
    }

    Then, the actual function definition:

    // void *mainThread(void *arg0)
    void *tmp007TaskFxn(void *arg0) //Mimic original definition
    {
    I2C_Handle i2cHandle;
    I2C_Params i2cParams;
    int retc;
    pthread_t alertTask;

    Compiler errors:

    Debug/configPkg/compiler.opt" "../Tmp007.c"
    "../Tmp007.c", line 133: warning #169-D: argument of type "void *(*)(void *)" is incompatible with parameter of type "ti_sysbios_knl_Task_FuncPtr"
    'Finished building: "../Tmp007.c"'

    where line 133 is -  Task_construct(&tmp007Task, tmp007TaskFxn, &taskParams, NULL);

    There is another error. I don't know if it will be cleared up when we take care of the declaration/definition  errors, but it seems like - as best I can guess by looking at the compiler output - that somewhere in the 'tirtos_builds_.....' function it is looking for the name of the original task, i.e., 'mainThread', i.e., 

    <Linking>

    undefined first referenced
    symbol in file
    --------- ----------------
    mainThread ./main_tirtos.obj

    error #10234-D: unresolved symbols remain
    error #10010: errors encountered during linking; "i2ctmp007_CC2640R2_LAUNCHXL_tirtos_ccs.out" not built

    >> Compilation failure
    makefile:158: recipe for target 'i2ctmp007_CC2640R2_LAUNCHXL_tirtos_ccs.out' failed
    makefile:151: recipe for target 'all' failed
    gmake[1]: *** [i2ctmp007_CC2640R2_LAUNCHXL_tirtos_ccs.out] Error 1
    gmake: *** [all] Error 2

    **** Build Finished ****

    In terms of SLA, currently it seems the emphasis of most of the examples is on seeing the board advertising. I feel that more of the labs which integrated BLE with some hardware/sensor would be a great/welcome addition.

    Thanks,

    J.

    P.S. Using the cc2640R2 LaunchPad

      

  • Evan,
    To clarify, 'TMP007' is what I named my task, *not* the TMP007 project from the 'TI Drivers' folder.
    Thanks,
    Jim
  • Good morning, Evan,

    Wanted to give you a summary of the latest....

     A) Couldn't get the original form of the i2ctmp007 task function declaration to work, i.e.,  'void *mainThread(void *arg0)' :

    "../i2ctmp007.c", line 113: warning #169-D: argument of type "void *(*)(void *)" is incompatible with parameter of type "ti_sysbios_knl_Task_FuncPtr"

    When I looked in the kernal API it gave,

     typedef Void (*Task_FuncPtr)(UArg,UArg);
     
     Task_Construct(Task_Struct *structP, Task_FuncPtr fxn, const Task_Params *params, Error_Block *eb );
    B) If I changed to the declaration format of 'static void mainThread(UArg a0, UArg a1)' for both the declaration and the definition, the program compiles, but of course the sets of arguments (and, results ?) are different.
    Is there a way to make the two different versions i.e., 'A' and 'B' equivalent, such that I get the results of 'A', but with the format of 'B' ??
    C) Even after I got the program to compile using form 'B', I still have the lingering error of :
     
    <Linking>

    undefined first referenced
    symbol in file
    --------- ----------------
    mainThread ./main_tirtos.obj

    error #10234-D: unresolved symbols remain
    error #10010: errors encountered during linking; "i2ctmp007_CC2640R2_LAUNCHXL_tirtos_ccs.out" not built

    Regards,

    Jim

    Task_construct(&sbpTask, SimpleBLEPeripheral_taskFxn, &taskParams, NULL);

    }

    Task function type definition: typedef Void (*Task_FuncPtr)(UArg,UArg);

  • Good evening,

    I re-entered all the suggested steps. 

    Here are the errors:

    >> Compilation failure

    Application/subdir_rules.mk:9: recipe for target 'Application/i2ctmp007RTOSTask.obj' failed
    "../Application/i2ctmp007RTOSTask.c", line 50: fatal error #1965: cannot open source file "ti/sail/tmp007/tmp007.h"
    1 catastrophic error detected in the compilation of "../Application/i2ctmp007RTOSTask.c".
    Compilation terminated.

    * I think this error is due to not having the *complete* path to the sail directory, I wasn't exactly sure with how to modify the build parameters/properties but the full path should have something like "C:\TI\sail_1_20_00_02__all\sail_1_20_00_02\source\ti\sail\tmp007*

    "../Application/simple_peripheral.c"

    "C:\XXXXXX\simple_peripheral_cc2640r2lp_app\Startup\CC2640R2_LAUNCHXL.h", line 70: warning #48-D: incompatible redefinition of macro "CC2640R2_LAUNCHXL"
    'Finished building: "../Application/simple_peripheral.c"'


    >> Compilation failure
    ICallBLE/subdir_rules.mk:9: recipe for target 'ICallBLE/ble_user_config.obj' failed
    "C:\XXXXXX\simple_peripheral_cc2640r2lp_app\Startup\CC2640R2_LAUNCHXL.h", line 70: warning #48-D: incompatible redefinition of macro "CC2640R2_LAUNCHXL"
    "C:/TI/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/icall/app/ble_user_config.c", line 448: fatal error #35: #error directive: "***BLE USER CONFIG BUILD ERROR*** Unknown CC2650 board type!"
    1 catastrophic error detected in the compilation of "C:/TI/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/icall/app/ble_user_config.c".
    Compilation terminated.

    * Somehow the original board/chip type is being wiped out. When I went into the file there are a bunch of applicable 'elseif's, but as the definition of the board/part type has disappeared the compiler doesn't know which one to select*. It may be due to the errors associated with 'redefinition of macro...."

    "C:\XXXXXX\simple_peripheral_cc2640r2lp_app\Startup\CC2640R2_LAUNCHXL.h", line 70: warning #48-D: incompatible redefinition of macro "CC2640R2_LAUNCHXL"

    'Finished building: "C:/TI/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/profiles/dev_info/cc26xx/devinfoservice.c"'


    "C:\Mouthguard_TI_SAIL\simple_peripheral_cc2640r2lp_app\Startup\CC2640R2_LAUNCHXL.h", line 70: warning #48-D: incompatible redefinition of macro "CC2640R2_LAUNCHXL"
    "../Startup/main.c", line 217: warning #225-D: function "mainThread_createTask" declared implicitly
    'Finished building: "../Startup/main.c"'

    * I think this is due to some of the prior errors*

    Suggestions ??

    Thanks,

    Jim

  • Jim,

    Thanks so much for the patience. This week has been very full for me and I'm doing my absolute best to stay on top and attentive to your problem. My apologies for the delay in getting back to you.

    James Whitney said:

    Application/subdir_rules.mk:9: recipe for target 'Application/i2ctmp007RTOSTask.obj' failed
    "../Application/i2ctmp007RTOSTask.c", line 50: fatal error #1965: cannot open source file "ti/sail/tmp007/tmp007.h"
    1 catastrophic error detected in the compilation of "../Application/i2ctmp007RTOSTask.c".
    Compilation terminated.

    * I think this error is due to not having the *complete* path to the sail directory, I wasn't exactly sure with how to modify the build parameters/properties but the full path should have something like "C:\TI\sail_1_20_00_02__all\sail_1_20_00_02\source\ti\sail\tmp007*

    Can you right click project, go to properties > Include Options and look for this: ${COM_TI_SAIL_INCLUDE_PATH}

    Then, in the same window, go to General > Products > Products and Repositories can you confirm that you can see the SimpleLink Sensor and Actuator Plugin and that you have 1.20.x.xx selected for your project. 

    Also confrim that in Build > Arm Linker > File Search Path > that you have these two libraiers under Include Library File or cmd file as input

    ${COM_TI_SAIL_LIBRARIES}
    ${COM_TI_SAIL_INSTALL_DIR}/source/ti/sail/lib/ccs/cc26x0/sail.lib

    and under Add <dir> to library search path that you have this:

    ${COM_TI_SAIL_LIBRARY_PATH}

    Apply and close. 

    It may be also good to go to Window > Preferences >Code Composer Studio > Products and check to see that CCS sees SAIL (sensors and actuators plugin) as well. If not, click Rediscover.

     

    James Whitney said:

    "../Application/simple_peripheral.c"

    "C:\XXXXXX\simple_peripheral_cc2640r2lp_app\Startup\CC2640R2_LAUNCHXL.h", line 70: warning #48-D: incompatible redefinition of macro "CC2640R2_LAUNCHXL"
    'Finished building: "../Application/simple_peripheral.c"'


    >> Compilation failure
    ICallBLE/subdir_rules.mk:9: recipe for target 'ICallBLE/ble_user_config.obj' failed
    "C:\XXXXXX\simple_peripheral_cc2640r2lp_app\Startup\CC2640R2_LAUNCHXL.h", line 70: warning #48-D: incompatible redefinition of macro "CC2640R2_LAUNCHXL"
    "C:/TI/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/icall/app/ble_user_config.c", line 448: fatal error #35: #error directive: "***BLE USER CONFIG BUILD ERROR*** Unknown CC2650 board type!"
    1 catastrophic error detected in the compilation of "C:/TI/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/icall/app/ble_user_config.c".
    Compilation terminated.

     

    Did you exclude board.c in your startup folder? If you haven't and you've created your own board files, it's will try to redefine everything. 

    Reference this on creating your own board file, some concepts can be taken from it. http://software-dl.ti.com/lprf/simplelink_cc2640r2_latest/docs/blestack/ble_user_guide/html/ble-stack-3.x/custom-hardware.html#creating-a-custom-board-file

  • Hi Evan,

    * I had done *all* of the 'Properties' suggestions from the initial checklist that you sent. I did recheck these just to be sure - all is as suggested.

    * I also had excluded 'board.c' from the build.

    As additional information:

    - I put the 'new' Task in the Simple Peripheral  (SP) 'Application' folder (is this the correct location ?). The task was just a modification of the original i2ctmp007 file with the modifications to turn it into a Task - i.e., the original file is *now gone* from the i2c.....tirtos_ccs folder and the modified file 'i2ctmp007Task.c' placed in the SP folder.

    - Currently I have the 'board.h' file placed in the 'Startup' folder as suggested, HOWEVER, 'main_tirtos.c' is looking for a copy of 'board.h'. Unless I'm reading the path graph wrong 'main_tirtos.c' will not be able to reach 'board.h' in its current location (I'm also receiving a compile error). Should I move a *copy* of 'board.h' to the i.e., 'targetConfigs' folder in the i2c.....tirtos_ccs project folder ?

    I don't know how much support you have on this issue, but would it be possible to take a dual-pronged approach ? I.e., the version of the code that I have generated for Task 4/Sensors Booster Pack advertises, Connects, sends information on all of its services, gets the address of the client, ....It just doesn't seem to start/go to the temperature task. I think the approach you've presented is much cleaner, but at this point I just need to get something running.

    Regards,

    Jim

  • Hi James,

         I have another approach to the problem. Follow the instruction as is. If there is any problem let me know. This does not use another task to read the temperature. But, upon BLE connection periodically reads the tmp007 every 5 seconds and then update the parameter at MyTemp service.

         Requirement Steps:   

    1. Make sure you have CCSv8 installed.
    2. Make sure you have CC2640R2F SDK v1.50 installed.
    3. Make sure you TI BLE Device Monitor 2.9.0 installed and have another CC2640R2F LP with host test hex file programmed. This is because there is an issue with IOS BLE Apps seeing ble services. I do not know if the same issue occurs with Android BLE Apps. If there is no issue at Android BLE Apps then use it instead of TI BLE Device Monitor.
    4. Create a new CCS Workspace and name it CC2640R2Fv150_Launchpad. This is just so only the CCS project you need are there.
    5. Import CCS project Simple Peripheral Stack Library from SDK v1.50. Build and Test using BLE App.
    6. Import CCS project i2ctmp007 located at "C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\examples\rtos\CC2640R2_LAUNCHXL\drivers". Build and Test. You should be able to see temperature values at serial console. This is just to make sure that the tmp007 at BOOSTXL-SENSORS works.

         Code Composer Studio Steps:

    6724.Application.rar


    PROFILES.rar

    1. Unzip attached files Application.rar and Profiles.rar.
    2. Overwrite simple_peripheral.c and simple_peripheral.h from the files at Application folder
    3. At simple peripheral profiles folder add files led_service.c, led_service.h, MyTemp.c, MyTemp.h.
    4. Rebuild All
    5. Flash the hex file use LM Flash Programmer 2. The hex file is located at "C:\ti\ccsv8workspace\CC2640R2Fv150_Launchpad\simple_peripheral_cc2640r2lp_app\FlashROM_StackLibrary"

            BLE Device Monitor Steps:

    1. Make sure your 2nd CC2640R2F Launchpad has host test hex file programmed.
    2. Connect your 2nd CC2640R2F Launchpad to your PC.
    3. Open BLE Device Monitor.
    4. Connect your first CC2640R2F Launchpad with simple peripheral hex file programmed.
    5. Click Scan and you will SimpleBBBPeripheral at the BLE Network Window. Double Click SimpleBBBPeripheral.
    6. Open IR Temperature service.
    7. Double Click IR Temperature Data below and you will see the read Temperature in reverse hexadecimal format.
    8. The value shown in reverse is 0x42090C00. Which when converted to decimal is about 34 Celsius +. Just check in the internet how to convert that.

    -kel

  • Hi Kel,

    I *very much* appreciate your effort. However, for the time being I'm a bit  hesitant to pull off of the current approach, as sooner-than-later I'm going to need to add several other Tasks. I still feel that the current approach and code is very, very, close and has a (small ?) snag for which I can get to the bottom (I appreciate all of the help from you, Evan, and others on the forum). I spent a lot of the day looking once more through my implementation of the 'Task 4'  code, plus setting breakpoints and looking through ROV. Hopefully, I'll be able to get two images attached (never seems to work for me) .

    The two images are from ROV. What I noticed is that *all* of the routines have either a 'BIOS_WAIT_FOREVER' (the tmp007 routine - for now I've commented that out but haven't had a chance to try it. Doesn't seem like it should really be necessary), or, an endless loop - for (;;) - with a '

    events = Event_pend(syncEvent, Event_Id_NONE, GAPROLE_ALL_EVENTS, ICALL_TIMEOUT_FOREVER) (gapRole_taskFxn), or,  for (;;) events = Event_pend(syncEvent, Event_Id_NONE, PRZ_ALL_EVENTS,

    ICALL_TIMEOUT_FOREVER); (ProjectZero_taskFxn). In both cases the functions are waiting for an event, but the general nature of 'ICALL_TIMEOUT_FOREVER' and I'm wondering if that's why all of the 'Events' are showing as 'Blocked'/'Waiting forever', as once any of those routines are called, they 'Init' their respective functions, then are waiting in the infinite loop.

    Another thing I'm wondering about is why the tmp007TaskFxn shows up in the ROV 'Event' list, but not in the 'Task' list ?

    Is there a technically sound fix (Hoping !!) ?

    Thanks,

    Jim

  • Hi James, 

         There is no IOS BLE Apps issue seeing ble service. I just needed to refresh my bluetooth cach by rebooting my smartphone

         The step by step procedure I gave you uses SDK v1.50. The project zero from simplelink academy 1.12 uses SDK v1.00, which is the very first CC2640R2F SDK release. There are lots of changes and fixes from SDK v1.00 to SDK v1.50.

         Anyway, using the simplelink academy 1.12 ble thermostat module guide I was able to make it work with just minor modifications to Board.h. Here below is a screenshot of myTemp service UUID 0xAA00. This is raw temperature data in hexadecimal format.

    I assume you made the Project Zero work first. But, just to be sure here are the steps I did to make project zero work at CCSv8.

    1. CCSv8 installed installed at c:ti.
    2. CC2640R2F SDKv1.00 installed at c:ti.
    3. XDC Tools 3.32.1.22 installed at c:ti.
    4. Project Zero extracted at c:\ti.
    5. Copy "cc2640r2_project_zero" folder from "C:\ti\ble_examples-master\ble_examples-ble_examples-3.0\ble_examples-ble_examples-3.0\examples\rtos\CC2640R2_LAUNCHXL\blestack\" to "C:\ti\simplelink_cc2640r2_sdk_1_00_00_22\examples\rtos\CC2640R2_LAUNCHXL\blestack" folder.
    6. Import project zero app and stack project to CCS.
    7. At stack CCS project properties->General->Products. Make sure SDKv1.00 is selected. Make sure XDC Tools 3.32.1.22 is selected.
    8. At app CCS project properties->General->Products. Make sure SDKv1.00 is selected. Make sure XDC Tools 3.32.1.22 is selected.
    9. Enable hex generation utility for both stack and app ccs projects.

    After the above steps follow the simplelink academy 1.12 ble thermostat module guide. Here are the modifications at Board.h

    #define Board_TMP_ADDR          (0x40)
    #define Board_SENSORS_BP_TMP_ADDR Board_TMP_ADDR

    Rebuild All both Stack and App Project. Using LM Flash Programmer 2 select stack hex file then app hex file. Then flash the hex files. Let me know if you encounter any problems.

    Also you can download the latest simplelink academy 1.14 which has project zero that works for SDK v1.50. I have not tested that yet.

    -kel

  • Hi Kel,

    Thanks for your tenacity.

    Everything that you mentioned, I had already done - long ago - , i.e., Project Zero, *All* (well, about 90 %) of all the SimpleLink Academy exercises, .... I never had a problem getting the BLE connection to my Android Galaxy. I also never had a problem getting the TMP007 example to go. As you know, from all the discourse, the disconnect was getting the two to play together. I also have an accelerometer project (the actual intended target, eventually) going that is working well so far, ....without the BLE.

    I, too, after many long hours was able to get this going a few days ago - sorry for the delay in notifying you, Evan, and anybody else who was/is taking the time to help. After I put in a bunch of debug statements and indeed seeing the button handlers working, I put in some debug statements and saw that 'temperature' was being sent to the broadcast routine. When I looked at, and did a R(ead) on Custom Characteristic 'AA01' I was able to see the temperature.

    Again, thanks for the help, and Best Regards,

    Jim