Issues using rtos create

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

cross mob
Anonymous
Not applicable

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

pastedImage_47.png

but in the wiced_rtos.h we found

pastedImage_48.png

Maybe is only the prototype name.

Best regards,

0 Likes
1 Solution

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

View solution in original post

7 Replies
ShengY_96
Employee
Employee
10 sign-ins 5 sign-ins Welcome!

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;

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

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:
pastedImage_8.png

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

0 Likes

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

Anonymous
Not applicable

Hi Jenson,

Thanks, I will try this.

0 Likes

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

0 Likes
dezi_3554521
Level 2
Level 2
First like given

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.

0 Likes
Anonymous
Not applicable

deniszinchenko
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.

0 Likes