cancel
Showing results for 
Search instead for 
Did you mean: 

Resource Library

ThreadX Patch for WICED SDK-3.1.x

SeyhanA_31
Employee

ThreadX Patch for WICED SDK-3.1.x

Here is a patch for ThreadX for WICED SDK-3.1.x version.

The following is the patch for .../WICED/RTOS/ThreadX/WWD/wwd_rtos.c:

@@ -84,7 +84,7 @@ wwd_result_t host_rtos_create_thread_with_arg( /*@out@*/ host_thread_type_t* thr

     tx_thread_stack_error_notify( wiced_threadx_stack_error_handler );

#endif /* ifdef DEBUG */

-    status = tx_thread_create( thread, (char*) name, (void(*)( ULONG )) entry_function, arg, stack, (ULONG) stack_size, (UINT) priority, 0, TX_NO_TIME_SLICE, (UINT) TX_AUTO_START );

+    status = tx_thread_create( thread, (char*) name, (void(*)( ULONG )) entry_function, arg, stack, (ULONG) stack_size, (UINT) priority, (UINT) priority, TX_NO_TIME_SLICE, (UINT) TX_AUTO_START );

     return ( status == TX_SUCCESS ) ? WWD_SUCCESS : WWD_THREAD_CREATE_FAILED;

}

@@ -266,7 +266,7 @@ wwd_result_t host_rtos_delay_milliseconds( uint32_t num_ms )

     else

     {

         uint32_t time_reference = host_platform_get_cycle_count( );

-        int32_t wait_time       = (int32_t)num_ms * CPU_CLOCK_HZ / 1000;

+        int32_t wait_time       = (int32_t)num_ms * (int32_t)CPU_CLOCK_HZ / 1000;

         while ( wait_time > 0 )

         {

             uint32_t current_time = host_platform_get_cycle_count( );

The .../WICED/RTOS/ThreadX/WWD/wwd_rtos.c source file is also attached.

Attachments
0 Likes
Comments
Anonymous
Not applicable

Hi Seyhan,

Can you explain a bit about the changes?

Line 14/15 is to fix host_rtos_delay_milliseconds().

What is the purpose of line 05/06?

I mean what's the user visible impact with this change?

Thanks.

Anonymous
Not applicable

I had problem with this delay at the ThreadX

It is good.

SuMa_296631
Contributor II

Without explaining what problem the patch solves, leads me to ask:

- does the same problem exist in SDK 2.4.1 (which some of us are stuck on for the STM32F1xx support)?

- if so, will a patch be released, and when?

Susan

Anonymous
Not applicable

Hi,

The change is a fix in the Threadx priorities.

To be more specific its the preempt threshold, its now changed from 0 to be the priority, so as to make more the priority of threads and match behaviour of other operating systems

Version history
Revision #:
1 of 1
Last update:
‎Dec 19, 2014 11:07 AM
Updated by:
 
Contributors