Marus / cortex-debug

Visual Studio Code extension for enhancing debug capabilities for Cortex-M Microcontrollers
MIT License
975 stars 236 forks source link

Graphing utility similar to Segger's Ozone (timeline view) #1004

Open geoffdudds opened 4 months ago

geoffdudds commented 4 months ago

Is your feature request related to a problem? Please describe. I find that the current mechanism for graphing has too much friction. If I understand correctly, there is configuration on both cortex-debug side and firmware side (eg via RTT) in order to get data onto a graph. So, adding a new signal to a graph requires reconfiguration in cortex-debug, firmware changes, and a recompile/flash.

Instead, I end up using Segger's Ozone for graphing. I can add an expression at any time to add it to the graph. No configuring or recompiling. It somehow does not need firmware changes at all to support (maybe because we are using the Trace pins?). However, Ozone is not compatible with dev containers (plus I much prefer using the cortex-debug debugger).

Describe the solution you'd like I would love to have a graphing window where I can add expressions with corresponding sample frequency without reconfiguration in launch.json or recompiling firmware. With this, I could move entirely to cortex-debug.

Describe alternatives you've considered Currently, I download the elf file from my dev container to my windows environment and run Ozone. We (another team member) also tried printing to file via RTT and graphing with python. Neither of the above are great solutions...

Additional context Here is a screenshot of Ozone's "Timeline" view for reference: image

diggit commented 2 months ago

I believe there are two parts to this problem/feature.

fast data reading

Ozone is using J-Link HSS to get the data as fast as possible. Periodic readout is offloaded to J-Link probe itself. Necessary symbols are present in libjlinkarm (linux)

JLINK_HSS_GetCaps
JLINK_HSS_Read
JLINK_HSS_Start
JLINK_HSS_Stop

So some custom SW could be able to utilize this feature (good candidate to add this is e.g. pylink). J-link GDB server does not seem to expose this feature. In the end doable, but not so easy and external tools dependent.

plotting

We now have live data readout (several Hz, maybe more) so adding an option to plot them makes sense. This should be purely about code of this extension.