Debug issues with SWV in STM32 target

Discuss how to use the features of Atollic TrueSTUDIO, including the editor, assembler, C/C++ compiler, linker, debugger, static code analysis and team collaboration tools.

Moderators: Markus Girdland, Mattias Norlander

josan
Posts: 2
Joined: Mon Jan 07, 2019 11:19 am

Debug issues with SWV in STM32 target

Postby josan » Mon Jan 07, 2019 12:06 pm

Using Atollic Truestudio 9.1.0 with STM32F4Discovery platform, STM32F407VG MCU, and upgraded firmware from ST-Link to J-Link, I try to follow SWV/ITM guides you provide to trace a code no RTOS without success.
Initially debugger appears connected, after throws an error, and finally appears again connected:

Connecting to J-Link...
J-Link is connected.
Firmware: J-Link STLink V2 compiled Jun 26 2017 10:34:41
Hardware: V1.00
S/N: 774184609
Checking target voltage...
Target voltage: 3.30 V
Listening on TCP/IP port 2331
Connecting to target...ERROR: Debugger tries to select target interface JTAG.
This interface is not supported by the connected emulator.
Selection will be ignored by the DLL.

J-Link found 1 JTAG device, Total IRLen = 4
JTAG ID: 0x2BA01477 (Cortex-M4)
Connected to target
Waiting for GDB connection...Connected to 127.0.0.1
Reading all registers
Read 4 bytes @ address 0x080083BC (Data = 0xBF00BD08)
Connected to 127.0.0.1


Setting record of a global variable and enabling ITM port 0 console throws some verify fails:

Received monitor command: reset
Resetting target
Read 2 bytes @ address 0x08007738 (Data = 0xB530)
Setting breakpoint @ address 0x08007738, Size = 2, BPHandle = 0x0001
Setting breakpoint @ address 0x080077CE, Size = 2, BPHandle = 0x0002
Starting target CPU...
...Breakpoint reached @ address 0x08007738
Reading all registers
Read 4 bytes @ address 0x08007738 (Data = 0xB08DB530)
Removing breakpoint @ address 0x08007738, Size = 2
Removing breakpoint @ address 0x080077CE, Size = 2
Setting breakpoint @ address 0x080077CE, Size = 2, BPHandle = 0x0003
Starting target CPU...
...Breakpoint reached @ address 0x080077CE
Reading all registers
Read 4 bytes @ address 0x080077CE (Data = 0xFFF7F7FE)
Removing breakpoint @ address 0x080077CE, Size = 2
Read 4 bytes @ address 0xE0042004 (Data = 0x00000027)
Downloading 4 bytes @ address 0xE000EDFC - Verified OK
Downloading 4 bytes @ address 0xE0042004 - Verified OK
Downloading 4 bytes @ address 0xE00400F0 - Verified OK
Downloading 4 bytes @ address 0xE0040010 - Verified OK
Downloading 4 bytes @ address 0xE0000FB0 - Verify failed
Downloading 4 bytes @ address 0xE0000E80 - Verified OK
Downloading 4 bytes @ address 0xE0000E40 - Verified OK
Downloading 4 bytes @ address 0xE0000E00 - Verified OK
Downloading 4 bytes @ address 0xE0001020 - Verified OK
Downloading 4 bytes @ address 0xE0001024 - Verified OK
Downloading 4 bytes @ address 0xE0001028 - Verified OK
Downloading 4 bytes @ address 0xE0001030 - Verified OK
Downloading 4 bytes @ address 0xE0001040 - Verified OK
Downloading 4 bytes @ address 0xE0001050 - Verified OK
Downloading 4 bytes @ address 0xE0001060 - Verified OK
Downloading 4 bytes @ address 0xE0001000 - Verify failed
Downloading 4 bytes @ address 0xE0040304 - Verify failed
Performing single step...


And not records any trace neither messages on SWV Console or SWV Data Trace.

Any suggest of problem?
Also it would be of help more details about configure correctly trace parameters in debug configurations.
Thanks in advance.

Markus Girdland
Posts: 146
Joined: Thu May 11, 2017 11:27 am

Re: Debug issues with SWV in STM32 target

Postby Markus Girdland » Mon Jan 07, 2019 12:11 pm

The most common problem is that the SWO clock is not set correctly.
Give a uint_32 variable the value of SystemCoreClock to make sure your debug configuration is set up correctly.

Also, there's a lot of useful information that might help you figure out what's wrong in our user guide.
If you go to Infortmation center -> User Guide in the IDE you'll find it. The passage about swv is on page 284.

josan
Posts: 2
Joined: Mon Jan 07, 2019 11:19 am

Re: Debug issues with SWV in STM32 target

Postby josan » Mon Jan 07, 2019 6:48 pm

Thank you for the response, I am trying now you suggest.
Now another question in the wake of user guide: is it better or similar using SWV with ST-Link or update firmware to J-Link as I have done?
Also, the information center appears to me corrupted when I have updated to 9.2.0, it superposed the info from previous 9.1.0.
Thanks again

Markus Girdland
Posts: 146
Joined: Thu May 11, 2017 11:27 am

Re: Debug issues with SWV in STM32 target

Postby Markus Girdland » Wed Jan 09, 2019 9:34 am

I'm no expert on the differences or similarities between the two.
I'm sure there are some but for the most part it's pretty similar in my opinion.

If you can't open the information center you can still find the user guide here:
http://gotland.atollic.com/resources/ma ... _Guide.pdf


Return to “Atollic TrueSTUDIO tool discussions”

Who is online

Users browsing this forum: No registered users and 1 guest