1 Reply Latest reply on Jan 10, 2019 3:54 AM by AnjanaM_61

    20719 : Not being able to run a simple thread

    assh_3716096

      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.