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.

CC2650: How to add new TI-RTOS based code files to handle GPIOs to a project that uses a BLE functionality like simple_broadcaster ?

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

This is a very basic question perhaps, but i just can't seem to wrap my head around using Code Composer Studio or Eclipse for that matter. All i can do is run existing examples.

What i want to do is very simple - Take an existing Bluetooth based example like "simple_broadcaster" and then add more code to it so that i can maybe blink some LEDs, use some I2C sensors, basically use GPIOs, UART etc. I realize that even in the BLE example the "Drivers" are there as i can see in the picture, but i don't know where exactly to write new code to use those drivers.

TO ELABORATE MORE : There are also some examples in the RTOS that only use GPIOs or "Non-Bluetooth" based functionality like PWM, UART etc. What i want to know is how do i add these two i.e lets say i start from "simple_broadcaster" then -

Q1) Where and how do i write code so that i can do something with GPIOs ? How do i make sure that it gets built without errors?

Q2) How will it be included during compiling? What things should i take care of ?

  • Hi Shantam,

    1) You can make a new TI_RTOS task or add code to the application task (found in simple_broadcaster.c)

    2) Please see chapter 6 of the Software Developer's Guide and chapter 6.1 Adding a Driver in particular ( http://www.ti.com/lit/swru393 )

    I will also recommend you to take a look at Simplelink Academy to get some knowledge of how the BLE-Stack projects are structured: software-dl.ti.com/.../overview.html
  • Hi Marie,
    The 6th chapter in Software Developer guide will be extremely helpful. Thankyou.

    However, using CCS has always felt like a very steep learning curve and i get discouraged every-time i open it because there is so much going on. Over time and because of the Simplelink Academy Training (only the RTOS part, haven't gone through BLE parts yet) i have gotten used to creating tasks and then starting them using BIOS_start(). However if you look into "simple_broadcaster" project's Application folder, there are 4 files, 2 headers and 2 source files -> simple_broadcaster.c and utils.c but there is no BIOS_start() code and i can't see a main function, this has left me perplexed. I dug a little deeper and found that main.c file is in Startup folder and contains the main function. However this hierarchy confuses me. But it also inspires me to write code in such a modular fashion. Lets say i want to have the exact same "simple_broadcaster" app but also blink an led with it. Do i have to add a blinkled.c and blinkled.h file ? Write the task there and somehow include it or call it in the main function in startup folder? Is this correct?

    Also, the project "pwmled" has an abstraction layer over the PIN driver, where instead of using PIN configurstion tables and handles and states etc you just do GPIO_write(IOID_9, Board_LED_OFF); . I need to work with this abstraction so that i can get my proof of concept up and running and work on optimization later on. Any ideas on how to get it done. I know its already implemented in that project but I don't want to start with a RTOS project and then add BLE to it as that would be beyond my capability right now. What i find easy would be to add GPIO based tasks to an existing BLE based project. Any tips here would be much appreciated.

    Thanks a lot for your help Marie.
  • Hi Shantam,

    I understand that you feel overwhelmed, that part of the reason why we made Simplelink Academy.

    If you want to make a new task for blinking the LED, you can indeed add a blinkled.c and blinkled.h file, write the task fxn and init there and call the task init function in main() before BIOS_START().

    Alternatively you can add code for blinking the LED in in the simple_broadcaster task.

    Feel free to either use the GPIO driver or the PIN driver.

    Please start with a ble stack project and add the driver functionality.