]> git.sur5r.net Git - freertos/blob - FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/debugger trace upload.txt
Update to latest FreeRTOS+Trace recorder code.
[freertos] / FreeRTOS-Plus / Source / FreeRTOS-Plus-Trace / debugger trace upload.txt
1 \r
2 Tracealyzer - Uploading the trace data\r
3 -----------------------------------------\r
4 Percepio AB, Nov. 8, 2012\r
5 \r
6 This document decribes how to upload the trace data from the target system to\r
7 Tracealyzer. \r
8 \r
9 Tracealyzer uses your existing debugger to upload the trace data from the \r
10 chip RAM. This is a plain RAM dump, that is done whenever you want to look at \r
11 the trace buffer contents. This means it works with essentially with any debug \r
12 probe on the market.\r
13 \r
14 If the device has a file system and some possibility of accessing this file \r
15 system from the development PC, it is also possible to write the recorder data\r
16 to a file, using vTraceGetTraceBuffer() and uiTraceGetTraceBufferSize() \r
17 found in trcUser.h/.c.\r
18 \r
19 Note that hardware-generated trace is not required (or used by) Tracealyzer. \r
20 We however plan to add support for that in future versions of Tracealyzer \r
21 and other Tracealyzer products.\r
22 \r
23 Built-in support for Segger J-Link/J-Trace and Atmel SAM-ICE\r
24 ------------------------------------------------------------\r
25 Tracealyzer v2.3 supports Segger J-Link and J-Link compatible debuggers \r
26 directly, without any debugger IDE involved. Using other debug probes is \r
27 also possible, but requires some extra steps, described below.\r
28 \r
29 If you have a Segger J-Link/J-Trace debug probe or another J-Link compatible \r
30 debug probe, just select \r
31 \r
32     "File" menu -> "Upload from <debug probe name>". \r
33 \r
34 This opens a dialog where you get to enter the memory region where\r
35 the recorder data structure is located. Normally you select the entire \r
36 internal RAM according to the datasheet of your MCU, but the exact address\r
37 can be found can by inspecting the "RecorderData" struct or the \r
38 "RecorderDataPtr" pointer with your debugger.\r
39 \r
40 Typical values are 0x0, 0x10000000 or 0x20000000 as start address\r
41 and 0x10000 or 0x20000 as size (64 KB or 128 KB).\r
42 \r
43 This makes Tracealyzer reads the chip RAM and locate the trace data. \r
44 Note that this option is only available if a compatible debug probe is found.\r
45 \r
46 J-Link compatible debug probes also include Atmel SAM-ICE and many built-in \r
47 debug interfaces on demonstration/evaluation boards (where there is a USB \r
48 connection directly to the board). Look for a Segger J-Link label on the board.\r
49 \r
50 MemoryLogger extension in Atmel Studio 6\r
51 ----------------------------------------\r
52 Atmel's new MemoryLogger extension provides a superb integration with\r
53 Tracealyzer. Look for "MemoryLogger" in Atmel Gallery, available in \r
54 Atmel Studio and at the Atmel website.\r
55 \r
56 This extension automatically detects the path to Tracealyzer, if \r
57 installed, and gives you a single-click upload/refresh. You can use it \r
58 while debugging and optionally get an automatic refresh eash time the \r
59 MCU is halted, e.g., on each breakpoint.\r
60 \r
61 Using other development environments and debug probes\r
62 -----------------------------------------------------\r
63 Most debuggers are able to save the RAM contents to a file. Tracealyzer \r
64 supports the following common formats:\r
65 - Binary (.bin), supporting gdb, J-Link and Renesas HEW.\r
66 - Intel Hex (.hex), supporting IAR Embedded Workbench and Atmel Studio (atprogram.exe)\r
67 - MCH (.mch), supporting Microchip MPLAB.\r
68 \r
69 When you store the RAM dump, you must also make sure to select the right region, \r
70 i.e., start address and size. The recorder data is stored in a single data \r
71 block, identified by the pointer RecorderDataPtr. \r
72 It is not necessary to match the begin and end of the recorder data, as long as \r
73 it is fully included by the dumped memory region. Tracealyzer automatically \r
74 finds the trace data in the RAM dump, thanks to special signatures. For chips \r
75 with on-chip RAM only, we therefore recommend to dump the entire RAM. This is \r
76 usually very fast.\r
77 For chips with larger amounts of (external) RAM, it is typically possible to \r
78 dump a limited region where the data is typically found.\r
79 \r
80 Using IAR Embedded Workbench for ARM, version 6.3\r
81 -------------------------------------------------\r
82 In the debugger view, when stopped on a breakpoint:\r
83 - Select "Debug" menu, "Memory" submenu, "Save..." (keyboard shortcut: ALT,d,y,s)\r
84 - In the Save dialog\r
85         - Zone: Memory\r
86         - Start Adress: 10000000 (for NXP LPC1766 in the demo project)\r
87         - End Adress: 1000FFFF (for NXP LPC1766 in the demo project)\r
88         - File format: Intel Extended\r
89         - Filename: <name>.hex\r
90         - Press "Save" button\r
91 You can now open <name>.hex in Tracealyzer.\r
92 \r
93 To find the right Start and End addresses, check the address of the symbol \r
94 "RecorderData". The addresses does not need to match this symbol exactly, as \r
95 long as the whole data is included.\r
96 \r
97 Using Renesas High-performance Embedded Workshop v4.09\r
98 ------------------------------------------------------\r
99 In the debugger view, when stopped on a breakpoint:\r
100 - Select "Debug" menu, "Save Memory..." (keyboard shortcut: ALT,d,a)\r
101 - In the Save dialog\r
102         - Format: Binary\r
103         - Filename: <name>.bin\r
104         - Start Address: 00000000 (For RX62N in the demo project)\r
105         - End Address: 0000FFFF (For RX62N in the demo project)\r
106         - Access size: 1\r
107         - Press "Save" button and open <name>.bin in Tracealyzer.\r
108         \r
109 Using Microchip MPLAB v8.86\r
110 ------------------------------------------------------\r
111 - Select "View" -> "File Registers". This shows you the memory contents.\r
112 - Make sure "Hex" is selected in the bottom left (instead of "Symbolic"). Hex mode seems to be default.\r
113 - Right click in the view and select "Export Table...".\r
114 - In the dialog ("Export As"), make sure "Single Column Output" is selected (seems to be default).\r
115 - Select start address 0x0000 and make sure the end address is beyond the RecorderData structure. \r
116   The default values seems to be the whole RAM, so you probably don't need to change this.\r
117 - Save as a .mch file and open this file in Tracealyzer v2.2.4 or later (support for the .mch format was added in v2.2.4).\r
118 \r
119 Using STM32 ST-Link\r
120 ------------------------------------------------------\r
121 - Start "ST-Link Utility"\r
122 - Connect to the device and view the device memory.\r
123 - Set the view to display the entire RAM, or at least the section containing the RecorderData structure.\r
124 - Select "Save as" and choose binary (.bin) or Intel Hex (.hex) format.\r
125 - Open the resulting file in Tracealyzer.\r
126 \r
127 In case you have any question, contact support@percepio.com\r
128 \r
129 Percepio AB\r
130 www.percepio.com\r