freertos trace probe - mcu on eclipse · freertos trace probe martin bucher, prof. erich styger...
TRANSCRIPT
S4D - System, Software, SoC and Silicon Debug Conference
FreeRTOS Trace Probe
Martin Bucher, Prof. Erich Styger
[email protected], [email protected] University of Applied Sciences and Arts
September 26, 2011
1 / 16
Topics
FreeRTOS and Trace Hooks
Embedded Components
Approach with Embedded Components
Results and Conclusions
2 / 16
FreeRTOS and Trace Hooks
FreeRTOS: www.freertos.orgLGPL, 27+ architectures, 17+ tool chainsBuilt in trace hooks (task create, delete, switch, ...)Trace hooks require user implementation (both target andevaluation)
RTOSwith hooks
Probe tocollectmsg
Host tovisualize
hook msg
trace data
3 / 16
Embedded Component
Software Encapsulation
C-like scripting language
Uses Code Generation
Properties, Events, Methods and Inheritance
Embedded Component
Properties
Events
Methods
4 / 16
Approach
Extend existing FreeRTOS Embedded Component
Create new Embedded Component: TraceHooks
Re-use existing Embedded Components as trace channels
Build hardware reference system
Visualize on host system
5 / 16
Trace Flow
Instrumented RTOS with Trace Hooks
Channel used to get trace of the target
FreeRTOS probe collects trace
Host used to visualize data
Target Application
FreeRTOS
Trace Channel
FreeRTOS Probe
Firmware
Host
Visualization
6 / 16
Extended FreeRTOS Embedded Component
Enabling/Disabling Hookfunctionality
Selection of Interface
FreeRTOS remainscompatible
7 / 16
Inheritance
Seamless Integration
Inheritance (private member)
FreeRTOS inherits from FreeRTOSTrace
Interface accessible within FreeRTOS
8 / 16
Trace Hook Selection
Enabling/Disabling HooksSelection of channel
Console/Terminal (SCI)I2CSPICAN
9 / 16
Trace Message Format
Uncompressed data and message format
Prebyte followed by ID, data and end marker
Prebyte with ID used as ’start’ marker
SCI/57600: 57 bytes/10 ms
I2C: 420 bytes/10 ms
99
Start
10-43
ID
Data
4-10 Bytes
98
End
10 / 16
Probe Reference Implementation
Freescale Tower BoardsMCF52259 ColdFire V2Serial, Ethernet, USBTouch screen LCD (optional user interface)
11 / 16
Optional FreeRTOS Tower Card
Tower Card Bus (PCI Expresssockets)
SD card socket to store dataRealtime Clock
Time stamp informationBattery buffered
Level shiftersBit I/O3.3V5.0V
12 / 16
FreeRTOS Firmware
Firmware built withEmbedded Components
Running FreeRTOS
FatFS as file system
13 / 16
Offline Trace Data Viewer on Host
Implemented in Java
Load Trace Data File stored on SD card
Selection of trace event labels
14 / 16
Trace Viewer
JFreeChart WidgetConfigurable MarkersDummy Trace for non-task items
15 / 16
Summary
Simplified Trace Hook usage in FreeRTOS
Re-using existing components
SCI/Serial connection: 7 hooks per 10 ms
I2C: reasonable 25-30 hooks
Protocol needs compression for higher speed
Host trace viewer very limited
Low cost open source trace hard- and software
16 / 16