FreeRTOS Trace Probe - MCU on Eclipse · FreeRTOS Trace Probe Martin Bucher, Prof. Erich Styger...
Transcript of FreeRTOS Trace Probe - MCU on Eclipse · FreeRTOS Trace Probe Martin Bucher, Prof. Erich Styger...
![Page 1: FreeRTOS Trace Probe - MCU on Eclipse · FreeRTOS Trace Probe Martin Bucher, Prof. Erich Styger martin.bucher@stud.hslu.ch, erich.styger@hslu.ch Lucerne University of Applied Sciences](https://reader035.fdocuments.net/reader035/viewer/2022063017/5fd77c779c35130a5f50cadf/html5/thumbnails/1.jpg)
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
![Page 2: FreeRTOS Trace Probe - MCU on Eclipse · FreeRTOS Trace Probe Martin Bucher, Prof. Erich Styger martin.bucher@stud.hslu.ch, erich.styger@hslu.ch Lucerne University of Applied Sciences](https://reader035.fdocuments.net/reader035/viewer/2022063017/5fd77c779c35130a5f50cadf/html5/thumbnails/2.jpg)
Topics
FreeRTOS and Trace Hooks
Embedded Components
Approach with Embedded Components
Results and Conclusions
2 / 16
![Page 3: FreeRTOS Trace Probe - MCU on Eclipse · FreeRTOS Trace Probe Martin Bucher, Prof. Erich Styger martin.bucher@stud.hslu.ch, erich.styger@hslu.ch Lucerne University of Applied Sciences](https://reader035.fdocuments.net/reader035/viewer/2022063017/5fd77c779c35130a5f50cadf/html5/thumbnails/3.jpg)
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
![Page 4: FreeRTOS Trace Probe - MCU on Eclipse · FreeRTOS Trace Probe Martin Bucher, Prof. Erich Styger martin.bucher@stud.hslu.ch, erich.styger@hslu.ch Lucerne University of Applied Sciences](https://reader035.fdocuments.net/reader035/viewer/2022063017/5fd77c779c35130a5f50cadf/html5/thumbnails/4.jpg)
Embedded Component
Software Encapsulation
C-like scripting language
Uses Code Generation
Properties, Events, Methods and Inheritance
Embedded Component
Properties
Events
Methods
4 / 16
![Page 5: FreeRTOS Trace Probe - MCU on Eclipse · FreeRTOS Trace Probe Martin Bucher, Prof. Erich Styger martin.bucher@stud.hslu.ch, erich.styger@hslu.ch Lucerne University of Applied Sciences](https://reader035.fdocuments.net/reader035/viewer/2022063017/5fd77c779c35130a5f50cadf/html5/thumbnails/5.jpg)
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
![Page 6: FreeRTOS Trace Probe - MCU on Eclipse · FreeRTOS Trace Probe Martin Bucher, Prof. Erich Styger martin.bucher@stud.hslu.ch, erich.styger@hslu.ch Lucerne University of Applied Sciences](https://reader035.fdocuments.net/reader035/viewer/2022063017/5fd77c779c35130a5f50cadf/html5/thumbnails/6.jpg)
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
![Page 7: FreeRTOS Trace Probe - MCU on Eclipse · FreeRTOS Trace Probe Martin Bucher, Prof. Erich Styger martin.bucher@stud.hslu.ch, erich.styger@hslu.ch Lucerne University of Applied Sciences](https://reader035.fdocuments.net/reader035/viewer/2022063017/5fd77c779c35130a5f50cadf/html5/thumbnails/7.jpg)
Extended FreeRTOS Embedded Component
Enabling/Disabling Hookfunctionality
Selection of Interface
FreeRTOS remainscompatible
7 / 16
![Page 8: FreeRTOS Trace Probe - MCU on Eclipse · FreeRTOS Trace Probe Martin Bucher, Prof. Erich Styger martin.bucher@stud.hslu.ch, erich.styger@hslu.ch Lucerne University of Applied Sciences](https://reader035.fdocuments.net/reader035/viewer/2022063017/5fd77c779c35130a5f50cadf/html5/thumbnails/8.jpg)
Inheritance
Seamless Integration
Inheritance (private member)
FreeRTOS inherits from FreeRTOSTrace
Interface accessible within FreeRTOS
8 / 16
![Page 9: FreeRTOS Trace Probe - MCU on Eclipse · FreeRTOS Trace Probe Martin Bucher, Prof. Erich Styger martin.bucher@stud.hslu.ch, erich.styger@hslu.ch Lucerne University of Applied Sciences](https://reader035.fdocuments.net/reader035/viewer/2022063017/5fd77c779c35130a5f50cadf/html5/thumbnails/9.jpg)
Trace Hook Selection
Enabling/Disabling HooksSelection of channel
Console/Terminal (SCI)I2CSPICAN
9 / 16
![Page 10: FreeRTOS Trace Probe - MCU on Eclipse · FreeRTOS Trace Probe Martin Bucher, Prof. Erich Styger martin.bucher@stud.hslu.ch, erich.styger@hslu.ch Lucerne University of Applied Sciences](https://reader035.fdocuments.net/reader035/viewer/2022063017/5fd77c779c35130a5f50cadf/html5/thumbnails/10.jpg)
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
![Page 11: FreeRTOS Trace Probe - MCU on Eclipse · FreeRTOS Trace Probe Martin Bucher, Prof. Erich Styger martin.bucher@stud.hslu.ch, erich.styger@hslu.ch Lucerne University of Applied Sciences](https://reader035.fdocuments.net/reader035/viewer/2022063017/5fd77c779c35130a5f50cadf/html5/thumbnails/11.jpg)
Probe Reference Implementation
Freescale Tower BoardsMCF52259 ColdFire V2Serial, Ethernet, USBTouch screen LCD (optional user interface)
11 / 16
![Page 12: FreeRTOS Trace Probe - MCU on Eclipse · FreeRTOS Trace Probe Martin Bucher, Prof. Erich Styger martin.bucher@stud.hslu.ch, erich.styger@hslu.ch Lucerne University of Applied Sciences](https://reader035.fdocuments.net/reader035/viewer/2022063017/5fd77c779c35130a5f50cadf/html5/thumbnails/12.jpg)
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
![Page 13: FreeRTOS Trace Probe - MCU on Eclipse · FreeRTOS Trace Probe Martin Bucher, Prof. Erich Styger martin.bucher@stud.hslu.ch, erich.styger@hslu.ch Lucerne University of Applied Sciences](https://reader035.fdocuments.net/reader035/viewer/2022063017/5fd77c779c35130a5f50cadf/html5/thumbnails/13.jpg)
FreeRTOS Firmware
Firmware built withEmbedded Components
Running FreeRTOS
FatFS as file system
13 / 16
![Page 14: FreeRTOS Trace Probe - MCU on Eclipse · FreeRTOS Trace Probe Martin Bucher, Prof. Erich Styger martin.bucher@stud.hslu.ch, erich.styger@hslu.ch Lucerne University of Applied Sciences](https://reader035.fdocuments.net/reader035/viewer/2022063017/5fd77c779c35130a5f50cadf/html5/thumbnails/14.jpg)
Offline Trace Data Viewer on Host
Implemented in Java
Load Trace Data File stored on SD card
Selection of trace event labels
14 / 16
![Page 15: FreeRTOS Trace Probe - MCU on Eclipse · FreeRTOS Trace Probe Martin Bucher, Prof. Erich Styger martin.bucher@stud.hslu.ch, erich.styger@hslu.ch Lucerne University of Applied Sciences](https://reader035.fdocuments.net/reader035/viewer/2022063017/5fd77c779c35130a5f50cadf/html5/thumbnails/15.jpg)
Trace Viewer
JFreeChart WidgetConfigurable MarkersDummy Trace for non-task items
15 / 16
![Page 16: FreeRTOS Trace Probe - MCU on Eclipse · FreeRTOS Trace Probe Martin Bucher, Prof. Erich Styger martin.bucher@stud.hslu.ch, erich.styger@hslu.ch Lucerne University of Applied Sciences](https://reader035.fdocuments.net/reader035/viewer/2022063017/5fd77c779c35130a5f50cadf/html5/thumbnails/16.jpg)
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