7 Replies Latest reply on Aug 29, 2018 3:53 AM by debe_3637251

    Issues using rtos create

      Hi,

       

      [ WICED-Studio-6.2.1 (Linux 64-bit) ]

       

      I´ve two issues about Wiced using rtos:

       

      First

      Typedef wiced_thread_t isn't known even after included wiced_rtos.h in the code.

       

       

       

      Second

      According to API Reference Guide v6.2.0 - page 95

      but in the wiced_rtos.h we found

      Maybe is only the prototype name.

       

       

      Best regards,

        • 1. Re: Issues using rtos create
          ShengY_96

          I am use the Windows version.

          1. The wiced_thread_t can be found in rtos.h which had included by wiced_rtos.h

          typedef struct

          {

              TX_THREAD handle;                           /**< TX thread Handle     */

              void*     stack;                            /**< Thread Stack Pointer */

          } wiced_thread_t;

          • 2. Re: Issues using rtos create

            Using windows version too:

             

             

            #include "wiced_rtos.h"

            ...

            void NewThread(uint32_t arg);

            wiced_thread_t ptr_thread;

            ...

             

            wiced_result_t status = wiced_rtos_init_thread(&ptr_thread, 3, "thread", NewThread, 2000, 0);

             

            static void NewThread(uint32_t arg)

            {

            }

             

            I got the same error, this is the output:

             

            I attached wiced_rtos.h , as you can see rtos.h doesn't exist.

            • 3. Re: Issues using rtos create
              dezi_3554521

              Second question :

              wiced_rtos_init_thread and wiced_rtos_create_thread are different functions.

              from wiced_rtos.c:

               

              wiced_result_t wiced_rtos_create_thread( wiced_thread_t* thread, uint8_t priority, const char* name, wiced_thread_function_t function, uint32_t stack_size, void* arg )

              {

                  thread->thread = wiced_rtos_create_thread_rom( );

                  if ( thread->thread == NULL )

                      return WICED_ERROR;

                  /*2039 FW limits priority to 0(lowest) to 7(highest)*/

                  if ( priority > 6 )

                      priority = 1; /* priority 0 is reserved for IDLE thread in 20739 FW */

                  else

                      priority = (uint8_t) ( 7 - (uint32_t) priority );

                  return wiced_rtos_init_thread( thread->thread, priority, name, function, stack_size, arg );

              }

               

              As you can see, wiced_rtos_create_thread call wiced_rtos_init_thread with some data manipulation.

               

              First question:

              Did you #include "wiced.h"?

              If yes, tell what libs did you included and share makefile.mk in project directory.

              • 4. Re: Issues using rtos create

                dezi_3554521
                I include wiced.h and error keeps.

                 

                My project is based on hello_sensor provided by Wiced Studio 6.2, I don't change makefile or added new lib.

                • 5. Re: Issues using rtos create
                  AxLi_1746341

                  yans wrote:

                   

                  I am use the Windows version.

                  1. The wiced_thread_t can be found in rtos.h which had included by wiced_rtos.h

                   

                  You are talking about different wiced_rtos.h file:

                   

                  ./20719-B1_Bluetooth/include/20719/wiced_rtos.h

                  ./43xxx_Wi-Fi/include/wiced_rtos.h

                  ./20735-B1_Bluetooth/include/20735/wiced_rtos.h

                  • 6. Re: Issues using rtos create
                    ShengY_96

                    Firstly, use the followed code for CYW20719's thread create demo:

                     

                    wiced_thread_t* ptr_thread;

                    ptr_thread = wiced_rtos_create_thread();

                    wiced_result_t status = wiced_rtos_init_thread(ptr_thread,6,"thread",NewThread,1024,NULL);

                     

                    Secondly, Thanks for axel.lin_1746341 's remind.  My post#2 is for /43xxx_Wi-Fi/include/wiced_rtos.h.

                    CYW20719 use ./20719-B1_Bluetooth/include/20719/wiced_rtos.h

                     

                    Regards

                    Jenson

                    1 of 1 people found this helpful
                    • 7. Re: Issues using rtos create

                      Hi Jenson,

                       

                      Thanks, I will try this.