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.

Starterware/CC3120: Porting CC3100 to CC3120

Part Number: CC3120
Other Parts Discussed in Thread: CC3100, , CC3200

Tool/software: Starterware

Dear Support:

I have old code running on a Tiva with CC3100 using TI-RTOS running with SDK 1.2 and am able to make the following calls with no issues:

struct sockaddr_in ListenAddress;
struct sockaddr ClientAddress;

ListenSocket = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP );
ListenAddress.sin_addr.s_addr = htonl( INADDR_ANY );
ListenAddress.sin_port = htons( CLIENT_TCP_SERVER_PORT );
setsockopt( ListenSocket, SOL_SOCKET, SO_KEEPALIVE, &optval, optlen );

I am porting this CC3100 code over to using MSP432 + CC3120 and when compiling my code with these calls above, it doesn't understand "stuct sockaddr_in" and "struct sockaddr" as well as the following:

AF_INET
SOCK_STREAM
IPPROTO_TCP
INADDR_ANY 
htons
htonl
socket
setsockopt

Can you tell me what .h files I need to include in my project to build this so that I can easily move my CC3100 code over to using CC3120?

Thanks,
Tim

  • Tim -
    the MSP432 Plugin for the CC3120 is not an option for you here?
    www.ti.com/.../simplelink-wifi-cc3120-sdk-plugin

    (link above is for the MSP432 and the CC3120 plugin)
    + in the SDK is a migration guide which should be helping out here directly.
    file:///C:/ti/simplelink_msp432_sdk_wifi_plugin_1_30_00_03/docs/SimpleLink%20Gen1%20to%20Gen2%20SDK%20Migration%20Guide.pdf
    Please have a look see and let me know if there is something not there which is needed.

    thanks!
  • Hey Josh:

    Yes, that is what I am using MSP432 + CC3120 with the wifi plugin. Using the network_terminal example to understand how to connect to my router with the new Simplelink calls which is what the migration guide that you were referencing addresses.  I able to connect ok to my router, but now needing to get my socket threads to compile successfully.  With the previous SDK with CC3200 and CC3100, I was able to use Berkeley sockets API calls like what I was referencing in my earlier post. Now the compiler with the new SDK doesn't understand what I was using before and I am needing to know what I need to do with my current CC3200/CC3100 code to get this compile with the new SDK.  I don't see the migration guide addressing this.  Am I missing something here?  Hopefully it is just a matter of adding a .h file so that this easily ports over - please advise.   Are Berkeley socket calls supported with this new SDK like the older SDKs did?

    Thanks,
    Tim

  • Tim  -

    check out the Appendix I (reference porting code) at the end of the document - you will see the sl_compat.h, osi.h, osi_posix.c - these are the .c and .h files i think you are looking for. 

    they were put in this way instead of making them part of the SDK, because of the new file structure being used did not really have a place to put them (since this is to ease going from Gen1 to Gen2, as you are doing)

  • Hey Josh:

    I couldn't find these files (sl_compat.h, osi.h ) in the SDK, but this didn't address the issue of needing the SDK to support Berkeley socket calls anyways.  I figured it out, but it wasn't contained in the migration document.  I found a socket.h file found in:

    ti/drivers/net/wifi/sys/socket.h

    and when added to my .c files, it allowed me to use Berkeley sockets calls such that it would successfully compile, build and work.  Do you know if this is addressed anywhere in the documents that are available either in the SDK or on a Wiki site?  Was expecting this to not have been so difficult to figure out.  Figured it out by doing a file search on the files in the SDK and finding a .h file that would hopefully do what I needed to do, but I didn't see this addressed in any document.  Please let me know if you know of any such documentation for future reference.

    Thanks,
    Tim

  • Are those files like sl_compat.h posted in text form for download? All I have is the pdf which when I copy and paste introduces errors of its own.

  • I assume you are asking Josh - I could not find these files.

    Tim

  • Yes, sorry. They must be somewhere to get in the appendix of a pdf.