2021-06-21 05:16 AM
Dear All,
I would like to make a snapshot of CPU registers (SFRs) when a program is paused.
Ideally the snapshot would be a textfile.
Does anyone know whether this is possible in CubeIDE or via some other tool?
Thank you
Matej
2021-06-21 06:40 AM
You can take a screenshot. Don't think it's possible otherwise.
2021-06-21 10:40 PM
Hi,
thanks for the reply. Yeah, I've been using screenshots but I was hoping
that some way of getting a text export is hidden somewhere ;).
Cheers
2021-06-28 06:35 AM
Hi @MMici.1,
The idea has been discussed internally before. We have a ticket for this. The idea would be as you said to be able to select a bunch of peripherals that are monitored. Each time we suspend execution or make a step we read these SFRs and write to a log-file.
You could run two different debug session and then compare the log-files to see different IP behavior. Could be very useful when comparing firmware revisions...
Please elaborate on the use cases that you are trying to address so that we can get a more complete view with your feedback.
Anyone else that think the feature would be interesting, please give the post a like.
Internal ticket reference #96205
2021-06-29 12:39 AM
Hi Mattias,
we've had a bit more complex FW problems where it wasn't immediately obvious what is causing the issue. As a part of the debug process we check some of the registers to compare their contents during normal vs fault state. Doing this by comparing screenshots or notes can be quite time consuming (and sometimes error-prone) even for few registers. Comparing all the registers like this is totally impractical and even though I realize this wouldn't be a panacea and there would be caveats, I'm sure we would use it. Having the ability to just use standard 'diff' feature on two text documents would not only simplify and speed up the whole task (and possibly debug) but also be beneficial for documentation.
This feature would be appreciated.
2021-06-29 01:25 AM
I don't use Eclipse, but I'd be surprised if there would be no gdb console built in.
JW
2021-06-29 04:37 PM
@MMici.1 So why not just write some instrumentation yourself?
Write a function that reads the interesting registers and dumps to UART, or even saves to memory and compares with previous copy?
Execute this whenever you like.
2021-06-29 09:43 PM
Hi, thanks for the idea.
2021-06-29 10:32 PM
Ok, I assume you mean instrumentation as in code in the DUT that would read registers and send them via UART (or save in DUT memory).
A possibility but not a good way for us. Such a function would already affect some of the registers and we don't necessarily want to add code to a FW when we are looking for a bug. Given that the device already has debug capabilities and they allow breakpoints and reading out the registers this would be sort of going backwards.
Still thanks for replying.
2021-06-29 10:35 PM
Thanks for the idea.