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: Problem porting Multithreaded example to STM32

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

Hi Dear Support,

I have following problem compiling an example with  Multithreading enabled. I have got errors in the file user.h. The following line in user.h is the first of similar errors:

#define sl_SyncObjCreate(pSyncObj,pName)    osi_SyncObjCreate(OsiSyncObj_t* pSyncObj)

Description                                                       Resource    Path                                                                                                          Location    Type
expected expression before 'OsiSyncObj_t'    user.h         /FreeRTOS_CC3100_F446RE/Src/cc3100-sdk/platform/stm32nucleo     line 773     C/C++ Problem

The following Preprocessor Define:

#define sl_SyncObjWait(pSyncObj,Timeout)        osi_SyncObjWait(OsiSyncObj_t* pSyncObj , OsiTime_t Timeout)

results in this error:

Description                                                               Resource    Path                                                                                                           Location    Type
too few arguments to function 'osi_SyncObjWait'    user.h          /FreeRTOS_CC3100_F446RE/Src/cc3100-sdk/platform/stm32nucleo    line 834    C/C++ Problem

My Development environment is OpenSTM32/AC6

Thank you for your help.

Otto Parzhuber


 

  • Hi Otto,

    In the TI porting guide included in the SDK (cc3100_sdk\docs\simplelink_api\html\index.html) step 6 mentions:

    "If you choose to work in multi-threaded environment under operating system you will have to 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 running without dedicated thread allocated solely to the simple link driver. If you choose to work in this mode, you should also supply a spawn method that will enable to run function on a temporary context."

    Thus, the two functions in your example osi_SyncObjCreate and osi_SyncObjWait are likely not defined in your application. In the TI SDK examples with multi-threading these definitions are normally found in the cc_pal.c (porting abstraction layer). Once you provide the thread sync objects these errors should resolve.

  • include files : \ti\CC3100SDK_1.2.0\cc3100-sdk\oslib\osi_freertos.c
  • Thank you Austin for your help.

    Meanwhile I've managed to successfully build the mqtt example.

    But now my program get stuck in the HardFault Handler after the call to the function prvPortStartFirstTask( void ).

    I have no idea how to solve this problem?

  • This is the contents of the registers after the Hard Fault. 

    pulFaultStackAddress uint32_t * 0x2001ffdc r0 volatile uint32_t 0x2001ff98 (Hex) r1 volatile uint32_t 0x20020000 (Hex) r2 volatile uint32_t 0xf00000 (Hex) r3 volatile uint32_t 0xe000ef34 (Hex) r12 volatile uint32_t 0xc0000000 (Hex) lr volatile uint32_t 0x0 (Hex) pc volatile uint32_t 0x80055ff (Hex) psr volatile uint32_t 0x8005510 (Hex)

    I believe the lr register contents is nosense.....

  • Hi Otto,

    The function prvPortStartFirstTask() is one defined in FreeRTOS.  There are some debug tips in the below link:

  • Thank you very much much... the debug tips solved my problem