[SOLVED] embOS 5.16.1 & IAR 9.40.1 not working correctly

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

  • [SOLVED] embOS 5.16.1 & IAR 9.40.1 not working correctly

    1. Which embOS do you use?
    embOS for ARM 5.16.1 with IAR 9.40.1 and J-Link.
    2. Which CPU and eval board do you use?
    ST STM32WB55VG.

    Hello,

    We are currently migrating a couple of projects from IAR 9.32.2 to IAR 9.40.1 to test it. We have encountered some issues we didn't have with the previous versions of IAR that are embOS related.

    1. When trying to debug one of the projects, we get a new error when connecting to the target in the form of Wed Jun 21, 2023, 11:08:42: : Error: Unknown or ambiguous symbol. OS_Global. This is not an issue in IAR 9.32.2 and the configuration used for the project is the same.
    2. Related to this, We are unable to see the call stacks of different tasks during debugging using the embOS IAR plugin. All tasks shown in the tasks view show the same call stack (Shown in the attached picture "call_stack.png"). The same project with IAR 9.32.2 was fine and could show all the information.
    3. Finally, this is an embOS 5.16.1 specific issue, OS_HEAP_malloc() supports being called from main before OS_Start but somehow it is straight-up throwing us to OS_Error OS_ERR_INIT_NOT_CALLED (165) (This behavior did not happen in embOS 5.02a).
    Is it that embOS is not supported in IAR 9.40.1? Why is OS_HEAP_malloc throwing OS_Error?

    Thank you!
    Images
    • call_stack.png

      1.25 kB, 322×52, viewed 572 times
  • Hello Javier,

    Regarding 1. and 2.:
    Which version of the embOS plug-in for IAR Embedded Workbench are you using?
    If it is older than version 9.40.6.1, please download the newest version from our website and check if this fixes the observed issues.
    segger.com/products/rtos/embos…s/iar-embedded-workbench/

    Regarding 3.:
    We're not aware of any issue with OS_HEAP_malloc() in embOS for ARM V5.16.1.x.
    If OS_Error() is called with error code OS_ERR_INIT_NOT_CALLED (165) it means that OS_HEAP_malloc() has been called before OS_Init() was called.
    Can you check whether OS_Init() has been called before calling OS_HEAP_malloc()?

    If your application is calling OS_Init() before OS_HEAP_malloc(), but OS_Error() is still called with error code OS_ERR_INIT_NOT_CALLED (165) then it might be that OS_Global.InitCalled has been overwritten with 0 after OS_Init() was called. Thus, you would need to check where/why OS_Global.InitCalled has been overwritten after OS_Init() and before calling OS_HEAP_malloc().

    Best regards,
    Michael
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Thank you for your quick response!

    Regarding 3.:
    Seems like we were delaying OS_Init until a bit later in that exact control path so we were calling OS_malloc before OS_Init which caused the issue.

    Regarding 1. and 2.:
    We are using the IAR 9.40.1 shipped version of the embOS plugin, which is 9.40.6.1.

    Many thanks,
    Javier
  • Hello Javier,

    We tried to reproduce the observed issues from 1. and 2. with embOS for Cortex-M and IAR V5.16.10, IAR EWARM 9.40.1 and the embOS plug-in V9.40.6.1, but everything worked fine for us.

    According to our registry your embOS license is within a valid support period. Thus we will contact you via email to discuss further steps on how to find the root cause for the observed issues.

    Best regards,
    Michael
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Issue 1. and 2. occurred under special circumstances only and are fixed in the latest IAR plugin 9.x.6.2, which is available for download.
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.