EmbOS V4.12a and SystemView V2.10: struct OS_TRACE_API size mismatch

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

  • EmbOS V4.12a and SystemView V2.10: struct OS_TRACE_API size mismatch

    Hi All,
    I'm trying to implement SystemView V2.10 with EmbOS V4.12a libraries.
    IDE is IAR's EWARM 7.20.
    Target CORTEX M3 STM32F101
    Project based on EmbOS 'Start' blinking 2 leds in 2 tasks, running fluently w/o System View.

    When compiling with System View files, i get this error:

    Updating build tree...
    SEGGER_SYSVIEW_embOS.c
    Error[Pe146]: too many initializer values C:\...\System Viewer 2.10\TargetSrc\Sample\OS\SEGGER_SYSVIEW_embOS.c 139
    Error while running C/C++ Compiler

    It's due to the structure OS_TRACE_API size mismatch between RTOS.h in EmbOS and const OS_TRACE_API embOS_TraceAPI_SYSVIEW initialization in SEGGER_SYSVIEW_embOS.c.


    C Source Code

    1. **********************************************************************
    2. * *
    3. * OS version: 4.12a *
    4. * *
    5. **********************************************************************
    6. ----------------------------------------------------------------------
    7. Licensing information
    8. Licensor: SEGGER Microcontroller GmbH & Co. KG
    9. File : RTOS.h
    10. Purpose : Include file for the OS,
    11. to be included in every C-module accessing OS-routines
    12. NOTE : NONE OF THE DEFINITIONS IN THIS FILE MAY BE MODIFIED
    13. as long as embOS libraries are used.
    14. typedef struct {
    15. //
    16. // Specific Trace Events
    17. //
    18. void (*pfRecordEnterISR) (void);
    19. ....
    20. OS_U32 (*pfPtrToId) (OS_U32 Ptr);
    21. } OS_TRACE_API;
    22. **********************************************************************
    23. * *
    24. * SystemView version: V2.10 *
    25. * *
    26. **********************************************************************
    27. ----------------------------------------------------------------------
    28. File : SEGGER_SYSVIEW_embOS.c
    29. Purpose : Interface between embOS and System View.
    30. // embOS trace API that targets SYSVIEW
    31. const OS_TRACE_API embOS_TraceAPI_SYSVIEW = {
    32. //
    33. // Specific Trace Events
    34. //
    35. SEGGER_SYSVIEW_RecordEnterISR, // void (*pfRecordEnterISR) (void);
    36. ....
    37. SEGGER_SYSVIEW_ShrinkId, // OS_U32 (*pfPtrToId) (OS_U32 Ptr);
    38. SEGGER_SYSVIEW_RecordEnterTimer, // void (*pfRecordEnterTimer) (OS_U32 TimerID); <---- These 2 elements are not in RTOS.h declaration
    39. SEGGER_SYSVIEW_RecordExitTimer // void (*pfRecordExitTimer) (void);
    40. };
    Display All



    As explained in System View manual, V4.12a should be the best version. Any idea ?
    Regards
    Jluc
  • Dear JLuc,

    This is a known issue with SystemView V2.10, which is missing a check for the embOS version in use, thus resulting in the observed incompatibility.
    However, this was already fixed with SystemView V2.20, which is available for download at: segger.com/systemview.html .
    Please kindly excuse any inconvenience caused.

    Best regards,
    Martin
    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.
  • Hello Martin,
    I've downloaded and compiled 2.20 release:

    SEGGER_SYSVIEW.c
    Error[Pe018]: expected a ")" C:\Projets EWARM 7.20\EmbOs V4.12a STLib V3.50 - System Viewer 2.20\System Viewer 2.20\TargetSrc\Config\SEGGER_SYSVIEW_Conf.h 75
    Remark[Pe193]: zero used for undefined preprocessing identifier "SEGGER_SYSVIEW_CORE_M3" C:\Projets EWARM 7.20\EmbOs V4.12a STLib V3.50 - System Viewer 2.20\System Viewer 2.20\TargetSrc\Config\SEGGER_SYSVIEW_Conf.h 101
    Remark[Pe193]: zero used for undefined preprocessing identifier "SEGGER_SYSVIEW_CORE_M3" C:\Projets EWARM 7.20\EmbOs V4.12a STLib V3.50 - System Viewer 2.20\System Viewer 2.20\TargetSrc\Config\SEGGER_SYSVIEW_Conf.h 120
    Remark[Pe193]: zero used for undefined preprocessing identifier "SEGGER_SYSVIEW_CORE_M3" C:\Projets EWARM 7.20\EmbOs V4.12a STLib V3.50 - System Viewer 2.20\System Viewer 2.20\TargetSrc\Config\SEGGER_SYSVIEW_Conf.h 122
    Fatal Error[Pe035]: #error directive: "SEGGER_SYSVIEW_GET_INTERRUPT_ID has to be defined!" C:\Projets EWARM 7.20\EmbOs V4.12a STLib V3.50 - System Viewer 2.20\System Viewer 2.20\TargetSrc\Config\SEGGER_SYSVIEW_Conf.h 125
    Error while running C/C++ Compiler

    outch !

    In SEGGER_SYSVIEW_Conf.h,
    (1) parenthesis is missing in line 74,
    (2) definitions SEGGER_SYSVIEW_CORE_M3 & SEGGER_SYSVIEW_CORE_M0 are not correct: they should be SEGGER_SYSVIEW_CORE_CM3 & SEGGER_SYSVIEW_CORE_CM0 as defined at the
    top of the file.

    C Source Code

    1. #if (defined __SES_ARM) || (defined __CROSSWORKS_ARM) || (defined __GNUC__)
    2. #ifdef __ARM_ARCH_6M__
    3. #define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_M0 <-----------------
    4. #elif (defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__))
    5. #define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_M3 <-----------------
    6. #endif
    7. #elif defined(__ICCARM__)
    8. #if (defined (__ARM6M__) && (__CORE__ == __ARM6M__))
    9. #define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_M0 <-----------------
    10. #elif ((defined (__ARM7M__) && (__CORE__ == __ARM7M__)) || (defined (__ARM7EM__) && (__CORE__ == __ARM7EM__)))<--- this one is missing
    11. #define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_M3 <-----------------
    12. #endif
    13. #endif
    Display All

    The firmware is now running, but I can't get trace in SystemView :wacko:
    It fails at connection: Cannot start recording. My jlink release is : dll V5.03i, hardware V8.0, JLink V8 Nov 28 2014
    It's connected to the target (checked in JLink commander)

    Any idea ?
    JLuc
  • Hello JLuc,

    JLuc wrote:


    outch !

    In SEGGER_SYSVIEW_Conf.h,
    (1) parenthesis is missing in line 74,
    (2) definitions SEGGER_SYSVIEW_CORE_M3 & SEGGER_SYSVIEW_CORE_M0 are not correct: they should be SEGGER_SYSVIEW_CORE_CM3 & SEGGER_SYSVIEW_CORE_CM0 as defined at the
    top of the file.


    Thanks for pointing this out! We'll apply the appropiate fixes for the next release of the software.

    JLuc wrote:


    The firmware is now running, but I can't get trace in SystemView :wacko:
    It fails at connection: Cannot start recording. My jlink release is : dll V5.03i, hardware V8.0, JLink V8 Nov 28 2014
    It's connected to the target (checked in JLink commander)

    Any idea ?
    JLuc


    Did you call SEGGER_SYSVIEW_Conf() from within your application?
    Furthermore, did you configure the appropiate device in SystemViewer?

    Regards,
    Martin
    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.
  • Dear Martin,
    Did you call SEGGER_SYSVIEW_Conf() from within your application?
    Yes. My program is more or less a copy paste of the user manual example:

    C Source Code

    1. int main(void) {
    2. OS_IncDI(); /* Initially disable interrupts */
    3. OS_InitKern(); /* Initialize OS */
    4. OS_InitHW(); /* Initialize Hardware for OS */
    5. BSP_Init(); /* Initialize LED ports */
    6. SEGGER_SYSVIEW_Conf(); /* Configure and initialize SystemView */
    7. OS_CREATETASK(&TCBHP, "HP Task", HPTask, 100, StackHP);
    8. OS_CREATETASK(&TCBLP, "LP Task", LPTask, 50, StackLP);
    9. OS_Start(); /* Start multitasking */
    10. return 0;
    11. }
    Display All


    Furthermore, did you configure the appropiate device in SystemViewer?
    Let me know what should I configure. TODO: add a paragraph in the manual regarding JLink connection.

    Here's the parameters in the connection to JLink window:
    Connection to JLINK : USB
    Target Device: Unspecified
    Target Interface & Speed = SWD @2000kHz (same as EmbOSView, works fine)
    RTT Control block detection : Auto detection

    It's difficult to debug because Sysview and debugger are exclusive.


    Best regards
    JLuc
  • Hi JLuc,

    JLuc wrote:


    Let me know what should I configure. TODO: add a paragraph in the manual regarding JLink connection.

    I have forwarded your request to the developers assigned with SystemView. They'll add the requested information to upcoming releases.

    JLuc wrote:


    Here's the parameters in the connection to JLink window:
    Connection to JLINK : USB
    Target Device: Unspecified
    Target Interface & Speed = SWD @2000kHz (same as EmbOSView, works fine)
    RTT Control block detection : Auto detection

    Your configuration seems fine except for "Unspecified": When no debug session is running in parallel, you'd need to specify the target device inside SystemViewer, e.g. STM32F101VG.

    JLuc wrote:


    It's difficult to debug because Sysview and debugger are exclusive.

    For a Cortex-M3 using SWO, both the IAR C-SPY debugger and SEGGER SystemView should be able to run in parallel. Did you experience an error message telling "Second debugger connection to the same J-Link detected"?

    Best regards,
    Martin
    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.
  • Dear Martin,
    finally it works !
    The problem is in the RTT connection. When in AUTO mode, RTT can't find the buffers, even in range mode. I've to fill the address manually, in address mode.
    You can find it in the map file, look for _SEGGER_RTT, something like 0x20000D5C.

    By the way, the tip (help) for this field doesn't appear if the connection fails.

    Waiting for the V2.30....
    Regards
    JLuc
  • Dear Martin,
    For a Cortex-M3 using SWO, both the IAR C-SPY debugger and SEGGER
    SystemView should be able to run in parallel. Did you experience an
    error message telling "Second debugger connection to the same J-Link
    detected"?
    It doesn't work, even with the correct address, no message.

    Your configuration seems fine except for "Unspecified": When no debug
    session is running in parallel, you'd need to specify the target device
    inside SystemViewer, e.g. STM32F101VG.
    In fact, I get 'CORTEX-M3' and UNSPECIFIED in the combo box after a valid connection.
    It looks like a recursive problem: you can't get all parameters for connection until you get a connection.

    I hope that helps.

    Best regards.
  • Hi JLuc,

    JLuc wrote:

    Dear Martin,
    finally it works !
    The problem is in the RTT connection. When in AUTO mode, RTT can't find the buffers, even in range mode. I've to fill the address manually, in address mode.

    Glad to hear it is finally working! I'll push the devs to release V2.30 soon. ;)

    Regards,
    Martin
    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.
  • I have the same problem with OS_TRACE_API size mismatch using embOS V4.12 (that's the newest version for Cortex-M for Keil) and SystemView V2.20.
    The OS_TRACE_API definition in RTOS.h missmatches with it's using in SEGGER_SYSVIEW_embOS.c.
    The SystemView documentation says that it will work with embOS since V4.12 but that seams to be wrong. Do I need a newer version of embOS (which is not released for Keil at the moment!).
  • Hi Martin,

    Martin wrote:

    The SystemView documentation says that it will work with embOS since V4.12 but that seams to be wrong. Do I need a newer version of embOS (which is not released for Keil at the moment!).

    You're correct, a more recent embOS version is required. While SystemView support was in deed implemented with embOS V4.12, recent versions of SystemView require V4.12a of embOS. We expect to release an updated version of embOS for Cortex-M and KEIL MDK within the next week, which will provide full support for the most recent version of SystemView. Please kindly excuse the inconvenience.

    Best regards,
    Martin
    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.
  • SEGGER - Martin wrote:

    We expect to release an updated version of embOS for Cortex-M and KEIL MDK within the next week, which will provide full support for the most recent version of SystemView. Please kindly excuse the inconvenience.

    Best regards,
    Martin
    Hello Martin,

    I can't see an update for the embOS object Code on Cortex-M and KEIL MDK until now. The actuall version is 4.12 with NO SystemView support.
    When will the update be available for Cortex-M and KEIL? Some other embOS Sources using already 4.16!
  • Hello Martin,

    sorry for the delay, we were pretty busy last week (EW2016 is coming!).
    We always try to keep all embOS ports up to date which needs some time with so many ports (currently we have over 80 embOS ports :) ).
    Anyhow I will give this high priority now and keep you informed.

    Btw.: In such a case and since your are in support please don't hesitate to contact us via the embOS support email address or give as a call.

    Best regards,
    Til
    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.
  • embOS V4.16 has now been released for Cortex-M and Keil MDK. Please kindly excuse any inconvenience caused.

    Best regards,
    Martin
    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.