MPSL thread being blocked due to application threads

Hi,

With reference to the below image:

As you can see I have 2 UART threads running on priorities 14, at baud 115200, which are I believe blocking the MPSL signal thread, due to which my BLE Mesh models are responding to OPCODES with a delay of 9 mins & at time getting stuck without progressing. Further I also observed BT APIs reaching maximum retries.

I need your help with 2 things:

1. How can I get this to work whilst retaining my application & UART threads..?

2. How can I probe the CPU utilization further to find out what is happening or what is the issue leading to MPSL thread being blocked..?

Thanks,

Ubaid

Parents Reply
  • Hi,

    I did that and it is running and printing stats only once,
    Please look at my prj.conf if everything is in order:

    #Analyse threads
    CONFIG_THREAD_ANALYZER=y
    CONFIG_THREAD_ANALYZER_AUTO=y
    CONFIG_THREAD_ANALYZER_AUTO_INTERVAL=5
    CONFIG_THREAD_NAME=y
    CONFIG_THREAD_MONITOR=y
    CONFIG_THREAD_RUNTIME_STATS=y
    CONFIG_THREAD_RUNTIME_STATS_USE_TIMING_FUNCTIONS=y
    CONFIG_THREAD_ANALYZER_USE_LOG=y
    CONFIG_THREAD_ANALYZER_USE_PRINTK=y

    Or printing junk with this config:

    I just need stack and CPU consumption thread wise

Children
  • Hi,

    I was able to run the same, Thread analyzer is working perfectly fine and printing stats when I disable my application thread, please find the stats as in below and suggest if anything wrong here:

    Now if I enable my application thread, thread analyzer is unable to run (I think since it is lower priority task, app thread being higher priority thread is not letting thread analyzer thread to execute), below are the stats:

    Do let me know your thoughts on these stats as well.

    I need  to know how I can optimize my thread based on the above stats:
    1. In first, system reset thread is occupying 93% CPU
    2. In second after enabling app thread, thread analyzer is not at all getting the CPU and main is occupying 84% CPU.

    Thanks,

  • Hi,

    could you post how these threads looks like ?
    Will get back on this.

    Could you post the code that shows these threads? (I can make this case private if you want to.)

Related