[SOLVED] Porting UCOS 3 with SystemView

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

  • [SOLVED] Porting UCOS 3 with SystemView

    Dear All,

    Let me say I'm very enthusiastic about what SystemView potentially has to offer, if it wasn't for an annoying bug.

    First let me clarify some circumstances:

    I'm using a STM32G0 microprocessor in a project I'm currently working on.
    To make development easier I decided to implement an alternative RTOS which I'm more familiar with github.com/weston-embedded/uC-OS3
    Because it's a rather complex and time critical application I also decided to implement a trace/viewer segger.com/downloads/systemview/systemview_target_src

    Reviewed all of the documentation involving the porting of code to the platform and was relatively successful, except for one very annoying thing.



    Somehow the timeline/timing information is incorrect and I cannot get around it.
    SysTick is follow the programmed timer interval but as actual runtime not as interval <X ?

    My first approach to debug this issue is to check if all timers and clocks have been configures correctly, by toggling a pin based on the system tick intervals and can confirm it's spot on correct.
    Next checked if the correct frequency information are supplied to SystemView at startup, which reading from the System window are correctly supplied.

    So last few days I started reviewing supplied code, moreover the trace functionality implementation, but that looks OK (although the Weston Embedded "maintained original" code is very different from the UCOS3 version Silabs is currently using)?

    So I'm lost ;( and I'm open for suggestions :D from fellow coders that have come across the same issue :whistling: or are able to provide some next clue's.
    Best Regards,

    Peter Berben
  • Hi Peter,

    A huge gap/jump in the timestamps happens when there is an overflow in the timestamp delta, i.e. the previous event had a higher timestamp than the current one.
    This is usually triggered when the timer interrupt which is used for the timestamps becomes pending while getting the timestamp.
    You will need to account for that in SEGGER_SYSVIEW_X_GetTimestamp().

    As a reference, have a look at Samples/embOS/Config/Cortex-M0/SEGGER_SYSVIEW_Config_embOS_CM0.c, which uses the SysTick timer as timestamp source.

    Also make sure that SEGGER_SYSVIEW_TickCnt is incremented in SysTick handler before generating any SystemView events.

    Regards
    Johannes
    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 Johannes,

    Can confirm your statement

    "A huge gap/jump in the timestamps happens when there is an overflow in the timestamp delta, i.e. the previous event had a higher timestamp than the current one"

    is the root cause of the problem, more over the SEGGER_SYSVIEW_X_GetTimestamp() was reading values from Cortex M3 style registers and not M0+

    So implemented my own routine et voila issue solved > thanks for the tip!

    Best Regards,

    Peter Berben
  • Hello Peter,

    Great to hear that you are up and running again.
    We will consider this thread as solved now.

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