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.

CC2642R: Issues running tasks alongside threads and resource conflicts

Part Number: CC2642R
Other Parts Discussed in Thread: SYSCONFIG

Hi,


I'm trying to integrate BLE functionality into a TI-RTOS preexisting application. The preexisting application had about 2-3 detached POSIX threads that ran without joining. I added the application files from the simple_peripheral TI-RTOS project to the preexisting project. I then commented out the run of the other threads and only constructed the simple_peripheral task in the main file and I was able to correctly run the simple_peripheral task. However, when I run all threads and tasks at the same time the simple_peripheral task will run (I can tell it is doing so with console output) but the device will no longer be discoverable on any bluetooth scanner.

I'm assuming that there is some sort of resource conflict between the simple_peripheral task (or the ICall remote tasks created to interact with the ble stack) and the preexisting threads. I've been trying to diagnose which threads may be causing the issue with the ROV but am still unable to see what is going wrong.

I've also tried to run the threads concurrently using Semaphore_post and Semaphore_pend between the tasks and threads but the same problem persists.

In this circumstance how can I run tasks in conjunction with threads without having them conflict?

What tools are available in CCS to diagnose resource conflicts and how can I use them? 

Thanks in advance for the help!

  • Hi john,

    First, on CCS in debug mode you can use the ROV tool (9x9 yellow square icon tool below the Run menu in debug mode) to see what task are enable or disable during the code running.

    Concerning your issue have you thought about rising the number of maximum ICALL enabled tasks in your sysconfig file?  Go to BLE > Advanced Settings > ICALL and then entered both values corresponding to the number of tasks you want to add to your project.

    regards,

  • Hi Guillaume,

    I have been using the ROV to debug and can see which threads and tasks are blocked or running. My project is using an older version of the sdk (SDK v3), so it doesn't have sysconfig enabled and instead uses a .cfg file. In the .cfg file I can see a parameter for max task priority but can't find anything for max running ICALL tasks. Is there somewhere else I can look for that parameter?

    Thanks again for the help,

    John.

  • This is some of what I'm seeing in the ROV:

    Initially, I have 2 threads that run while the ble_thread is blocked on a semaphore, then the ble thread runs and the 'main thread' is blocked. The ROV capture below shows the ble_thread and related ICall threads running while the main_thread is blocked.

    Then after about a minute the ble thread unblocks the main_thread which continues its execution and blocks the ble_thread.

  • Hi John,

    For this one I suggest you to use a latest version of the SDK, a lot of bugs are fixed in new versions.

    Find a link to download it below :

    https://www.ti.com/tool/download/SIMPLELINK-CC13XX-CC26XX-SDK

    For your SDK maybe you can try to search for this entities :

    DICALL_MAX_NUM_ENTITIES

    DICALL_MAX_NUM_TASKS

    Rather than that, provide me the exact SDK version you're using for your project ?

  • How many tasks in total are you using on this project ?

    maximum number of ICALL can be definitely a solve for your issue.

    regards,

  • I was able to find the above entities initially they had the following values:

    DICALL_MAX_NUM_ENTITIES 6

    DICALL_MAX_NUM_TASKS 4

    I increased them like so:

    DICALL_MAX_NUM_ENTITIES 16

    DICALL_MAX_NUM_TASKS 16

    Despite increasing the number of tasks the same issues are persisting.

    My SDK version and dependencies are listed below:

  • In total I am running 1 task and 6 threads this excludes the remote tasks that are created when initializing ICALL

  • Hi John,

    Rise it to 16 is too  much for your project.

    Does the device advertise? If you have BLE traces it could help a lot, you can also verify the RF activity.

    You can do that by configuring GPIOs as mentioned in this debugging guide  :

    https://software-dl.ti.com/simplelink/esd/simplelink_cc13xx_cc26xx_sdk/6.40.00.13/exports/docs/ble5stack/ble_user_guide/html/ble-stack-5.x-guide/debugging-index.html#debugging-rf-output

    regards,

  • I changed both parameters from 16 to 8 and obtained the same result, the device should be advertising since it is running the simple peripheral code but I can't see it under under any of the ble scanners I use. The code is running on custom hardware with a cc2642 chip and I'm debugging it using a xds110 probe cc2642 launchpad. How can I collect the BLE traces and RF activity?

    thanks,

    John.

  • Hi John,

    My apologise for the delayed answer.

    Even if you are running your project on a custom board you can check the RF activity with the code provided in the previous URL sent. The activity will be on the GPIOs DIO6 and DIO7 (respectively pins 11 and 12 of the chip). Just follow the steps. If you have a logic analyser it will help to understand its activity.

    For the BLE traces you can use a Bluetooth sniffer if you have one.

    We need to know if your device advertise well, have you change some advertise configuration ? (address, directed advertise etc.)

    regards,