This is a demo to develop a DLL which parses data, received via either: - Raw STPv1. (MIPI System Trace Protocol Version 1) - Raw STPv2. (MIPI System Trace Protocol Version 2) - CoreSight ITM. (CoreSight Instrumentation Trace Macrocell output via a CoreSight TPIU in CONTINUOUS mode) - CoreSight STM. (CoreSight System Trace Macroceall output via a CoreSight TPIU in CONTINUOUS mode) The source code might be compiled by Visual Studio, by opening a "Visual Studio Command Prompt" and then executing nmake -f makefile.vs Object files and executables will be put under the sub-directory: - "vs32\" for 32-bit builds - "vs64\" for 64-bit builds As an alternative, the source code also might also be compiled: - By first installing MinGW: http://heanet.dl.sourceforge.net/project/mingw/Installer/mingw-get-inst/mingw-get-inst-20111118/mingw-get-inst-20111118.exe Specifically installing MinGW C/C++ compilers + MSYS (to get GNU Make). - Then by calling in a DOS/WINDOWS command shell (cmd.exe): SET PATH=C:\MinGW\bin;C:\WINDOWS mingw32-make -f makeall.mingw32 Object files and executables will be put under the sub-directory "mingw32\" - Note: With MinGW currently only 32-bit Builds are supported. For LINUX you might use make -f makefile.linux The "stpv1_raw.bin" file contains fake data, similar to what you will receive via a raw STPv1 Port. The data was created with the program vs32\create_fake_tpiu.exe The fake data contained here was specifically created with vs32\create_fake_tpiu.exe stpv1_raw.bin 1000 0 STP version 0, will create STPv1 output. The "stp_raw.bin" file contains fake data, similar to what you will receive via a raw STPv2 Port. The data was created with the program vs32\create_fake_tpiu.exe The fake data contained here was specifically created with vs32\create_fake_tpiu.exe stp_raw.bin 1000 0x03 Bits 3..0 of the STP version (here 0x3) define the STPv2 Timestamp Format used. The "tpiu.bin" file contains fake data, similar to what you might receive via a TPIU in CONTINUOUS mode. The data contains trace streams from three ATB (Advanced Trace Bus) sources: - the source with ATBID 4 fakes CoreSight STM data, - the source with ATBID 5 fakes CoreSight ITM data, - the source with ATBID 6 is a byte wide up counter All three trace streams are wrapped and output via CoreSight TPIU Formatter protocol. The fake data contained here was specifically created with vs32\create_fake_tpiu.exe stp_raw.bin 1000 0x13 0x10 in the 2nd parameter tells the program to create three streams of ATB data wrapped via CoreSight TPIU Formatter protocol. ************************************* * Display and inspect fake data * ************************************* To load and inspect the data contained in the "stp_raw.bin" file: - Start t32marm.exe (from the "t32simulator" directory). - ChangeDir to the directory where the "load_stp.cmm" is located (with "cd ..") - Call do load_stp.cmm from the TRACE32 command line. Here is the start of the STPv2 decoding you should see: _record|tp______|cycle__|address________|data____________|stpv2ts +000047| +000048|0 null +000049|0 null +000050|F VERS 03 +000051|0 +000052| +000053| +000054| +000055| +000056|0 +000057|3 +000058|0 null +000059|0 null +000060| +000061| +000062| +000063| +000064|1 M8 C:00000000 01 +000065|0 +000066|1 +000067|3 C8 C:00010081 81 +000068| +000069| +000070| +000071| +000072|8 +000073|1 +000074|4 D8 C:00010081 83 +000075|8 +000076| +000077| rec column : Record number tp column : Raw 4-bit nibbles cycle, address, data, stpv2ts columns: Decoded STPv2 data. Note: The address encodes master and channel. Bit 31..16 encode the master, Bit 15..0 encode the channel. ************************************* * Push Fake Data through DLL * ************************************* To start the DLL demo: - Start t32marm.exe (from the "t32simulator" directory). - ChangeDir to the directory where the "dll_demo.cmm" is located ("cd ..") - Call do dll_stp_demo.cmm from the TRACE32 command line. The demo does the following via PIPE_LogCycle PIPE_LogCustom +-------------------------------+ v | stp_raw.bin --> t32marm.exe ---> vs/stm_print.dll --+ | pipe_read.exe <--------------------+ via Named Pipe The "stm_print.dll" takes the decoded data produced by "t32marm", turns the data into descriptive text (so ascii text) and outputs this text via a named pipe to the "pipe_read.exe" application. Additionally the DLL will use PIPE_LogCycle and PIPE_LogCustom to feed decoded data to t32marm.exe. This data can be displayed by CAnalyzer.CustomTrace.STMPRINT.List and CAnalyzer.CustomTrace.STMPRINT.ListString The "pipe_read.exe" application, which will run in a DOS command shell window, will output the received text. To unload the DLL (which will also close the window with the "pipe_read.exe" application) use CAnalyzer.PipePROTO (or ca.pproto for short) ***************************************** * STPv1 data * ***************************************** STPv1 data can be used in the same manner, by running the scripts - load_stpv1.cmm to load and display STPv1 data - dll_stpv1_demo.cmm to push STPv1 data through the "stpv1_print.dll" ***************************************** * CoreSight ITM and CoreSight STM data * ***************************************** CoreSight ITM and CoreSight STM data can be used in the same manner, by running the scripts - load_itm.cmm to load and display ITM data - load_csstm.cmm to load and display STM data - dll_itm_demo.cmm to push the data through the "itm_print.dll" - dll_csstm_demo.cmm to push CoreSight STM data through the "stm_print.dll" Note: The same DLL is used for STPv2 / CoreSight STM, because the encoding is compatible. (CoreSight STM uses MIPI STPv2 encoding). Only the manner in which the data is output differs, because with CoreSight, the data will be wrapped in TPIU Formatter protocol.