Real-time watch problems

Sysprogs forums Forums VisualGDB Real-time watch problems

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #10208
    holo
    Participant

    I’m currently trying to evaluate VisualGDB for use with STM32 microcontrollers and i’m using a Nucleo 64 board with the L073RZ variant chip.

    So far i’ve got live variables and live profiling working, however i’m having real issues with getting the real-time watch to work.

    I’m trying to duplicate the blinking LED example at https://sysprogs.com/w/introducing-the-new-real-time-watch/ but I am finding the real-time watch window simply does not update with anything (it’s either blank or shows ‘No calls were recorded for this funciton yet’).  The LED blinks but i’m not getting anything in the watch window.

    I’ve tried multiple times and have also read http://visualgdb.com/tutorials/profiler/realtime/usb/ to see if that can help me find the issue.

    I’m using VisualGDB 5.2 (build 1357) with Visual Studio Community 2015.

     

    Please can you help me try to fix this as it’s one of the main features I wanted to evaluate.

    #10212
    support
    Keymaster

    Hi,

    No problem. Based on your description, this could be caused by one of the following:

    • The functions are not instrumented properly
    • The call time information is not properly received by VisualGDB
    • Your chip does not support tracing instruction times

    You can do a quick check whether the instruction cycle counter works by running the following code from main():

    #define DWT_CYCCNT (*((unsigned *)0xE0001004))
    #define DWT_CTRL (*((unsigned *)0xE0001000))
    #define COREDEBUG_DEMCR (*((unsigned *)0xe000edfc))

    COREDEBUG_DEMCR |= 0x01000000;
    DWT_CTRL = 1;
    DWT_CYCCNT = 0;
    asm(“nop”);
    int result = DWT_CYCCNT;

    If result is 0, your CPU does not support the instruction cycle counter and the profiler framework will need a minor adjustment to run on that CPU (we can provide details).

    If it works, please check if the custom real-time watch events work. If yes, the problem is related to function instrumentation.

    Please let us know your findings so that we can help you further.

    #10218
    holo
    Participant

    Hi, thanks for the quick response.

    I’ve run the code you provided and the result is 0.  I’ve also waded through the Arm V6-M architecture reference manual and the registers you reference don’t seem to be implemented for these chips – the whole of the cortex M0, M0+ and M1 range!

    Hopefully you are able to get it working – what is the minor adjustment required?

    #10282
    support
    Keymaster

    Hi,

    Sorry for the delayed reply. We have reviewed the process of making a custom cycle counter driver for real-time watch and profiler and published a detailed tutorial here: https://visualgdb.com/tutorials/profiler/realtime/cyclecnt/

    Let us know if you encounter any troubles with it.

    We also recommend updating your profiler package via VisualGDB Package Manager and using the latest pre-release build of VisualGDB: http://sysprogs.com/files/tmp/VisualGDB-5.2.14.1374.msi

    #10304
    holo
    Participant

    Thanks that’s really awesome you’ve added the features to support this.

    I have however had quite a few troubles getting it to work and am still having some issues if you can help:

    1.  I uninstalled the old version and installed 5.2R8 as required however it did not give me the “Use custom performance counter function” checkbox.  After a long while of trying to get it to work anyway I found adding “SYSPROGS_PROFILER_USE_DWT_CYCLE_COUNTER=0” to the preprocessor macros made it work and it started reporting.
    2. I had the error “multiple definitions of TIM3_IRQHandler” which was because “SAMPLING_PROFILER_TIMER_INSTANCE” was defined to use TIM3 also.  I can’t remember if I changed this to 3 in the old install but I thought as a new install it should probably work with your tutorial without needing any modifications?
    3. The “ReportTicksPerSecond()” function does not seem to exist anywhere so I am now stuck at this point in the tutorial and cannot get it to report the correct time periods.

    Hope you can help resolve points 1 and 3 for me.

    #10307
    support
    Keymaster

    Hi,

    The options shown in the tutorial were added to the new profiler package released just before 5.2R8. Please install it via Tools->VisualGDB Package Manager->Updates.

    The new package also adds an option to exclude the sampling profiler code, so you won’t need to modify the code anymore.

    #10312
    holo
    Participant

    Ok that’s great, it’s all working now it’s updated properly.  Thanks for you help!

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