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.

CC3100SDK: include "simplelink" files in a CC2538 IAR project

Part Number: CC3100SDK
Other Parts Discussed in Thread: CC2538, CC3100

Greetings,

I'm using CC3100 with the host CC2538. I have a problem including the "cc3100-sdk\simplelink" files into the CC2538 IAR project.

I copied the folder "simplelink" from the SDK into my project folder. Then I included these files into my code on the host:

#include "device.h"
#include "fs.h"
#include "netapp.h"
#include "netcfg.h"
#include "socket.h"
#include "trace.h"
#include "wlan.h"
#include "wlan_rx_filters.h"
#include "user.h"

I also added all the files in the IAR workspace:

I also added the "simplelink", "simplelink\include","simplelink\source" directories to the additional include directories of the IAR project.

I get multiple errors (in every ".c" file in simpelink\source) about not defined identifiers (like: OSI_OK, SpiHandle_t, .. ). And in my "board.c" file, I get the (function has no prototype) error although all functions have prototypes in "board.h" (which is included in the same file).

Could anyone please help me with this? What did I do wrong? Isn't this the right way to include CC3100 files?

Thanks in advance

* James *

  • Hi James,

    Are you following the porting instructions in "<sdk>/cc3100-sdk/docs/simplelink_api/html/index.html" ?
    Which OS (if any) are you using?
    Please use one the supported platforms as your reference.

    Basically your code should include both HW adaptation layer (see example "user.h" from one of the platforms for details, it provides hw driver specific definitions such as SpiHandle_t) and OS adaptation (see osi.h which includes OSI_OK).
    The header should contains adaptation between the simplelink API and your specific OS and HW driver.

    It seems that you picked your user.h from the "simplelinkstudio" platform. Why did you pick this one and not one from MCU platfrom?

    br,
    Kobi
  • Hi Kobi,

    Thanks for your answer. I followed the instructions and modified my "user.h". My processor does not have an OS, so I removed the definition SL_PLATFORM_MULTI_THREADED. There are just two problems remaining:

    1. I still have the (function has no prototype) error in most of my "board.c" functions although they have prototypes in "board.h". Any advice about that?

    2. In "user.h", I must define a type called _SlFd_t (which was SpiHandle_t in my unmodified file). I looked into the examples and found that it has different values for each board (SpiHandle_t, short*, int). How do I know which value should I define for this?

    Thanks in advance.
    * James *