Sysprogs forums › Forums › VisualGDB › Live Tracing on STM32H753ZI with VisualGDB
- This topic has 11 replies, 2 voices, and was last updated 2 days, 4 hours ago by
fergus.dixon@pacom.com.
-
AuthorPosts
-
May 13, 2025 at 19:32 #36653
fergus.dixon@pacom.com
ParticipantWe have a tricky problem which looks like it needs some tracing. In VisualGDB Properties, I turned Software tracing on and selected a function to trace. All good so far. The debugger had to be restarted and now a cryptic debugging failed message issues. Any help would be much appreciated.
-
This topic was modified 3 weeks ago by
fergus.dixon@pacom.com.
-
This topic was modified 3 weeks ago by
fergus.dixon@pacom.com.
Attachments:
You must be logged in to view attached files.May 13, 2025 at 19:47 #36659support
KeymasterHi,
Sorry, this looks like the ELF file you are trying to trace contains some non-standard relocation records, so VisualGDB won’t know how to patch it. We can update VisualGDB to dump the exact address of the relocation record so you could try to adjust the code to avoid it, but it may turn out that there are multiple similar records with no easy fix.
May 13, 2025 at 19:56 #36660fergus.dixon@pacom.com
ParticipantWe are using a bin file not an elf file. It looks like the relocation is caused by the live tracing. I searched the code for relocate and can only find standard code.
Attachments:
You must be logged in to view attached files.May 13, 2025 at 19:58 #36662support
KeymasterSorry, that wouldn’t work. You need an ELF file built with relocation records and full debugging symbols.
May 13, 2025 at 20:37 #36664fergus.dixon@pacom.com
ParticipantThanks for the reply. Would hex files also work? There is no easy way I can see for gcc to make an elf file.
May 14, 2025 at 15:35 #36666fergus.dixon@pacom.com
ParticipantQuick update. I managed to fix the issue which was caused by the command buffer having an extra zero in the array and a length of 1. Resetting the buffer fixes the issue but there is still the question of how this random byte is getting set which is where a trace would be great. I will ask the team if anyone knows how to make an elf file from the arm compiler and come back here to report how it goes with an elf file. Thanks again for the help.
-
This reply was modified 2 weeks, 6 days ago by
fergus.dixon@pacom.com.
May 26, 2025 at 00:15 #36676fergus.dixon@pacom.com
ParticipantAnother update. The issue is still there, and I really need to use the Trace function. I have turned off the bin output file and now the arm GCC compiler generates an elf file. However Visual GDB does not seem to be able to find the file even though it is present in the output folder:
stm32-h7.elf: No such file or directory.
-
This reply was modified 1 week, 2 days ago by
fergus.dixon@pacom.com.
May 27, 2025 at 12:06 #36682support
KeymasterThe ELF file should be generated even if the bin file generation is enabled.
The last error looks like you somehow managed to break the project while attempting to get tracing to work.
If nothing works, please try creating a new simple project for the same device from scratch, and verify that tracing works there. If it does, please try comparing the current project layout against the test project layout, to see if there are any differences that could be interfering.
May 29, 2025 at 01:04 #36686fergus.dixon@pacom.com
ParticipantOK, thanks. It looks like an elf file is always generated by gcc.
I did try to load a smaller project and it seems to work. It asked a question about relocating records which I didn’t get on the main project. I will keep trying. Thanks for the info.
May 29, 2025 at 19:14 #36689fergus.dixon@pacom.com
ParticipantWith the trace, now that it is working, how do you view the last 1000 lines of code executed? I see that you can add tracepoint events but a trace is when you stop the code and view previous execution.
For example, I am pretty sure another service is coming in and interrupting the code which is why data is going missing. I am not sure how many services we have running but it would in the hundreds so impossible to find without a trace function.
May 29, 2025 at 19:29 #36690support
KeymasterThese are two different tracing techniques. To view the last 1000 running lines of code, you would need to use separate J-Trace hardware and have the trace pins properly routed on the board (see this tutorial). Software trace works differently: it patches specific code locations to generate software trace events (ultimately, just write data to a buffer that VisualGDB will decode). So, you would need to think how the program is structured, what code could preempt the main thread, and put tracepoints there to reconstruct what is going on.
June 2, 2025 at 01:00 #36691fergus.dixon@pacom.com
ParticipantGreat thanks for the info. The next question was going to be “What is the Hardware tracing for?”
So, to summarize, Software tracing is a cutdown tracing utility which can be useful if you are very smart, otherwise the Segger J-Trace Pro is the way to go but cost $4k or so.
-
This topic was modified 3 weeks ago by
-
AuthorPosts
- You must be logged in to reply to this topic.