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.

Effort for porting CC2541 projects to CC2640?

Other Parts Discussed in Thread: CC2540, CC2640, CC2541, CODECOMPOSER

Hello Everyone


We are currently using the CC2540/41 in our projects and are excited to hear the announcement of the new CC2640.

It would be very convenient to reuse code (or even whole projects) written for the CC2541 for the CC2640 architecture.

Therefore: has anybody some experience in porting projects from the CC2541 (IAR embedded workbench for 8051) to the CodeComposer Studio (CC2641)? What is different? What is possible and what not? Of course, the HW is different and there must be any work for the re-writing of drivers, but what about the BT-profiles? Stack-Calls? General RTOS features?

I would really appreciate some advice or "experience report" if anybody tried this before.

Thank you very much in advance

Matthias

  • Hi Matthias,

    It depends a lot on your application so it is hard to give an answer to this. I would recommend downloading the new BLE software developers user guide (included with installer) to get a quick overview of the programming model.

    If you are able to provide your requirements for your project we might better be able to guide you.

    Projects

    All projects and profiles from the CC254X stack is ported to the new devices to provide a good starting point. They are available both for IAR and CCS.

    Drivers

    We have drivers available for most peripherals and will continue to add support for more going forward. There are two level of drivers; driverLib and TI RTOS drivers. driverLib does not contain any power management features and requires in many cases a more detailed knowledge of the HW architecture. The OS level drivers are very simple to use and just works out of the box (almost) without needing any HW knowledge.

    RTOS

    TI RTOS is required to use the BLE stack on CC26XX. A good overview of the modules available in the OS kernel and how to use them is found in the SYS/BIOS user guide: http://www.ti.com/lit/ug/spruex3o/spruex3o.pdf

    In addition there is documentation available for the 26XX-specific parts of implementation included with the TI RTOS SimpleLink installer which is bundled with the BLE stack.

    Since this is a multi-threaded system it is more complex to get things right in terms of synchronization but it greatly simplifies power management when using the provided drivers. 

    BLE

    The BLE stack is now built as its own project and image communication between application and stack goes through a calling layer named ICall. This ensures proper asynchronous handling of messages between the two and the API should still be mostly the same seen from the application.

    Regards,
    Svend

  • Hi Svend

    Thank you very much for your very detailed answer.
    I will download the installer and take a look; it is really good that all other CC254x examples are ported, so I'll get an idea what's different and what's new.

    My example code is a temperature sensor with a custom profile. The hardware uses I2C and SPI (which definitely must be written new). I'm just not sure about the custom profile; I had it coded very similar to the profiles already provided by the stack (simple_profile), and I wonder how much effort this will take. Also, the main application is pretty similar to the simplePeripheral application, also SW timers, events etc.
    Maybe you could provide a rough estimation how much effort it takes to port the main application and the profile.

    Thank you very much again for the answer and I will take a look into the new SW guide.

    Regards,
    Matthias
  • Matthias,

    The main change you will see is that the osal API is gone.

    Profiles should be easily ported, the same goes for I2C and SPI where we have good RTOS-level drivers which handles interrupts and power management for you.

    The application interface towards the stack is new as this uses a calling layer between the images which will take some getting used to. I would look into putting your sensors in a separate task and use message passing between this and your application task as needed.

    For events you could either roll your own or use the Event module in TI RTOS.

    Timers are a bit more tricky depending on the accuracy you need. TI RTOS uses the 32768Hz RTC as its timing base and if this is accurate enough for you you can use the Clock module to generate SW timers really easily (both periodic and one-shot). For more accurate timing you would need to use the HW GPTimers which we don't have very good driver support for right now.

    Direct link to the guide: http://www.ti.com/lit/ug/swru393/swru393.pdf

    Regards,

    Svend

  • Hi Svend ,

    I am struggling to create my own application for simplelink-ble-stack2.0 using code composer studio 6.1 , Is there any document which explains how to start with simplelink ble using ccs6.1