cancel
Showing results for 
Search instead for 
Did you mean: 

WICED Studio Wi-Fi Combo

MaFa_974161
Contributor

Hello, 

I've bought CYW943907AEVAL1F board.

 

I develop a firmware that manipulate a mutex (wiced_rtos_lock_mutex) and manipulate a queue (wiced_rtos_push_to_queue) in a ISR (interrupt service routine) but each API calls get me errors:

 

wiced_rtos_lock_mutex returns 4 (WICED_ERROR)

wiced_rtos_push_to_queue returns 1032 (WICED_QUEUE_ERROR)

 

I suspect that I can't manipulate mutex or queue in a ISR (interrupt service routine)  ...

can you confirm this ?

 

Thankyou.

 

 

0 Likes
1 Solution
Félix_T
Contributor

Locking a mutex is usually not allowed from and ISR, because it can block. If your ISR blocks, then your system would effectively lock up, and never be able to return to the threads.

As far as pushing to a a queue from an ISR, you can do it, BUT, it depends on how the wiced_rtos_push_to_queue call is implemented. If the call to the RTOS queue function is made with a timeout value set to anything other than 'no timeout' then, you cannot use wiced_rtos_push_to_queue in an ISR, because allowing a timeout could possibly block.

View solution in original post

1 Reply
Félix_T
Contributor

Locking a mutex is usually not allowed from and ISR, because it can block. If your ISR blocks, then your system would effectively lock up, and never be able to return to the threads.

As far as pushing to a a queue from an ISR, you can do it, BUT, it depends on how the wiced_rtos_push_to_queue call is implemented. If the call to the RTOS queue function is made with a timeout value set to anything other than 'no timeout' then, you cannot use wiced_rtos_push_to_queue in an ISR, because allowing a timeout could possibly block.

View solution in original post