Changes

Jump to: navigation, search
Advanced debugging techniques for AMP Linux+FreeRTOS configuration
No instrumentation is needed in the kernel source code for debugging with Lauterbach, but it’s important that the vmlinux file is generated from the same kernel build as the zImage or uImage running on the system.
The Data.LOAD command is used to load the kernel symbols, and the sYmbol.SourcePATH command can be used, if necessary, to define additional search directories for the source files. The Data.LOAD command for vmlinux is applied to &core0, so that symbol information is not shared with the other TRACE32 application.
[[File:AN-BELK-001_12.jpgpng|600px|thumb|center]]
Specific options must be configured to avoid automatic Break of TRACE32 debugger, in case any of the following events happens due to normal Linux operations.
TrOnchip.Set UNDEF OFF ; may be used by Linux for FPU detection
where the virtual address range is the virtual-to-physical kernel address mapping, according with results of command MMU.List KernelPageTable, executed when the kernel is up and running.
In the command TRANSlation.COMMON, the virtual address
[[File:AN-BELK-001_13.jpgpng|600px|thumb|center]]
range has been extended below the kernel start address, because kernel objects are loaded in this memory range.
4.5.3 Debugging of kernel modules
The Linux kernel can be compiled to allow linking of additional modules at runtime (kernel objects). The Lauterbach debuggers also support kernel modules debugging, starting from the initialization function.
[[File:AN-BELK-001_14.jpgpng|600px|thumb|center]]
====Debugging of user processes, threads, shared objects====
User process debugging is also available, starting from the very beginning of the process. If the process loads shared objects, they are loaded in the process address space when the related instructions are executed for the first time (demand paging).
SYStem.Option MMUspaces ON
The memory addressing is extended using the lower 16 bit of the process PID, allowing in this way to distinguish between equal virtual addresses for different processes.
[[File:AN-BELK-001_15.jpgpng|600px|thumb|center]]===Setting up the FreeRTOS debug configuration===A similar kernel awareness concept as Linux, is provided by Lauterbach for many other RTOS. Among the others, also FreeRTOS is supported with the following awareness configuration.; load FreeRTOS awareness&core1 TASK.CONFIG ~~/demo/arm/kernel/freertos/freertos.t32; load FreeRTOS menu&core1 MENU.ReProgram~~/demo/arm/kernel/freertos/freertos.menThe FreeRTOS kernel awareness is loaded into the second TRACE32 application, and will not affect the first one.As of symbol information it’s enough to load the proper symbol file, redirecting the Data.LOAD command to &core1. In this way, the second TRACE32 application will have visibility of FreeRTOS HLL debug info.The FreeRTOS menu file (freertos.men) includes useful menu items developed for the TRACE32 GUI to ease FreeRTOS debugging. For more details, please refer to “RTOS debugger for FreeRTOS” manual (rtos_freertos.pdf).===Onchip trace===The Zynq chip implements the ETB (Embedded Trace Buffer), a CoreSight hardware component providing on-chip trace functionality. The ETB stores program-flow trace information on-chip at high rates and at 32-bit data width. The data can be read out via JTAG, when the trace recording has ended.This trace method is enabled in TRACE32 with the following commands, respectively performed on each GUIs of AMP configuration:Trace.METHOD Onchip ; select the ETB as source ; for the trace informationThe TRACE32 menu item “Trace ? Configuration” allows a full control of configuration, initialization and listing of trace information.The trace, recorded for each core by each AMP TRACE32 GUI, can be synchronized using the XTRACK feature of TRACE32. In this way, an easy comparison is possible of program flow of each core at the same time.The XTRACK feature is enabled with the following commands:&core0 Synch.XTRACK localhost:&intercomport_core1&core1 Synch.XTRACK localhost:&intercomport_core0Each trace window will follow the time / record synchronization of other trace windows, if the option /Track is used.The following images show Linux onchip trace XTRACKED vs FreeRTOS onchip trace:[[File:AN-BELK-001_16.png|600px|thumb|center]][[File:AN-BELK-001_17.png|600px|thumb|center]]For further details, please refer to “Training Real-time Trace” manual (training_trace.pdf).===Summary view===In the pictures below, all the concepts previously discussed are shown as a summary global view of TRACE32 debugger, respectively for Zynq core 0 running a Linux kernel, and Zynq core 1 running a FreeRTOS based application.[[File:AN-BELK-001_17.png|600px|thumb|center|Linux at Zynq core 0]][[File:AN-BELK-001_18.png|600px|thumb|center|FreeRTOS at Zynq core 1]]===Lauterbach References===This chapter has been written by Lauterbach italian branch office. Contact information: Lauterbach SRL Via Enzo Ferrieri 12 20153 Milan (Italy) Tel. +39 02 45490282 Email info_it@lauterbach.it Web www.lauterbach.it
== Related documents and additional resources ==
4,650
edits

Navigation menu