Chronometer for Xtensa LX Processors does not work

Sysprogs forums Forums VisualGDB Chronometer for Xtensa LX Processors does not work

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #34905
    Aloysius_Pendergast
    Participant

    I try to used the chronometer feature whilst debugging an ESP32 Unit. But the chronometer doesn’t count anything. In the setup it wasn’t possible to change the entry “ARM Cortex Cycle Counter” to any other options. Only Tics per second could e changed. Is there any possibility to use the chrono function with other cores than the Cortex?

    Thanks

    #34906
    support
    Keymaster

    Hi,

    This is correct. The chronometer relies on the DWT_CYCCNT register, that is only available on ARM Cortex cores.

    The Xtensa cores have a similar register called CYCCNT, so you can try copying the %VISUALGDB_DIR%\DWT.xml file under a new name and changing it to use the Xtensa CYCCNT address, but we have not tested it on our side and cannot guarantee that it will work.

    #34912
    Aloysius_Pendergast
    Participant

    Hello and thanks for the fast reply,

    I couldn’t identify a register named CYCCNT,. But there exist a CPU-Register named CCOUNT, and this is increased every processor-clock cycle. This is also described in the Xtensa ISA Manual. And I would like to try it out. But I can not find the DWD.xml file. Is it located in the Project / Build directory or in the root of the VisualGDB plugin installation location. But where it is located on the windows OS? Do you have hint for me?

    Attachments:
    You must be logged in to view attached files.
    #34916
    support
    Keymaster

    Hi,

    Sorry, had a typo in the path. The correct path to DWT.xml would be C:\Program Files (x86)\Sysprogs\VisualGDB\TimestampProviders\DWT.xml.

    #34917
    Aloysius_Pendergast
    Participant

    Hello and thanks, I found it. But the file is not commented. And for me it is absolutely unclear how it could be possible  to get the value direct from the CPU-Register. The CCOUNT seems not to be mapped in the memory. Of curse  there must be way to do this, because GDB is displaying the CCOUNT value in the watching window. But how I should realize it with changes in the file DWT.xml? I consider to buy the custom version of VGDB if this feature would work. But how? Exist a detailed documentation  of the way I can do it by configuring  the DWT-file?

    Thanks & Regards

     

    #34918
    support
    Keymaster

    Hi,

    Based on a quick look, the CCOUNT is indeed not mapped to memory, so reading it would involve patching the ESP32 OpenOCD to allow reading it via special command.

    If you would like to get it working, we can offer 2 options:

    1. You can try convincing Espressif to add an OpenOCD monitor command for reading CCOUNT (it should be runnable via gdb), or implementing it yourself. If you can get it working, we can help you configure VisualGDB to use it, as long as you have an active VisualGDB license.
    2. If we see sufficient interest in this feature from other paid users, or if someone orders it as a custom feature, we can do the OpenOCD patching on our side. If you would like to get a quote for this as a custom feature, feel free to contact us via the support form.

     

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