For ThreadX, the max message_size (* @param message_size : size in bytes of objects that will be held in the queue) for the wiced_rtos_init_queue(...) is 64. Basically message_size/4 number of messages are held a the queue.
Make the following change:
res = wiced_rtos_init_queue(&dummyQueue, NULL, 700, 2); ->
res = wiced_rtos_init_queue(&dummyQueue, NULL, 16, 2); or res = wiced_rtos_init_queue(&dummyQueue, NULL, 64, 2);
Thanks, Seyhan! I've confirmed that this works. What I'm not entirely sure of, though, is why a message size of 700 works with the regular build target (i.e. no '-debug' option included). In this case, calls to wiced_rtos_init_queue() return 0 as expected, and the queue seems to function as expected...(?)
If DEBUG is enabled, the error checking code before creating queue is enabled as well. The error checking code could be enabled without DEBUG as well by commenting out the TX_DISABLE_ERROR_CHECKING code in .../WICED/RTOS/ThreadX/ver5.6/Cortex_M3_M4/GCC/tx_port.h
#define TX_DISABLE_ERROR_CHECKING -> comment this out
#endif /* ifndef DEBUG */
Ah, I was only seeing the error-checking code in the WICED-layer (wiced_rtos.c). This appears to be always-enabled, and checks that the size is a multiple of 4. I see that the TX_DISABLE_ERROR_CHECKING affects which version of various ThreadX functions the linker is pointed to in the precompiled library.