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.

#41 expected an identifier in osi.h

Other Parts Discussed in Thread: CC3200MOD, CC3200SDK, CC3200

hello

i am using tcp_socket example as a platforme for my own app and it worked ok

i want to copy a file to the cc3200mod usingthe tftp example into tcp_socket

so i copied the relevant code and the includes but i am still getting an "#41 expected an identifier"  in osi.h 

Description Resource Path Location Type
#41 expected an identifier .ccsproject /tcp_socket line 59, external location: C:\ti\CC3200SDK_1.1.0\cc3200-sdk\oslib\osi.h C/C++ Problem

typedef enum
{
OSI_OK = 0,
OSI_FAILURE = -1,
OSI_OPERATION_FAILED = -2,
OSI_ABORTED = -3,
OSI_INVALID_PARAMS = -4,
OSI_MEMORY_ALLOCATION_FAILURE = -5,
OSI_TIMEOUT = -6,
OSI_EVENTS_IN_USE = -7,
OSI_EVENT_OPEARTION_FAILURE = -8
}OsiReturnVal_e;

however when i build the originak tftp example it is built ok (its the same osi.h)

what is the problem?

  • Hi,

    This is probably because of conflicting definitions of OSI_OK.

    The tcp_socket, is for Non-OS, and the tftpclient application is for FreeRTOS. So, possibly the "OSI_OK" definition (nonos.h) is conflicting with the enum you mentioned above.


    You can also post it on the code composer forum- you will get a better response there.

    Regards,
    Gigi Joseph
  • so can i integrate the tftp example in the tcp_socket example?
    i have a device with non OS connected to the cc3200mod and i want to update the mcuimg.bin so using tftp i will download the new mcuimg.bin from a local computer to the cc3200mod and commit it.
    is it possible?
    if not what is the best way to do so (not using the dropbox\internet like in the OTA example)?
  • It is a conflict, in the file simplelink/source/nonos.h just delete/comment the line '62' with this statement: #define OSI_OK NONOS_RET_OK.

    Voilá! The problem will disappear.

    After this, ensure that your struct will be like this:

    typedef enum
    {
    OSI_OK = (0),
    OSI_FAILURE = -1,
    OSI_OPERATION_FAILED = -2,
    OSI_ABORTED = -3,
    OSI_INVALID_PARAMS = -4,
    OSI_MEMORY_ALLOCATION_FAILURE = -5,
    OSI_TIMEOUT = -6,
    OSI_EVENTS_IN_USE = -7,
    OSI_EVENT_OPEARTION_FAILURE = -8
    }OsiReturnVal_e;

  • This is because you are trying to insert  simplelink headers in an OS based project.

    If you check your simplelink.h file, at line number  731nonos.h is included instead of spawn.h. This is because you must have the macro SL_PLATFORM_MULTI_THREADED  defined inside any of your header files like:

    #define SL_PLATFORM_MULTI_THREADED  

    Other workaround is : close CCS and open .cproject file in your project directory with a text editor.

    Add this  line :

    <listOptionValue builtIn="false" value="SL_PLATFORM_MULTI_THREADED"/>

    inside the <option></option header>. You can find the line to append the above line by searching for :

    <listOptionValue builtIn="false" value="cc3200"/>