Forums - qca4020 queries regarding qurt thread

2 posts / 0 new
Last post
qca4020 queries regarding qurt thread
akshay.b
Join Date: 2 Aug 19
Posts: 58
Posted: Wed, 2020-09-23 13:29

Hello,

we are facing following issues while using qurt thread. Using SDK 3.2 for qca4020. building the code with threadx rtos.

1) We created qurt thread using api qurt_thread_create having priority as 10, stack size as 2048. Thie thread is been created in Initialize_onboard_demo function in file onboard.c.

The thread is running continuously in while(1) loop as seen below.

void thread_1(void)
{
while(1)
{
    if(flag == 1)
    {
        //execute  code
    }
    else if(a > b)
    {
        //execute  code
    }
}
}

This code gets stuck as soon as it is created. But if we introduce qurt_thread_sleep(1); at the end of the while loop it runs properly. As you can see below.

void thread_1(void)
{

while(1)
{
    if(flag == 1)
    {
        //execute  code
    }
    else if(a > b)
    {
        //execute  code
    }

qurt_thread_sleep(1);
}
}

 

2) Have noticed that when the code runs for a long time for above mention thread the complete code hangs due to the thread and the device goes in EDL mode as can be seen in device manager. What can be the reason?

3) If we create multiple thread in same .c file, only one thread runs and the other thread does not perform any action even if flag is set to 1.

4) We are getting MQTT_CLIENT_NOT_IDLE_ERROR when we call publish function outside the aws_thread function. We referred aws forum for this solution https://forums.aws.amazon.com/thread.jspa?threadID=237345.

What all files we need to add if we defined the macro _ENABLE_THREAD_SUPPORT_ in your aws_iot_config.h as it is showing error while compiling when we add macro _ENABLE_THREAD_SUPPORT_ in your aws_iot_config.h file.

 

Any help will be appreciated.

 

Thank you

Akshaay

  • Up0
  • Down0
ss.pandiri
Join Date: 29 May 18
Posts: 31
Posted: Tue, 2020-12-15 00:47

Hello Akshaay,

 

I think problems 1, 2 and 3 above are related to thread priorities and your current thread seems to hog cpu. Please use a lower priority for your thread which will allow other threads in the system to function properly

thanks,

Steven

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.