[SOLVED] How to initialize runtime multithread support with embOS 5.10 and IAR 8.5

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • [SOLVED] How to initialize runtime multithread support with embOS 5.10 and IAR 8.5

      I am in the process of doing a proof-of-concept migration of some old code that uses embOS 3.80h with IAR EWARM 5.2 to embOS 5.10 with IAR EWARM 8.5.


      I am a little stuck on how to properly initialize the multi-threading support.


      With the old software our code simply called OS_INIT_SYS_LOCKS().


      That doesn't seem to do the trick with the new software - I get the following linker errors:


      > Error[Li005]: no definition for "__iar_system_Mtxinit" [referenced from xsyslock_mtx.o(th7M_tln.a)]
      > Error[Li005]: no definition for "__iar_system_Mtxdst" [referenced from xsyslock_mtx.o(th7M_tln.a)]
      > Error[Li005]: no definition for "__iar_system_Mtxunlock" [referenced from xsyslock_mtx.o(th7M_tln.a)]
      > Error[Li005]: no definition for "__iar_system_Mtxlock" [referenced from xsyslock_mtx.o(th7M_tln.a)]


      IAR's documentation on this isn't particularly helpful - it says to look at the DLib_Threads.h file. That file describes a bunch of variables and definitions that can be set to control multi-thread support, but doesn't really explain exactly what modifications should be made or why.


      I'm hoping you can provide some guidance for what embOS needs; I didn't find anything specific in the UM01014_embOS_CortexM_IAR.pdf manual.
    • Hello Michael,

      unfortunately IAR changed the thread safety support in different IAR EWARM version.
      What needs to be done for different IAR version in described in chapter "4.2 Thread-safe system libraries" and "4.2.2 IAR compiler V8.10 and newer".

      From the linker error message I guess you did not add the xmtx.c, xmtx2.c and xmtx3.c.
      Please find these files in the \Setup folder of your board support package.
      Does that solve your issue?

      In case of doubt please don't hesitate to contact our embOS support directly and we will be happy to assist you:
      segger.com/doc/UM01001_embOS.html#Support

      Best regards,
      Til
    • > What needs to be done for different IAR version in described in chapter "4.2 Thread-safe system libraries" and "4.2.2 IAR compiler V8.10 and newer"

      I can't find those sections in:

      - UM01014 - "CPU & Compiler specifics for ARM Cortex-M using IAR Embedded Workbench" (Software version: 5.10.1.1 Revision: 0) June 17 2020
      - UM01001 - "Real-Time Operating System User Guide & Reference Manual" (Software version: 5.10.1.0 Revision: 0) June 17 2020

      What am I missing?