This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

blocking sl_Recv in multithread environment

Other Parts Discussed in Thread: CC3100, CC3200SDK, CC3200

Hi all,

We changed the configurations of the cc3100 to a multithreaded platform. Now we want to verify the multithreaded platform with a simple example.

So we have three different threads and for each one, has one own socket. All of these three threads are downloading a file from the server for verification reason.

So my question is, how are we able to download different files in differents threads? Do we have to implement a thread save SPI communication or does simplelink this?

We assume, that sl_Recv is blocked. Because all three threads are open a socket and starting with downloading the file. But then it blocks.

/* Log output*/

Socket ID is: 18
 Successfully connected to the server

Socket ID is: 17
 Successfully connected to the server

Socket ID is: 16
 Successfully connected to the server


Allocating memory! 0xc1c063c0
 transfer starting...

 Allocating memory! 0xc1b096c0
 transfer starting...

 Allocating memory! 0xc1d030c0
 transfer starting...

Thanks for some information and help.

BR

Sandro

  • Hi Sandro,

    You need to recompile the "simplelink" host driver project to support multi-threading. Please refer to the "OS" configuration of CC3200 SDK simplelink project (located under <cc3200SDK_DIR>\cc3200-sdk\simplelink).

    Also, see the documentation about OS/Non-OS configuration in section 3.1.2 of CC3200 Wireless MCU Programmer's Guide.

    "The CC3200 SimpleLink host driver is ported on both non-OS and multi-threaded OS environments. The host driver is made OS-independent by implementing an OS abstraction layer. Reference implementation for OS abstraction is available for FreeRTOS and TI-RTOS.

    To work in a multi-threaded environment under a different operating system, provide some basic adaptation routines to allow the driver to protect access to resources for different threads (locking object) and to allow synchronization between threads (sync objects). In addition, the driver support runs without a dedicated thread allocated solely to the SimpleLink driver. To work in this mode, supply a spawn method that enables functions to run on a temporary context."