20719 : Not being able to run a simple thread

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
assh_3716096
Level 2
Level 2
First like received First like given

Hi All,

I'm trying to make an RTOS application run, with a single thread. Here is snippet of my code

#include "wiced_rtos.h"

/******************************************************************************

*                                Constants

******************************************************************************/

#define THREAD_PRIORITY 10

#define THREAD_STACK_SIZE 1024

/******************************************************************************

*                          Function Definitions

******************************************************************************/

void ledThread(uint32_t arg)

{

   while(1)

    {

        WICED_BT_TRACE("**** welcome aboard buddy **** \n\r");

        wiced_rtos_delay_microseconds(5 * 1000);

    }

}

*

*  Entry point to the application. Set device configuration and start BT

*  stack initialization.  The actual application initialization will happen

*  when stack reports that BT device is ready.

*/

APPLICATION_START()

{

    wiced_result_t err;

    wiced_set_debug_uart(WICED_ROUTE_DEBUG_TO_PUART);

    wiced_thread_t* p_thread;

    p_thread = wiced_rtos_create_thread();

    err = wiced_rtos_init_thread(p_thread,THREAD_PRIORITY,NULL,ledThread,THREAD_STACK_SIZE, NULL);

    WICED_BT_TRACE("**** Thread has been created %d **** \n\r",err);

}

Function wiced_rtos_init_thread() returns err = 15, which indicates some kinda Thread error. I'm not being able to figure it out, what's wrong.

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
AnjanaM_61
Moderator
Moderator
Moderator
5 comments on KBA First comment on KBA 5 questions asked

Hi Ashish,

Could you please try create the thread in BTM_ENABLED_EVT after calling the wiced_bt_stack_init?

I have attached one example project. You may refer to the sample code.

Thanks & Regards,
Anjana

View solution in original post

1 Reply
lock attach
Attachments are accessible only for community members.
AnjanaM_61
Moderator
Moderator
Moderator
5 comments on KBA First comment on KBA 5 questions asked

Hi Ashish,

Could you please try create the thread in BTM_ENABLED_EVT after calling the wiced_bt_stack_init?

I have attached one example project. You may refer to the sample code.

Thanks & Regards,
Anjana