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/CC3220SF: Problem with Semaphores and Multiple Tasks

Part Number: CC3220SF

Tool/software: TI-RTOS

Hello TI,

I'm currently using CCS7.4, SL CC32xx SDK 2.40.2, XDCtools 3.51.1.18.

My application seems to have an issue with too many semaphores and/or tasks.

Task #0 ("mainThread"): Initializes all others task and then basically run an empty loop. ("task_sleep()" for RT)

Task #1 ("threadDsp"): Uses the SDK I2C Driver. Do some writings and readings from other peripherals, mainly a lot of variables from a 2 core DSC F28379D. ("task_sleep()" for RT)

Task #2 ("threadMB"): Uses the SDK UART Driver. Run a Modbus RTU Slave. (Keep waiting data from the UART)

Task #3 ("threadWeb"): Handle POST and GETS requests from the sl_Task. (Keep waiting for a message, "mq_receive()")

Task #4 ("sl_Task"): The sl_Task. (I do not control it)

Task #5 ("threadMemMan"): Manages an internal memory map. ("task_sleep()" for RT)

Task Idle: Empty by now. (Enabled by default)

So when the boards initiate, the Task #0 initiate all others tasks and all the others tasks run as desired. But halting the execution at the "threadDsp" and taking a look at ROV shows that I have a lot of semaphores:

Besides that there is already a high number of semaphores, when I open the local webserver and send some specific variables through POST method (I can handle mostly of the GET or POST methods without problems), the "threadDsp" stops working correctly and the "threadWeb" keeps waiting forever for a semaphore (it should wait just for the mailbox). Halting the execution at the same point again shows:

It is now possible to see that the application have a lot more of semaphores and that my HeapMem doesn't have any freesize available. I don't have a clue from where these semaphores are being created and how the previously 0xC8F0 freesize is now full.

I hope that someone can help me track this issue.

Thanks in advance,

Lucas Munaretto.

  • Hi Lucas,

    What in your code is creating all of those semaphores? I think that you should take a look at your code to see what is causing all of those semaphores to be created.

    As for the case where you bring up how POSTing data to the webserver causes the whole system to seemingly lock up, it looks like ThreadDSP is still running and is not blocked. What is it doing to consume all of your CPU cycles and heap memory? Looking at ThreadDSP for what might be causing it to use up all of your device's resources would be useful for debug.

    Regards,
    Michael
  • Hi Lucas,

    I assume that you have resolved your issue since I have not heard back from you. If not, feel free to post a response to this thread, or open a new thread regarding this issue.

    Regards,
    Michael