Update the FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator demo to use the latest FreeRTOS+Trace recorder code.

This commit is contained in:
Richard Barry
2017-05-29 22:05:25 +00:00
parent 35f5990e7a
commit 504d9c8bab
9 changed files with 598 additions and 491 deletions

View File

@ -74,9 +74,6 @@
/* FreeRTOS+CLI includes. */
#include "FreeRTOS_CLI.h"
/* FreeRTOS+Trace includes. */
#include "trcUser.h"
/*
* Writes trace data to a disk file when the trace recording is stopped.
* This function will simply overwrite any trace files that already exist.

View File

@ -86,7 +86,7 @@
#define configUSE_PREEMPTION 1
#define configUSE_IDLE_HOOK 1
#define configUSE_TICK_HOOK 1
#define configUSE_TICK_HOOK 0
#define configTICK_RATE_HZ ( 1000 ) /* In this non-real time simulated environment the tick frequency has to be at least a multiple of the Win32 tick frequency, and therefore very slow. */
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 60 ) /* In this simulated case, the stack only has to hold one small structure as the real stack is part of the Win32 thread. */
#define configTOTAL_HEAP_SIZE ( ( size_t ) 0 ) /* This parameter has no effect when heap_3.c is included in the project. */
@ -132,7 +132,7 @@ to exclude the API function. */
/* This demo makes use of one or more example stats formatting functions. These
format the raw data provided by the uxTaskGetSystemState() function in to human
readable ASCII form. See the notes in the implementation of vTaskList() within
readable ASCII form. See the notes in the implementation of vTaskList() within
FreeRTOS/Source/tasks.c for limitations. */
#define configUSE_STATS_FORMATTING_FUNCTIONS 1
@ -161,8 +161,6 @@ take up unnecessary RAM. */
/* Include the FreeRTOS+Trace FreeRTOS trace macro definitions. */
#define TRACE_ENTER_CRITICAL_SECTION() portENTER_CRITICAL()
#define TRACE_EXIT_CRITICAL_SECTION() portEXIT_CRITICAL()
#include "trcKernelPort.h"
#include "trcRecorder.h"
#endif /* FREERTOS_CONFIG_H */

View File

