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-CC2640R2: [CC2640R2] How to merge BOARD examples with BLE-STACK examples?

Part Number: LAUNCHXL-CC2640R2

Tool/software: Code Composer Studio

Hello,

I have bought CC2640R2 LaunchPad and tried few example to develop the understanding of the controller. However, I have a question. Suppose, I want to implement the functionality of example 'pwmled' and 'simple_peripheral'. How can I do so? 

Do I need to implement 'pwmled' functionality in 'simple_peripheral.c' or is there another way of merging these two examples.

Also, does the same rule apply for merging any sample code example with 'ble_stack' examples?

Regards,
--Zain

  • Zain,

    There isn't explicit instructions on how to do this, but I do agree we should create a guide on how this would work. How familiar with RTOS's are you?

    At a highlevel, the best place to start is with the 'simple_peripheral' example. Here you can examine the example to have a stack and app project. In the app project, you would have a startup folder and an applications folder. In the startup folder you would have a 'main.c' file that has a function 'main()' that is used to create your tasks. These tasks are defined in other .c files that are located in the Application folder.

    Examine the 'simple_peripheral' project on how tasks are created and called. In the 'pwmled' example, you have this same concept. In 'main_tirtos.c' you have a function that creates/constructs your tasks, with a POSIX wrapper. These tasks are defined/written in other .c files that are located in the project. Simply take those .c files and the code from 'main_tirtos.c' and bring them into your 'simple_peripheral' project. There may be a few #includes you will need to bring as well, but this should at least get you started.

    Another great place to learn about the ecosystem is SimpleLink Academy. Go check it out here: dev.ti.com/.../

    Let me know if you have any questions. Hope this helps you at least get started in a general direction.