Profiler on STM32 cube mx project

Sysprogs forums Forums VisualGDB Profiler on STM32 cube mx project

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #35147
    BoazMegg
    Participant

    Is it possible to use the profiler with a cube-mx project (created using your tutorial)?

    I tried to add it but after adding the fast-semihosting and the call to InitializeInstrumentingProfiler I get RaiseError which says:

    void __attribute__((noinline)) RaiseError(InstrumentingProfilerErrorCode errorCode, uintptr_t pArg = 0)
    {
    (void)errorCode;
    (void)pArg;
    //If you have stopped here, the profiler has detected an unrecoverable error.
    //Examine the errorCode variable (r0) and pArg (r1) for more details.
    asm("bkpt 255");
    }
    • This topic was modified 4 months, 3 weeks ago by support. Reason: formatting
    #35149
    support
    Keymaster

    Hi,

    Generally, it should work. However, for large projects, the profiler can sometimes have unintended side effects (e.g. causing stack to overflow due to requiring some extra stack space).

    You can troubleshoot it as follows:

    1. Try to instrument as little functions as possible. If it stops the problem from happening, some of the profiled functions might me manipulating the stack directly, or otherwise interfering with the profiler. You can narrow it down by instrumenting half of the functions at a time and seeing which half breaks.
    2. Try checking the functions shown in the profiler window, or the variable values inside the profiler framework. Sometimes, it points to an obvious location that causes the problem (typically, a function manipulating the stack).

    You can also try using the new Software Tracing introduced in VisualGDB 6.0. It is much less intrusive, can record the ARM cycle count each time the given line (or function) gets executed, so you can get precise timing on the function or even line level, and export it to Excel for a detailed analysis.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.