Sysprogs forums › Forums › VisualGDB › Chronometer for Xtensa LX Processors does not work
Tagged: Chronometer, esp32, LX Processors, visualgdb, Xtensa
- This topic has 5 replies, 2 voices, and was last updated 1 year ago by support.
-
AuthorPosts
-
November 1, 2023 at 09:46 #34905Aloysius_PendergastParticipant
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
November 1, 2023 at 09:50 #34906supportKeymasterHi,
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.
November 1, 2023 at 11:54 #34912Aloysius_PendergastParticipantHello 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.November 1, 2023 at 19:25 #34916supportKeymasterHi,
Sorry, had a typo in the path. The correct path to DWT.xml would be C:\Program Files (x86)\Sysprogs\VisualGDB\TimestampProviders\DWT.xml.
November 2, 2023 at 04:03 #34917Aloysius_PendergastParticipantHello 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
November 2, 2023 at 21:17 #34918supportKeymasterHi,
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:
- 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.
- 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.
-
AuthorPosts
- You must be logged in to reply to this topic.