@ -1,7 +1,9 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual C++ Express 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WIN32", "WIN32.vcxproj", "{C686325E-3261-42F7-AEB1-DDE5280E1CEB}"
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RTOSDemo", "WIN32.vcxproj", "{C686325E-3261-42F7-AEB1-DDE5280E1CEB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution

View File

@ -82,9 +82,6 @@
/* FreeRTOS includes. */
#include <FreeRTOS.h>
/* FreeRTOS+Trace includes. */
#include "trcUser.h"
/* Variables used in the creation of the run time stats time base. Run time
stats record how much time each task spends in the Running state. */
static long long llInitialRunTimeCounterValue = 0LL, llTicksPerHundedthMillisecond = 0LL;

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
@ -19,11 +19,13 @@
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
@ -135,11 +137,9 @@
<ClCompile Include="..\..\..\FreeRTOS\Source\tasks.c" />
<ClCompile Include="..\..\..\FreeRTOS\Source\timers.c" />
<ClCompile Include="..\..\Source\FreeRTOS-Plus-CLI\FreeRTOS_CLI.c" />
<ClCompile Include="..\..\Source\FreeRTOS-Plus-Trace\trcBase.c" />
<ClCompile Include="..\..\Source\FreeRTOS-Plus-Trace\trcHardwarePort.c" />
<ClCompile Include="..\..\Source\FreeRTOS-Plus-Trace\trcKernel.c" />
<ClCompile Include="..\..\Source\FreeRTOS-Plus-Trace\trcKernelPort.c" />
<ClCompile Include="..\..\Source\FreeRTOS-Plus-Trace\trcUser.c" />
<ClCompile Include="..\..\Source\FreeRTOS-Plus-Trace\trcSnapshotRecorder.c" />
<ClCompile Include="..\..\Source\FreeRTOS-Plus-Trace\trcStreamingRecorder.c" />
<ClCompile Include="CLI-commands.c" />
<ClCompile Include="main.c">
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@ -150,13 +150,9 @@
<ClCompile Include="UDPCommandServer.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\Source\FreeRTOS-Plus-Trace\Include\trcBase.h" />
<ClInclude Include="..\..\Source\FreeRTOS-Plus-Trace\Include\trcKernel.h" />
<ClInclude Include="..\..\Source\FreeRTOS-Plus-Trace\Include\trcKernelPort.h" />
<ClInclude Include="..\..\Source\FreeRTOS-Plus-Trace\Include\trcTypes.h" />
<ClInclude Include="..\..\Source\FreeRTOS-Plus-Trace\Include\trcUser.h" />
<ClInclude Include="FreeRTOSConfig.h" />
<ClInclude Include="Trace_Recorder_Configuration\trcConfig.h" />
<ClInclude Include="Trace_Recorder_Configuration\trcSnapshotConfig.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">

View File

@ -25,9 +25,6 @@
<Filter Include="FreeRTOS+\FreeRTOS+Trace">
<UniqueIdentifier>{629e761f-e8a8-430e-b44e-f38d83292b54}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS+Trace\Include">
<UniqueIdentifier>{e17028e8-51ed-45af-8aa4-22ade709b3fb}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS\Configuration Files">
<UniqueIdentifier>{19ff1a34-36de-4c48-9d10-3fb1fa0d1fa4}</UniqueIdentifier>
<Extensions>
@ -74,21 +71,15 @@
<ClCompile Include="..\..\Source\FreeRTOS-Plus-CLI\FreeRTOS_CLI.c">
<Filter>FreeRTOS+\FreeRTOS+CLI</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\FreeRTOS-Plus-Trace\trcUser.c">
<Filter>FreeRTOS+\FreeRTOS+Trace</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\FreeRTOS-Plus-Trace\trcBase.c">
<Filter>FreeRTOS+\FreeRTOS+Trace</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\FreeRTOS-Plus-Trace\trcKernel.c">
<Filter>FreeRTOS+\FreeRTOS+Trace</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\FreeRTOS-Plus-Trace\trcHardwarePort.c">
<Filter>FreeRTOS+\FreeRTOS+Trace</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\FreeRTOS-Plus-Trace\trcKernelPort.c">
<Filter>FreeRTOS+\FreeRTOS+Trace</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\FreeRTOS-Plus-Trace\trcSnapshotRecorder.c">
<Filter>FreeRTOS+\FreeRTOS+Trace</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\FreeRTOS-Plus-Trace\trcStreamingRecorder.c">
<Filter>FreeRTOS+\FreeRTOS+Trace</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="FreeRTOSConfig.h">
@ -97,20 +88,8 @@
<ClInclude Include="Trace_Recorder_Configuration\trcConfig.h">
<Filter>Demo App Source\Trace Recorder Configuration</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\FreeRTOS-Plus-Trace\Include\trcUser.h">
<Filter>FreeRTOS+\FreeRTOS+Trace\Include</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\FreeRTOS-Plus-Trace\Include\trcBase.h">
<Filter>FreeRTOS+\FreeRTOS+Trace\Include</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\FreeRTOS-Plus-Trace\Include\trcKernel.h">
<Filter>FreeRTOS+\FreeRTOS+Trace\Include</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\FreeRTOS-Plus-Trace\Include\trcTypes.h">
<Filter>FreeRTOS+\FreeRTOS+Trace\Include</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\FreeRTOS-Plus-Trace\Include\trcKernelPort.h">
<Filter>FreeRTOS+\FreeRTOS+Trace\Include</Filter>
<ClInclude Include="Trace_Recorder_Configuration\trcSnapshotConfig.h">
<Filter>Demo App Source\Trace Recorder Configuration</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@ -121,9 +121,6 @@
#include "task.h"
#include "queue.h"
/* FreeRTOS+Trace includes. */
#include "trcUser.h"
/* Priorities at which the tasks are created. */
#define mainQUEUE_RECEIVE_TASK_PRIORITY ( tskIDLE_PRIORITY + 2 )
#define mainQUEUE_SEND_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 )
@ -161,12 +158,6 @@ extern void vRegisterCLICommands( void );
/* The queue used by both tasks. */
static xQueueHandle xQueue = NULL;
/* The user trace event posted to the trace recording on each tick interrupt.
Note tick events will not appear in the trace recording with regular period
because this project runs in a Windows simulator, and does not therefore
exhibit deterministic behaviour. */
traceLabel xTickTraceUserEvent;
/*-----------------------------------------------------------*/
int main( void )
@ -175,8 +166,7 @@ const uint32_t ulLongTime_ms = 250UL;
/* Initialise the trace recorder and create the label used to post user
events to the trace recording on each tick interrupt. */
vTraceInitTraceData();
xTickTraceUserEvent = xTraceOpenLabel( "tick" );
vTraceEnable( TRC_START );
/* Create the queue used to pass messages from the queue send task to the
queue receive task. */
@ -210,7 +200,7 @@ const uint32_t ulLongTime_ms = 250UL;
line will never be reached. If the following line does execute, then
there was insufficient FreeRTOS heap memory available for the idle and/or
timer tasks to be created. See the memory management section on the
FreeRTOS web site for more details (this is standard text that is not not
FreeRTOS web site for more details (this is standard text that is not
really applicable to the Win32 simulator port). */
for( ;; )
{
@ -295,12 +285,4 @@ const unsigned long ulLongSleep = 1000UL;
}
/*-----------------------------------------------------------*/
void vApplicationTickHook( void )
{
/* Write a user event to the trace log.
Note tick events will not appear in the trace recording with regular period
because this project runs in a Windows simulator, and does not therefore
exhibit deterministic behaviour. */
vTraceUserEvent( xTickTraceUserEvent );
}