doc: renamed project
This commit is contained in:
committed by
Sylvan Arnold
parent
244e516bd8
commit
32618389d1
36
pico-sensor/McuLib/TraceRecorder/License_PercepioTrace.txt
Normal file
36
pico-sensor/McuLib/TraceRecorder/License_PercepioTrace.txt
Normal file
@@ -0,0 +1,36 @@
|
||||
/*******************************************************************************
|
||||
* Tracealyzer v2.5.0 Recorder Library
|
||||
* Percepio AB, www.percepio.com
|
||||
*
|
||||
* trcKernelPort.c
|
||||
*
|
||||
* Kernel-specific functionality for FreeRTOS, used by the recorder library.
|
||||
*
|
||||
* Terms of Use
|
||||
* This software is copyright Percepio AB. The recorder library is free for
|
||||
* use together with Percepio products. You may distribute the recorder library
|
||||
* in its original form, including modifications in trcHardwarePort.c/.h
|
||||
* given that these modification are clearly marked as your own modifications
|
||||
* and documented in the initial comment section of these source files.
|
||||
* This software is the intellectual property of Percepio AB and may not be
|
||||
* sold or in other ways commercially redistributed without explicit written
|
||||
* permission by Percepio AB.
|
||||
*
|
||||
* Disclaimer
|
||||
* The trace tool and recorder library is being delivered to you AS IS and
|
||||
* Percepio AB makes no warranty as to its use or performance. Percepio AB does
|
||||
* not and cannot warrant the performance or results you may obtain by using the
|
||||
* software or documentation. Percepio AB make no warranties, express or
|
||||
* implied, as to noninfringement of third party rights, merchantability, or
|
||||
* fitness for any particular purpose. In no event will Percepio AB, its
|
||||
* technology partners, or distributors be liable to you for any consequential,
|
||||
* incidental or special damages, including any lost profits or lost savings,
|
||||
* even if a representative of Percepio AB has been advised of the possibility
|
||||
* of such damages, or for any claim by any third party. Some jurisdictions do
|
||||
* not allow the exclusion or limitation of incidental, consequential or special
|
||||
* damages, or the exclusion of implied warranties or limitations on how long an
|
||||
* implied warranty may last, so the above limitations may not apply to you.
|
||||
*
|
||||
* Copyright Percepio AB, 2013.
|
||||
* www.percepio.com
|
||||
******************************************************************************/
|
||||
625
pico-sensor/McuLib/TraceRecorder/McuPercepio.c
Normal file
625
pico-sensor/McuLib/TraceRecorder/McuPercepio.c
Normal file
@@ -0,0 +1,625 @@
|
||||
/* ###################################################################
|
||||
** This component module is generated by Processor Expert. Do not modify it.
|
||||
** Filename : McuPercepio.h
|
||||
** Project : FRDM-K64F_Generator
|
||||
** Processor : MK64FN1M0VLL12
|
||||
** Component : PercepioTrace
|
||||
** Version : Component 01.140, Driver 01.00, CPU db: 3.00.000
|
||||
** Compiler : GNU C Compiler
|
||||
** Date/Time : 2020-11-28, 10:44, # CodeGen: 717
|
||||
** Abstract :
|
||||
**
|
||||
** Settings :
|
||||
** Component name : McuPercepio
|
||||
** RTOS+Trace Version : V4.4.1
|
||||
** Recorder Mode : Streaming
|
||||
** Recorder Buffer Allocation : static
|
||||
** Max ISR Nesting : 16
|
||||
** Snapshot Mode :
|
||||
** Recorder store mode : Ring Buffer
|
||||
** Scheduling only : no
|
||||
** Description string : FreeRTOS+Trace
|
||||
** Description max length : 80
|
||||
** Event buffer size : 1200
|
||||
** Symbol table size : 400
|
||||
** Objects :
|
||||
** Number of tasks : 10
|
||||
** Name length for task : configMAX_TASK_NAME_LEN
|
||||
** Number of ISR : 4
|
||||
** Number of queue : 3
|
||||
** Number of semaphore : 4
|
||||
** Number of mutex : 4
|
||||
** Number of timer : 2
|
||||
** Number of event groups : 2
|
||||
** Name length for ISR : 10
|
||||
** Name length for queue : 15
|
||||
** Name length for semaphore : 15
|
||||
** Name length for mutex : 15
|
||||
** Name length for timer : 15
|
||||
** Name length for event group : 15
|
||||
** Events Creation :
|
||||
** Include OS Tick events : no
|
||||
** Include ready events : yes
|
||||
** Include memory manager events : no
|
||||
** Include ISR tracing : yes
|
||||
** Include object delete events : yes
|
||||
** Include user events : yes
|
||||
** Heap Size below 16M : no
|
||||
** Float support : no
|
||||
** Use implicit IFE rules : yes
|
||||
** Use 16bit Object Handles : no
|
||||
** Segger RTT : Enabled
|
||||
** Segger RTT : McuRTT
|
||||
** Streaming Mode :
|
||||
** Up Buffer Index : 2
|
||||
** Up Buffer Size : 1024
|
||||
** Down Buffer Index : 2
|
||||
** Down Buffer Size : 32
|
||||
** Symbol Table Slots : 30
|
||||
** Symbol Max Length : 24
|
||||
** Object Data Slots : 20
|
||||
** Ctrl Task Priority : 1
|
||||
** Ctrl Task Stack Size : configMINIMAL_STACK_SIZE
|
||||
** Ctrl Task Delay : ((10 * configTICK_RATE_HZ) / 1000)
|
||||
** Source Folders : Enabled
|
||||
** Recorder : TraceRecorder
|
||||
** Config : TraceRecorder/config
|
||||
** Include : TraceRecorder/include
|
||||
** RTT Include : TraceRecorder/streamports/Jlink_RTT/include
|
||||
** System :
|
||||
** SDK : McuLib
|
||||
** Utility : McuUtility
|
||||
** Contents :
|
||||
** vTraceEnable - void McuPercepio_vTraceEnable(int startOption);
|
||||
** uiTraceStart - dword McuPercepio_uiTraceStart(void);
|
||||
** vTraceStop - void McuPercepio_vTraceStop(void);
|
||||
** vTraceClear - void McuPercepio_vTraceClear(void);
|
||||
** uiTraceGetTraceBufferSize - dword McuPercepio_uiTraceGetTraceBufferSize(void);
|
||||
** xTraceGetTraceBuffer - void* McuPercepio_xTraceGetTraceBuffer(void);
|
||||
** xTraceRegisterString - traceString McuPercepio_xTraceRegisterString(const char* name);
|
||||
** vTracePrint - void McuPercepio_vTracePrint(traceString chn, const char* str);
|
||||
** vTracePrintF - void McuPercepio_vTracePrintF(traceLabel eventLabel, char *formatStr, ...);
|
||||
** vTraceSetQueueName - void McuPercepio_vTraceSetQueueName(void *queue, char *name);
|
||||
** vTraceSetSemaphoreName - void McuPercepio_vTraceSetSemaphoreName(void *semaphore, char *name);
|
||||
** vTraceSetMutexName - void McuPercepio_vTraceSetMutexName(void *mutex, char *name);
|
||||
** xTraceSetISRProperties - traceHandle McuPercepio_xTraceSetISRProperties(char *name, char prioritiy);
|
||||
** vTraceStoreISRBegin - void McuPercepio_vTraceStoreISRBegin(traceHandle handle);
|
||||
** vTraceStoreISREnd - void McuPercepio_vTraceStoreISREnd(int isTaskSwitchRequired);
|
||||
** vGetGDBDumpCommand - void McuPercepio_vGetGDBDumpCommand(uint8_t *buf, uint16_t bufSize, uint8_t...
|
||||
** vTraceSetStopHook - void McuPercepio_vTraceSetStopHook(TRACE_STOP_HOOK stopHookFunction);
|
||||
** xTraceGetLastError - char* McuPercepio_xTraceGetLastError(void);
|
||||
** vTraceClearError - byte McuPercepio_vTraceClearError(int resetErrorMessage);
|
||||
** Startup - void McuPercepio_Startup(void);
|
||||
**
|
||||
** * (c) Copyright Percepio AB, 2013-2020
|
||||
** * http : www.percepio.se
|
||||
** * mail : info@percepio.com
|
||||
** * See separate Percepio licensing terms.
|
||||
** *
|
||||
** * Processor Expert Component: (c) Copyright Erich Styger, 2013-2020
|
||||
** * Web: https://mcuoneclipse.com
|
||||
** * SourceForge: https://sourceforge.net/projects/mcuoneclipse
|
||||
** * Git: https://github.com/ErichStyger/McuOnEclipse_PEx
|
||||
** * All rights reserved.
|
||||
** *
|
||||
** * Redistribution and use in source and binary forms, with or without modification,
|
||||
** * are permitted provided that the following conditions are met:
|
||||
** *
|
||||
** * - Redistributions of source code must retain the above copyright notice, this list
|
||||
** * of conditions and the following disclaimer.
|
||||
** *
|
||||
** * - Redistributions in binary form must reproduce the above copyright notice, this
|
||||
** * list of conditions and the following disclaimer in the documentation and/or
|
||||
** * other materials provided with the distribution.
|
||||
** *
|
||||
** * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
** * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
** * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
** * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
** * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
** * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
** * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
** * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
** * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
** * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
** ###################################################################*/
|
||||
/*!
|
||||
** @file McuPercepio.h
|
||||
** @version 01.00
|
||||
** @brief
|
||||
**
|
||||
*/
|
||||
/*!
|
||||
** @addtogroup McuPercepio_module McuPercepio module documentation
|
||||
** @{
|
||||
*/
|
||||
|
||||
/* MODULE McuPercepio. */
|
||||
#include "McuPercepio.h"
|
||||
#if McuLib_CONFIG_SDK_VERSION_USED == McuLib_CONFIG_SDK_PROCESSOR_EXPERT
|
||||
#include "Events.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
** ===================================================================
|
||||
** Method : uiTraceGetTraceBufferSize (component PercepioTrace)
|
||||
**
|
||||
** Description :
|
||||
** Gets the size of the recorder data structure. For use
|
||||
** together with vTraceGetTraceBuffer if you wish to implement
|
||||
** an own store/upload solution, e.g., in case a debugger
|
||||
** connection is not available for uploading the data.
|
||||
** Parameters : None
|
||||
** Returns :
|
||||
** --- - Size of the trace buffer
|
||||
** ===================================================================
|
||||
*/
|
||||
/*
|
||||
dword McuPercepio_uiTraceGetTraceBufferSize(void)
|
||||
{
|
||||
*** Implemented as macro in the header file
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
** ===================================================================
|
||||
** Method : xTraceGetTraceBuffer (component PercepioTrace)
|
||||
**
|
||||
** Description :
|
||||
** Return a pointer to the recorder data structure. Use this
|
||||
** together with uiTraceGetTraceBufferSize if you wish to
|
||||
** implement an own store/upload solution, e.g., in case a
|
||||
** debugger connection is not available for uploading the data.
|
||||
** Parameters : None
|
||||
** Returns :
|
||||
** --- - Pointer to the trace buffer
|
||||
** ===================================================================
|
||||
*/
|
||||
/*
|
||||
void* McuPercepio_xTraceGetTraceBuffer(void)
|
||||
{
|
||||
*** Implemented as macro in the header file
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
** ===================================================================
|
||||
** Method : uiTraceStart (component PercepioTrace)
|
||||
**
|
||||
** Description :
|
||||
** Starts the trace.
|
||||
** Parameters : None
|
||||
** Returns :
|
||||
** --- - returns 1 if trace has been started, 0
|
||||
** otherwise.
|
||||
** ===================================================================
|
||||
*/
|
||||
/*
|
||||
dword McuPercepio_uiTraceStart(void)
|
||||
{
|
||||
*** Implemented as macro in the header file
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
** ===================================================================
|
||||
** Method : vTraceStop (component PercepioTrace)
|
||||
**
|
||||
** Description :
|
||||
** Stops the trace.
|
||||
** Parameters : None
|
||||
** Returns : Nothing
|
||||
** ===================================================================
|
||||
*/
|
||||
/*
|
||||
void McuPercepio_vTraceStop(void)
|
||||
{
|
||||
*** Implemented as macro in the header file
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
** ===================================================================
|
||||
** Method : vTraceClear (component PercepioTrace)
|
||||
**
|
||||
** Description :
|
||||
** Clears the trace.
|
||||
** Parameters : None
|
||||
** Returns : Nothing
|
||||
** ===================================================================
|
||||
*/
|
||||
/*
|
||||
void McuPercepio_vTraceClear(void)
|
||||
{
|
||||
*** Implemented as macro in the header file
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
** ===================================================================
|
||||
** Method : xTraceRegisterString (component PercepioTrace)
|
||||
**
|
||||
** Description :
|
||||
** Register strings in the recorder, e.g. for names of user
|
||||
** event channels.
|
||||
** Parameters :
|
||||
** NAME - DESCRIPTION
|
||||
** * name - Pointer to label
|
||||
** Returns :
|
||||
** --- - trace label to be used with vTracePrintF
|
||||
** ===================================================================
|
||||
*/
|
||||
/*
|
||||
traceString McuPercepio_xTraceRegisterString(const char* name)
|
||||
{
|
||||
*** Implemented as macro in the header file
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
** ===================================================================
|
||||
** Method : vTracePrint (component PercepioTrace)
|
||||
**
|
||||
** Description :
|
||||
** Generates a User Event with a text label. The label is
|
||||
** created/looked up in the symbol table using
|
||||
** xTraceRegisterString.
|
||||
** Parameters :
|
||||
** NAME - DESCRIPTION
|
||||
** chn - trace label for the user event
|
||||
** * str - Pointer to string
|
||||
** Returns : Nothing
|
||||
** ===================================================================
|
||||
*/
|
||||
/*
|
||||
void McuPercepio_vTracePrint(traceString chn, const char* str)
|
||||
{
|
||||
*** Implemented as macro in the header file
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
** ===================================================================
|
||||
** Method : vTracePrintF (component PercepioTrace)
|
||||
**
|
||||
** Description :
|
||||
** Advanced user event - like printf (but limited formatting
|
||||
** support - will improve)
|
||||
** Parameters :
|
||||
** NAME - DESCRIPTION
|
||||
** eventLabel - trace label
|
||||
** * formatStr - Pointer to format string
|
||||
** Variable_1 - open parameter list
|
||||
** Returns : Nothing
|
||||
** ===================================================================
|
||||
*/
|
||||
/*
|
||||
void McuPercepio_vTracePrintF(traceLabel eventLabel, char *formatStr, ...)
|
||||
{
|
||||
*** Implemented as macro in the header file
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
** ===================================================================
|
||||
** Method : vTraceSetQueueName (component PercepioTrace)
|
||||
**
|
||||
** Description :
|
||||
** Assigns a name to a FreeRTOS Queue, Semaphore or Mutex. This
|
||||
** function should be called right after creation of the
|
||||
** queue/mutex/semaphore. If not using this function, the
|
||||
** queues/mutexes/semaphores will be presented by their numeric
|
||||
** handle only.
|
||||
** Parameters :
|
||||
** NAME - DESCRIPTION
|
||||
** * queue - Pointer to the queue
|
||||
** * name - Pointer to name
|
||||
** Returns : Nothing
|
||||
** ===================================================================
|
||||
*/
|
||||
/*
|
||||
void McuPercepio_vTraceSetQueueName(void *queue, char *name)
|
||||
{
|
||||
*** Implemented as macro in the header file
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
** ===================================================================
|
||||
** Method : xTraceSetISRProperties (component PercepioTrace)
|
||||
**
|
||||
** Description :
|
||||
** Registers an Interrupt Service Routine in the recorder
|
||||
** library, This must be called before using
|
||||
** vTraceStoreISRBegin to store ISR events. This is typically
|
||||
** called in the startup of the system, before the scheduler is
|
||||
** started. Method is always enabled if 'Include ISR tracing'
|
||||
** is set to 'yes' in the properties.
|
||||
** Parameters :
|
||||
** NAME - DESCRIPTION
|
||||
** * name - Pointer to name
|
||||
** prioritiy - priority
|
||||
** Returns :
|
||||
** --- - trace handle to be used for
|
||||
** vTaceStoreISRBegin()
|
||||
** ===================================================================
|
||||
*/
|
||||
/*
|
||||
traceHandle McuPercepio_xTraceSetISRProperties(char *name, char prioritiy)
|
||||
{
|
||||
*** Implemented as macro in the header file
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
** ===================================================================
|
||||
** Method : vTraceStoreISRBegin (component PercepioTrace)
|
||||
**
|
||||
** Description :
|
||||
** Registers the beginning of an Interrupt Service Routine.
|
||||
** This must not be interrupted by another ISR containing
|
||||
** recorder library calls, so if allowing nested ISRs this must
|
||||
** be called with interrupts disabled. Method is always
|
||||
** enabled if 'Include ISR tracing' is set to 'yes' in the
|
||||
** properties.
|
||||
** Parameters :
|
||||
** NAME - DESCRIPTION
|
||||
** handle - trace handle
|
||||
** Returns : Nothing
|
||||
** ===================================================================
|
||||
*/
|
||||
/*
|
||||
void McuPercepio_vTraceStoreISRBegin(traceHandle handle)
|
||||
{
|
||||
*** Implemented as macro in the header file
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
** ===================================================================
|
||||
** Method : vTraceStoreISREnd (component PercepioTrace)
|
||||
**
|
||||
** Description :
|
||||
** Registers the end of an Interrupt Service Routine. This must
|
||||
** not be interrupted by another ISR containing recorder
|
||||
** library calls, so if allowing nested ISRs this must be
|
||||
** called with interrupts disabled. Method is always enabled
|
||||
** if 'Include ISR tracing' is set to 'yes' in the properties.
|
||||
** Parameters :
|
||||
** NAME - DESCRIPTION
|
||||
** isTaskSwitchRequired - The
|
||||
** parameter pendingISR indicates if the
|
||||
** interrupt has requested a task-switch (= 1)
|
||||
** or if the interrupt returns to the earlier
|
||||
** context (= 0)
|
||||
** Returns : Nothing
|
||||
** ===================================================================
|
||||
*/
|
||||
/*
|
||||
void McuPercepio_vTraceStoreISREnd(int isTaskSwitchRequired)
|
||||
{
|
||||
*** Implemented as macro in the header file
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
** ===================================================================
|
||||
** Method : vGetGDBDumpCommand (component PercepioTrace)
|
||||
**
|
||||
** Description :
|
||||
** Gets the gdb command to dump the trace data to a file.
|
||||
** Useful for copy-pasting it to the gdb console.
|
||||
** Parameters :
|
||||
** NAME - DESCRIPTION
|
||||
** * buf - Pointer to buffer for the command. Make it
|
||||
** large enoug (about 64 bytes)
|
||||
** bufSize - size of the buffer
|
||||
** * fileName - Pointer to the file name string,
|
||||
** e.g. "C:\\tmp\\trace.dump"
|
||||
** Returns : Nothing
|
||||
** ===================================================================
|
||||
*/
|
||||
void McuPercepio_vGetGDBDumpCommand(uint8_t *buf, uint16_t bufSize, uint8_t *fileName)
|
||||
{
|
||||
#if !TRC_USE_TRACEALYZER_RECORDER || (TRC_CFG_RECORDER_MODE==TRC_RECORDER_MODE_STREAMING) /* trace disabled or streaming mode */
|
||||
(void)bufSize; /* not used */
|
||||
(void)fileName; /* not used */
|
||||
/* with RTT streaming, there is no trace buffer */
|
||||
*buf = '\0';
|
||||
#else
|
||||
/* construct gdb command string: dump binary memory <file> <hexStartAddr> <hexEndAddr> */
|
||||
uint8_t *ptr; /* pointer to data */
|
||||
size_t len; /* size/length of data */
|
||||
|
||||
ptr = (uint8_t*)McuPercepio_xTraceGetTraceBuffer();
|
||||
len = McuPercepio_uiTraceGetTraceBufferSize();
|
||||
McuUtility_strcpy(buf, bufSize, (unsigned char*)"dump binary memory ");
|
||||
McuUtility_strcat(buf, bufSize, fileName);
|
||||
McuUtility_strcat(buf, bufSize, (unsigned char*)" 0x");
|
||||
McuUtility_strcatNum32Hex(buf, bufSize, (uint32_t)ptr);
|
||||
McuUtility_strcat(buf, bufSize, (unsigned char*)" 0x");
|
||||
McuUtility_strcatNum32Hex(buf, bufSize, (uint32_t)(ptr+len));
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
** ===================================================================
|
||||
** Method : vTraceSetStopHook (component PercepioTrace)
|
||||
**
|
||||
** Description :
|
||||
** Sets a function to be called when the recorder is stopped.
|
||||
** Parameters :
|
||||
** NAME - DESCRIPTION
|
||||
** stopHookFunction -
|
||||
** Returns : Nothing
|
||||
** ===================================================================
|
||||
*/
|
||||
/*
|
||||
void McuPercepio_vTraceSetStopHook(TRACE_STOP_HOOK stopHookFunction)
|
||||
{
|
||||
*** Implemented as macro in the header file
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
** ===================================================================
|
||||
** Method : xTraceGetLastError (component PercepioTrace)
|
||||
**
|
||||
** Description :
|
||||
** Gives the last error message, if any. NULL if no error
|
||||
** message is stored. Any error message is also presented when
|
||||
** opening a trace file.
|
||||
** Parameters : None
|
||||
** Returns :
|
||||
** --- - Error message
|
||||
** ===================================================================
|
||||
*/
|
||||
/*
|
||||
char* McuPercepio_xTraceGetLastError(void)
|
||||
{
|
||||
*** Implemented as macro in the header file
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
** ===================================================================
|
||||
** Method : vTraceClearError (component PercepioTrace)
|
||||
**
|
||||
** Description :
|
||||
** Removes any previous error message generated by recorder
|
||||
** calling vTraceError. By calling this function, it may be
|
||||
** possible to start/restart the trace despite errors in the
|
||||
** recorder, but there is no guarantee that the trace recorder
|
||||
** will work correctly in that case, depending on the type of
|
||||
** error.
|
||||
** Parameters :
|
||||
** NAME - DESCRIPTION
|
||||
** resetErrorMessage - parameter is
|
||||
** not used
|
||||
** Returns :
|
||||
** --- - Error code
|
||||
** ===================================================================
|
||||
*/
|
||||
/*
|
||||
byte McuPercepio_vTraceClearError(int resetErrorMessage)
|
||||
{
|
||||
*** Implemented as macro in the header file
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
** ===================================================================
|
||||
** Method : vTraceEnable (component PercepioTrace)
|
||||
**
|
||||
** Description :
|
||||
**
|
||||
** Parameters :
|
||||
** NAME - DESCRIPTION
|
||||
** startoption - * TRC_START: Starts the
|
||||
** tracing directly. In snapshot mode this
|
||||
** allows for
|
||||
** * starting the trace at any point in your
|
||||
** code, assuming vTraceEnable(TRC_INIT)
|
||||
** * has been called in the startup.
|
||||
** * Can also be used for streaming without
|
||||
** Tracealyzer control, e.g. to a local
|
||||
** * flash file system (assuming such a
|
||||
** "stream port", see trcStreamingPort.h).
|
||||
** *
|
||||
** * TRC_START_AWAIT_HOST: For streaming mode
|
||||
** only. Initializes the trace recorder
|
||||
** * if necessary and waits for a Start
|
||||
** command from Tracealyzer ("Start Recording"
|
||||
** * button). This call is intentionally
|
||||
** blocking! By calling vTraceEnable with
|
||||
** * this option from the startup code, you
|
||||
** start tracing at this point and capture
|
||||
** * the early events.
|
||||
** *
|
||||
** * TRC_INIT: Initializes the trace recorder,
|
||||
** but does not start the tracing.
|
||||
** * In snapshot mode, this must be followed
|
||||
** by a vTraceEnable(TRC_START) sometime
|
||||
** * later.
|
||||
** Returns : Nothing
|
||||
** ===================================================================
|
||||
*/
|
||||
/*
|
||||
void McuPercepio_vTraceEnable(int startOption)
|
||||
{
|
||||
*** Implemented as macro in the header file
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
** ===================================================================
|
||||
** Method : vTraceSetSemaphoreName (component PercepioTrace)
|
||||
**
|
||||
** Description :
|
||||
** Assigns a name to a FreeRTOS Queue, Semaphore or Mutex. This
|
||||
** function should be called right after creation of the
|
||||
** queue/mutex/semaphore. If not using this function, the
|
||||
** queues/mutexes/semaphores will be presented by their numeric
|
||||
** handle only.
|
||||
** Parameters :
|
||||
** NAME - DESCRIPTION
|
||||
** * queue - Pointer to the semaphore
|
||||
** * name - Pointer to name
|
||||
** Returns : Nothing
|
||||
** ===================================================================
|
||||
*/
|
||||
/*
|
||||
void McuPercepio_vTraceSetSemaphoreName(void *semaphore, char *name)
|
||||
{
|
||||
*** Implemented as macro in the header file
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
** ===================================================================
|
||||
** Method : vTraceSetMutexName (component PercepioTrace)
|
||||
**
|
||||
** Description :
|
||||
** Assigns a name to a FreeRTOS Queue, Semaphore or Mutex. This
|
||||
** function should be called right after creation of the
|
||||
** queue/mutex/semaphore. If not using this function, the
|
||||
** queues/mutexes/semaphores will be presented by their numeric
|
||||
** handle only.
|
||||
** Parameters :
|
||||
** NAME - DESCRIPTION
|
||||
** * queue - Pointer to the mutex
|
||||
** * name - Pointer to name
|
||||
** Returns : Nothing
|
||||
** ===================================================================
|
||||
*/
|
||||
/*
|
||||
void McuPercepio_vTraceSetMutexName(void *mutex, char *name)
|
||||
{
|
||||
*** Implemented as macro in the header file
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
** ===================================================================
|
||||
** Method : Startup (component PercepioTrace)
|
||||
**
|
||||
** Description :
|
||||
** Routine called during startup. Depending on the mode and
|
||||
** settings, it starts tracing and might block!
|
||||
** Parameters : None
|
||||
** Returns : Nothing
|
||||
** ===================================================================
|
||||
*/
|
||||
void McuPercepio_Startup(void)
|
||||
{
|
||||
#if configUSE_PERCEPIO_TRACE_HOOKS /* FreeRTOS using Percepio Trace */
|
||||
vTraceSetFrequency(configSYSTICK_CLOCK_HZ);
|
||||
vTraceEnable(McuPercepio_CONFIG_START_TRACE_IN_STARTUP_MODE); /* snapshot trace, from startup */
|
||||
#endif /* configUSE_PERCEPIO_TRACE_HOOKS */
|
||||
}
|
||||
|
||||
/* END McuPercepio. */
|
||||
|
||||
/*!
|
||||
** @}
|
||||
*/
|
||||
553
pico-sensor/McuLib/TraceRecorder/McuPercepio.h
Normal file
553
pico-sensor/McuLib/TraceRecorder/McuPercepio.h
Normal file
@@ -0,0 +1,553 @@
|
||||
/* ###################################################################
|
||||
** This component module is generated by Processor Expert. Do not modify it.
|
||||
** Filename : McuPercepio.h
|
||||
** Project : FRDM-K64F_Generator
|
||||
** Processor : MK64FN1M0VLL12
|
||||
** Component : PercepioTrace
|
||||
** Version : Component 01.140, Driver 01.00, CPU db: 3.00.000
|
||||
** Compiler : GNU C Compiler
|
||||
** Date/Time : 2020-11-28, 10:44, # CodeGen: 717
|
||||
** Abstract :
|
||||
**
|
||||
** Settings :
|
||||
** Component name : McuPercepio
|
||||
** RTOS+Trace Version : V4.4.1
|
||||
** Recorder Mode : Streaming
|
||||
** Recorder Buffer Allocation : static
|
||||
** Max ISR Nesting : 16
|
||||
** Snapshot Mode :
|
||||
** Recorder store mode : Ring Buffer
|
||||
** Scheduling only : no
|
||||
** Description string : FreeRTOS+Trace
|
||||
** Description max length : 80
|
||||
** Event buffer size : 1200
|
||||
** Symbol table size : 400
|
||||
** Objects :
|
||||
** Number of tasks : 10
|
||||
** Name length for task : configMAX_TASK_NAME_LEN
|
||||
** Number of ISR : 4
|
||||
** Number of queue : 3
|
||||
** Number of semaphore : 4
|
||||
** Number of mutex : 4
|
||||
** Number of timer : 2
|
||||
** Number of event groups : 2
|
||||
** Name length for ISR : 10
|
||||
** Name length for queue : 15
|
||||
** Name length for semaphore : 15
|
||||
** Name length for mutex : 15
|
||||
** Name length for timer : 15
|
||||
** Name length for event group : 15
|
||||
** Events Creation :
|
||||
** Include OS Tick events : no
|
||||
** Include ready events : yes
|
||||
** Include memory manager events : no
|
||||
** Include ISR tracing : yes
|
||||
** Include object delete events : yes
|
||||
** Include user events : yes
|
||||
** Heap Size below 16M : no
|
||||
** Float support : no
|
||||
** Use implicit IFE rules : yes
|
||||
** Use 16bit Object Handles : no
|
||||
** Segger RTT : Enabled
|
||||
** Segger RTT : McuRTT
|
||||
** Streaming Mode :
|
||||
** Up Buffer Index : 2
|
||||
** Up Buffer Size : 1024
|
||||
** Down Buffer Index : 2
|
||||
** Down Buffer Size : 32
|
||||
** Symbol Table Slots : 30
|
||||
** Symbol Max Length : 24
|
||||
** Object Data Slots : 20
|
||||
** Ctrl Task Priority : 1
|
||||
** Ctrl Task Stack Size : configMINIMAL_STACK_SIZE
|
||||
** Ctrl Task Delay : ((10 * configTICK_RATE_HZ) / 1000)
|
||||
** Source Folders : Enabled
|
||||
** Recorder : TraceRecorder
|
||||
** Config : TraceRecorder/config
|
||||
** Include : TraceRecorder/include
|
||||
** RTT Include : TraceRecorder/streamports/Jlink_RTT/include
|
||||
** System :
|
||||
** SDK : McuLib
|
||||
** Utility : McuUtility
|
||||
** Contents :
|
||||
** vTraceEnable - void McuPercepio_vTraceEnable(int startOption);
|
||||
** uiTraceStart - dword McuPercepio_uiTraceStart(void);
|
||||
** vTraceStop - void McuPercepio_vTraceStop(void);
|
||||
** vTraceClear - void McuPercepio_vTraceClear(void);
|
||||
** uiTraceGetTraceBufferSize - dword McuPercepio_uiTraceGetTraceBufferSize(void);
|
||||
** xTraceGetTraceBuffer - void* McuPercepio_xTraceGetTraceBuffer(void);
|
||||
** xTraceRegisterString - traceString McuPercepio_xTraceRegisterString(const char* name);
|
||||
** vTracePrint - void McuPercepio_vTracePrint(traceString chn, const char* str);
|
||||
** vTracePrintF - void McuPercepio_vTracePrintF(traceLabel eventLabel, char *formatStr, ...);
|
||||
** vTraceSetQueueName - void McuPercepio_vTraceSetQueueName(void *queue, char *name);
|
||||
** vTraceSetSemaphoreName - void McuPercepio_vTraceSetSemaphoreName(void *semaphore, char *name);
|
||||
** vTraceSetMutexName - void McuPercepio_vTraceSetMutexName(void *mutex, char *name);
|
||||
** xTraceSetISRProperties - traceHandle McuPercepio_xTraceSetISRProperties(char *name, char prioritiy);
|
||||
** vTraceStoreISRBegin - void McuPercepio_vTraceStoreISRBegin(traceHandle handle);
|
||||
** vTraceStoreISREnd - void McuPercepio_vTraceStoreISREnd(int isTaskSwitchRequired);
|
||||
** vGetGDBDumpCommand - void McuPercepio_vGetGDBDumpCommand(uint8_t *buf, uint16_t bufSize, uint8_t...
|
||||
** vTraceSetStopHook - void McuPercepio_vTraceSetStopHook(TRACE_STOP_HOOK stopHookFunction);
|
||||
** xTraceGetLastError - char* McuPercepio_xTraceGetLastError(void);
|
||||
** vTraceClearError - byte McuPercepio_vTraceClearError(int resetErrorMessage);
|
||||
** Startup - void McuPercepio_Startup(void);
|
||||
**
|
||||
** * (c) Copyright Percepio AB, 2013-2020
|
||||
** * http : www.percepio.se
|
||||
** * mail : info@percepio.com
|
||||
** * See separate Percepio licensing terms.
|
||||
** *
|
||||
** * Processor Expert Component: (c) Copyright Erich Styger, 2013-2020
|
||||
** * Web: https://mcuoneclipse.com
|
||||
** * SourceForge: https://sourceforge.net/projects/mcuoneclipse
|
||||
** * Git: https://github.com/ErichStyger/McuOnEclipse_PEx
|
||||
** * All rights reserved.
|
||||
** *
|
||||
** * Redistribution and use in source and binary forms, with or without modification,
|
||||
** * are permitted provided that the following conditions are met:
|
||||
** *
|
||||
** * - Redistributions of source code must retain the above copyright notice, this list
|
||||
** * of conditions and the following disclaimer.
|
||||
** *
|
||||
** * - Redistributions in binary form must reproduce the above copyright notice, this
|
||||
** * list of conditions and the following disclaimer in the documentation and/or
|
||||
** * other materials provided with the distribution.
|
||||
** *
|
||||
** * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
** * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
** * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
** * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
** * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
** * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
** * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
** * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
** * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
** * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
** ###################################################################*/
|
||||
/*!
|
||||
** @file McuPercepio.h
|
||||
** @version 01.00
|
||||
** @brief
|
||||
**
|
||||
*/
|
||||
/*!
|
||||
** @addtogroup McuPercepio_module McuPercepio module documentation
|
||||
** @{
|
||||
*/
|
||||
|
||||
#ifndef __McuPercepio_HvTraceInitTraceData
|
||||
#define __McuPercepio_H
|
||||
|
||||
/* MODULE McuPercepio. */
|
||||
#include "McuLib.h" /* SDK and API used */
|
||||
#include "McuPercepioconfig.h" /* configuration */
|
||||
|
||||
/* Include inherited components */
|
||||
#include "McuRTT.h"
|
||||
#include "McuLib.h"
|
||||
#include "McuUtility.h"
|
||||
|
||||
#if McuLib_CONFIG_SDK_VERSION_USED != McuLib_CONFIG_SDK_PROCESSOR_EXPERT
|
||||
/* prototypes for user events */
|
||||
void McuPercepio_OnTraceWrap(void);
|
||||
#endif
|
||||
|
||||
#include "trcRecorder.h" /* streaming interface */
|
||||
|
||||
|
||||
#define McuPercepio_uiTraceGetTraceBufferSize() \
|
||||
uiTraceGetTraceBufferSize()
|
||||
|
||||
/*
|
||||
** ===================================================================
|
||||
** Method : uiTraceGetTraceBufferSize (component PercepioTrace)
|
||||
**
|
||||
** Description :
|
||||
** Gets the size of the recorder data structure. For use
|
||||
** together with vTraceGetTraceBuffer if you wish to implement
|
||||
** an own store/upload solution, e.g., in case a debugger
|
||||
** connection is not available for uploading the data.
|
||||
** Parameters : None
|
||||
** Returns :
|
||||
** --- - Size of the trace buffer
|
||||
** ===================================================================
|
||||
*/
|
||||
|
||||
#define McuPercepio_xTraceGetTraceBuffer() \
|
||||
xTraceGetTraceBuffer()
|
||||
|
||||
/*
|
||||
** ===================================================================
|
||||
** Method : xTraceGetTraceBuffer (component PercepioTrace)
|
||||
**
|
||||
** Description :
|
||||
** Return a pointer to the recorder data structure. Use this
|
||||
** together with uiTraceGetTraceBufferSize if you wish to
|
||||
** implement an own store/upload solution, e.g., in case a
|
||||
** debugger connection is not available for uploading the data.
|
||||
** Parameters : None
|
||||
** Returns :
|
||||
** --- - Pointer to the trace buffer
|
||||
** ===================================================================
|
||||
*/
|
||||
|
||||
#define McuPercepio_uiTraceStart() \
|
||||
uiTraceStart()
|
||||
/*
|
||||
** ===================================================================
|
||||
** Method : uiTraceStart (component PercepioTrace)
|
||||
**
|
||||
** Description :
|
||||
** Starts the trace.
|
||||
** Parameters : None
|
||||
** Returns :
|
||||
** --- - returns 1 if trace has been started, 0
|
||||
** otherwise.
|
||||
** ===================================================================
|
||||
*/
|
||||
|
||||
#define McuPercepio_vTraceStop() \
|
||||
vTraceStop()
|
||||
|
||||
/*
|
||||
** ===================================================================
|
||||
** Method : vTraceStop (component PercepioTrace)
|
||||
**
|
||||
** Description :
|
||||
** Stops the trace.
|
||||
** Parameters : None
|
||||
** Returns : Nothing
|
||||
** ===================================================================
|
||||
*/
|
||||
|
||||
#define McuPercepio_vTraceClear() \
|
||||
vTraceClear()
|
||||
|
||||
/*
|
||||
** ===================================================================
|
||||
** Method : vTraceClear (component PercepioTrace)
|
||||
**
|
||||
** Description :
|
||||
** Clears the trace.
|
||||
** Parameters : None
|
||||
** Returns : Nothing
|
||||
** ===================================================================
|
||||
*/
|
||||
|
||||
#define McuPercepio_xTraceRegisterString (label) \
|
||||
xTraceRegisterString(label)
|
||||
|
||||
/*
|
||||
** ===================================================================
|
||||
** Method : xTraceRegisterString (component PercepioTrace)
|
||||
**
|
||||
** Description :
|
||||
** Register strings in the recorder, e.g. for names of user
|
||||
** event channels.
|
||||
** Parameters :
|
||||
** NAME - DESCRIPTION
|
||||
** * name - Pointer to label
|
||||
** Returns :
|
||||
** --- - trace label to be used with vTracePrintF
|
||||
** ===================================================================
|
||||
*/
|
||||
|
||||
#define McuPercepio_vTracePrint(chn, str) \
|
||||
vTracePrint(chn, str)
|
||||
|
||||
/*
|
||||
** ===================================================================
|
||||
** Method : vTracePrint (component PercepioTrace)
|
||||
**
|
||||
** Description :
|
||||
** Generates a User Event with a text label. The label is
|
||||
** created/looked up in the symbol table using
|
||||
** xTraceRegisterString.
|
||||
** Parameters :
|
||||
** NAME - DESCRIPTION
|
||||
** chn - trace label for the user event
|
||||
** * str - Pointer to string
|
||||
** Returns : Nothing
|
||||
** ===================================================================
|
||||
*/
|
||||
|
||||
/* void McuPercepio_vTracePrintF(traceLabel eventLabel, char *formatStr, ...); */
|
||||
#define McuPercepio_vTracePrintF vTracePrintF
|
||||
|
||||
/*
|
||||
** ===================================================================
|
||||
** Method : vTracePrintF (component PercepioTrace)
|
||||
**
|
||||
** Description :
|
||||
** Advanced user event - like printf (but limited formatting
|
||||
** support - will improve)
|
||||
** Parameters :
|
||||
** NAME - DESCRIPTION
|
||||
** eventLabel - trace label
|
||||
** * formatStr - Pointer to format string
|
||||
** Variable_1 - open parameter list
|
||||
** Returns : Nothing
|
||||
** ===================================================================
|
||||
*/
|
||||
|
||||
#define McuPercepio_vTraceSetQueueName(queue, name) \
|
||||
vTraceSetQueueName(queue, name)
|
||||
|
||||
/*
|
||||
** ===================================================================
|
||||
** Method : vTraceSetQueueName (component PercepioTrace)
|
||||
**
|
||||
** Description :
|
||||
** Assigns a name to a FreeRTOS Queue, Semaphore or Mutex. This
|
||||
** function should be called right after creation of the
|
||||
** queue/mutex/semaphore. If not using this function, the
|
||||
** queues/mutexes/semaphores will be presented by their numeric
|
||||
** handle only.
|
||||
** Parameters :
|
||||
** NAME - DESCRIPTION
|
||||
** * queue - Pointer to the queue
|
||||
** * name - Pointer to name
|
||||
** Returns : Nothing
|
||||
** ===================================================================
|
||||
*/
|
||||
|
||||
#define McuPercepio_xTraceSetISRProperties(name, prioritiy) \
|
||||
xTraceSetISRProperties(name, prioritiy)
|
||||
|
||||
/*
|
||||
** ===================================================================
|
||||
** Method : xTraceSetISRProperties (component PercepioTrace)
|
||||
**
|
||||
** Description :
|
||||
** Registers an Interrupt Service Routine in the recorder
|
||||
** library, This must be called before using
|
||||
** vTraceStoreISRBegin to store ISR events. This is typically
|
||||
** called in the startup of the system, before the scheduler is
|
||||
** started. Method is always enabled if 'Include ISR tracing'
|
||||
** is set to 'yes' in the properties.
|
||||
** Parameters :
|
||||
** NAME - DESCRIPTION
|
||||
** * name - Pointer to name
|
||||
** prioritiy - priority
|
||||
** Returns :
|
||||
** --- - trace handle to be used for
|
||||
** vTaceStoreISRBegin()
|
||||
** ===================================================================
|
||||
*/
|
||||
|
||||
#define McuPercepio_vTraceStoreISRBegin(handle) \
|
||||
vTraceStoreISRBegin(handle)
|
||||
|
||||
/*
|
||||
** ===================================================================
|
||||
** Method : vTraceStoreISRBegin (component PercepioTrace)
|
||||
**
|
||||
** Description :
|
||||
** Registers the beginning of an Interrupt Service Routine.
|
||||
** This must not be interrupted by another ISR containing
|
||||
** recorder library calls, so if allowing nested ISRs this must
|
||||
** be called with interrupts disabled. Method is always
|
||||
** enabled if 'Include ISR tracing' is set to 'yes' in the
|
||||
** properties.
|
||||
** Parameters :
|
||||
** NAME - DESCRIPTION
|
||||
** handle - trace handle
|
||||
** Returns : Nothing
|
||||
** ===================================================================
|
||||
*/
|
||||
|
||||
#define McuPercepio_vTraceStoreISREnd(isTaskSwitchRequired) \
|
||||
vTraceStoreISREnd(isTaskSwitchRequired)
|
||||
|
||||
/*
|
||||
** ===================================================================
|
||||
** Method : vTraceStoreISREnd (component PercepioTrace)
|
||||
**
|
||||
** Description :
|
||||
** Registers the end of an Interrupt Service Routine. This must
|
||||
** not be interrupted by another ISR containing recorder
|
||||
** library calls, so if allowing nested ISRs this must be
|
||||
** called with interrupts disabled. Method is always enabled
|
||||
** if 'Include ISR tracing' is set to 'yes' in the properties.
|
||||
** Parameters :
|
||||
** NAME - DESCRIPTION
|
||||
** isTaskSwitchRequired - The
|
||||
** parameter pendingISR indicates if the
|
||||
** interrupt has requested a task-switch (= 1)
|
||||
** or if the interrupt returns to the earlier
|
||||
** context (= 0)
|
||||
** Returns : Nothing
|
||||
** ===================================================================
|
||||
*/
|
||||
|
||||
void McuPercepio_vGetGDBDumpCommand(uint8_t *buf, uint16_t bufSize, uint8_t *fileName);
|
||||
/*
|
||||
** ===================================================================
|
||||
** Method : vGetGDBDumpCommand (component PercepioTrace)
|
||||
**
|
||||
** Description :
|
||||
** Gets the gdb command to dump the trace data to a file.
|
||||
** Useful for copy-pasting it to the gdb console.
|
||||
** Parameters :
|
||||
** NAME - DESCRIPTION
|
||||
** * buf - Pointer to buffer for the command. Make it
|
||||
** large enoug (about 64 bytes)
|
||||
** bufSize - size of the buffer
|
||||
** * fileName - Pointer to the file name string,
|
||||
** e.g. "C:\\tmp\\trace.dump"
|
||||
** Returns : Nothing
|
||||
** ===================================================================
|
||||
*/
|
||||
|
||||
#define McuPercepio_vTraceSetStopHook(stopHookFunction) \
|
||||
vTraceSetStopHook(stopHookFunction)
|
||||
/*
|
||||
** ===================================================================
|
||||
** Method : vTraceSetStopHook (component PercepioTrace)
|
||||
**
|
||||
** Description :
|
||||
** Sets a function to be called when the recorder is stopped.
|
||||
** Parameters :
|
||||
** NAME - DESCRIPTION
|
||||
** stopHookFunction -
|
||||
** Returns : Nothing
|
||||
** ===================================================================
|
||||
*/
|
||||
|
||||
#define McuPercepio_xTraceGetLastError() \
|
||||
xTraceGetLastError()
|
||||
/*
|
||||
** ===================================================================
|
||||
** Method : xTraceGetLastError (component PercepioTrace)
|
||||
**
|
||||
** Description :
|
||||
** Gives the last error message, if any. NULL if no error
|
||||
** message is stored. Any error message is also presented when
|
||||
** opening a trace file.
|
||||
** Parameters : None
|
||||
** Returns :
|
||||
** --- - Error message
|
||||
** ===================================================================
|
||||
*/
|
||||
|
||||
#define McuPercepio_vTraceClearError(resetErrorMessage) \
|
||||
vTraceClearError(resetErrorMessage)
|
||||
/*
|
||||
** ===================================================================
|
||||
** Method : vTraceClearError (component PercepioTrace)
|
||||
**
|
||||
** Description :
|
||||
** Removes any previous error message generated by recorder
|
||||
** calling vTraceError. By calling this function, it may be
|
||||
** possible to start/restart the trace despite errors in the
|
||||
** recorder, but there is no guarantee that the trace recorder
|
||||
** will work correctly in that case, depending on the type of
|
||||
** error.
|
||||
** Parameters :
|
||||
** NAME - DESCRIPTION
|
||||
** resetErrorMessage - parameter is
|
||||
** not used
|
||||
** Returns :
|
||||
** --- - Error code
|
||||
** ===================================================================
|
||||
*/
|
||||
|
||||
#define McuPercepio_vTraceEnable(startOption) \
|
||||
vTraceEnable(startOption)
|
||||
/*
|
||||
** ===================================================================
|
||||
** Method : vTraceEnable (component PercepioTrace)
|
||||
**
|
||||
** Description :
|
||||
**
|
||||
** Parameters :
|
||||
** NAME - DESCRIPTION
|
||||
** startoption - * TRC_START: Starts the
|
||||
** tracing directly. In snapshot mode this
|
||||
** allows for
|
||||
** * starting the trace at any point in your
|
||||
** code, assuming vTraceEnable(TRC_INIT)
|
||||
** * has been called in the startup.
|
||||
** * Can also be used for streaming without
|
||||
** Tracealyzer control, e.g. to a local
|
||||
** * flash file system (assuming such a
|
||||
** "stream port", see trcStreamingPort.h).
|
||||
** *
|
||||
** * TRC_START_AWAIT_HOST: For streaming mode
|
||||
** only. Initializes the trace recorder
|
||||
** * if necessary and waits for a Start
|
||||
** command from Tracealyzer ("Start Recording"
|
||||
** * button). This call is intentionally
|
||||
** blocking! By calling vTraceEnable with
|
||||
** * this option from the startup code, you
|
||||
** start tracing at this point and capture
|
||||
** * the early events.
|
||||
** *
|
||||
** * TRC_INIT: Initializes the trace recorder,
|
||||
** but does not start the tracing.
|
||||
** * In snapshot mode, this must be followed
|
||||
** by a vTraceEnable(TRC_START) sometime
|
||||
** * later.
|
||||
** Returns : Nothing
|
||||
** ===================================================================
|
||||
*/
|
||||
|
||||
#define McuPercepio_vTraceSetSemaphoreName(semaphore, name) \
|
||||
vTraceSetSemaphoreName(semaphore, name)
|
||||
/*
|
||||
** ===================================================================
|
||||
** Method : vTraceSetSemaphoreName (component PercepioTrace)
|
||||
**
|
||||
** Description :
|
||||
** Assigns a name to a FreeRTOS Queue, Semaphore or Mutex. This
|
||||
** function should be called right after creation of the
|
||||
** queue/mutex/semaphore. If not using this function, the
|
||||
** queues/mutexes/semaphores will be presented by their numeric
|
||||
** handle only.
|
||||
** Parameters :
|
||||
** NAME - DESCRIPTION
|
||||
** * queue - Pointer to the semaphore
|
||||
** * name - Pointer to name
|
||||
** Returns : Nothing
|
||||
** ===================================================================
|
||||
*/
|
||||
|
||||
#define McuPercepio_vTraceSetMutexName(mutex, name) \
|
||||
vTraceSetMutexName(mutex, name)
|
||||
/*
|
||||
** ===================================================================
|
||||
** Method : vTraceSetMutexName (component PercepioTrace)
|
||||
**
|
||||
** Description :
|
||||
** Assigns a name to a FreeRTOS Queue, Semaphore or Mutex. This
|
||||
** function should be called right after creation of the
|
||||
** queue/mutex/semaphore. If not using this function, the
|
||||
** queues/mutexes/semaphores will be presented by their numeric
|
||||
** handle only.
|
||||
** Parameters :
|
||||
** NAME - DESCRIPTION
|
||||
** * queue - Pointer to the mutex
|
||||
** * name - Pointer to name
|
||||
** Returns : Nothing
|
||||
** ===================================================================
|
||||
*/
|
||||
|
||||
void McuPercepio_Startup(void);
|
||||
/*
|
||||
** ===================================================================
|
||||
** Method : Startup (component PercepioTrace)
|
||||
**
|
||||
** Description :
|
||||
** Routine called during startup. Depending on the mode and
|
||||
** settings, it starts tracing and might block!
|
||||
** Parameters : None
|
||||
** Returns : Nothing
|
||||
** ===================================================================
|
||||
*/
|
||||
|
||||
/* END McuPercepio. */
|
||||
|
||||
#endif
|
||||
/* ifndef __McuPercepio_H */
|
||||
/*!
|
||||
** @}
|
||||
*/
|
||||
38
pico-sensor/McuLib/TraceRecorder/McuPercepioconfig.h
Normal file
38
pico-sensor/McuLib/TraceRecorder/McuPercepioconfig.h
Normal file
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* \file
|
||||
* \brief Configuration header file for Percepio Trace for FreeRTOS
|
||||
* Copyright (c) 2020, Erich Styger
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* This header file is used to configure settings of the Percepio trace.
|
||||
*/
|
||||
|
||||
#ifndef __McuPercepio_CONFIG_H
|
||||
#define __McuPercepio_CONFIG_H
|
||||
|
||||
#include "trcPortDefines.h"
|
||||
#include "trcConfig.h"
|
||||
|
||||
#if !defined(TRC_CFG_RECORDER_MODE) || !defined(TRC_RECORDER_MODE_SNAPSHOT)
|
||||
#error "these macros are used below, but do not exist?"
|
||||
#endif
|
||||
|
||||
#ifndef McuPercepio_CONFIG_START_TRACE_IN_STARTUP_MODE
|
||||
/* Percepio trace startup mode used for calling vTraceEnable() from Startup():
|
||||
Snapshot Mode:
|
||||
TRC_INIT: Initializes trace module. Application needs to start tracing later with vTraceEnable(TRC_START);
|
||||
TRC_START: Initializes and starts tracing
|
||||
Streaming Mode:
|
||||
TRC_INIT: Initializes trace module. Application needs to start tracing later with vTraceEnable(TRC_START);
|
||||
TRC_START: Initializes and starts tracing
|
||||
TRC_START_AWAIT_HOST: Initializes trace module and blocks and waits for data to be retrieved */
|
||||
#if TRC_CFG_RECORDER_MODE==TRC_RECORDER_MODE_SNAPSHOT
|
||||
#define McuPercepio_CONFIG_START_TRACE_IN_STARTUP_MODE TRC_START
|
||||
/*!< Trace startup for snapshot mode: TRC_INIT or TRC_START */
|
||||
#else /* streaming mode */
|
||||
#define McuPercepio_CONFIG_START_TRACE_IN_STARTUP_MODE TRC_START
|
||||
/*!< Trace startup for streaming mode: TRC_INIT, TRC_START or TRC_START_AWAIT_HOST */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* __McuPercepio_CONFIG_H */
|
||||
488
pico-sensor/McuLib/TraceRecorder/config/trcConfig.h
Normal file
488
pico-sensor/McuLib/TraceRecorder/config/trcConfig.h
Normal file
@@ -0,0 +1,488 @@
|
||||
/*******************************************************************************
|
||||
* Trace Recorder Library for Tracealyzer v4.4.1
|
||||
* Percepio AB, www.percepio.com
|
||||
*
|
||||
* trcConfig.h
|
||||
*
|
||||
* Main configuration parameters for the trace recorder library.
|
||||
* More settings can be found in trcStreamingConfig.h and trcSnapshotConfig.h.
|
||||
*
|
||||
* Read more at http://percepio.com/2016/10/05/rtos-tracing/
|
||||
*
|
||||
* Terms of Use
|
||||
* This file is part of the trace recorder library (RECORDER), which is the
|
||||
* intellectual property of Percepio AB (PERCEPIO) and provided under a
|
||||
* license as follows.
|
||||
* The RECORDER may be used free of charge for the purpose of recording data
|
||||
* intended for analysis in PERCEPIO products. It may not be used or modified
|
||||
* for other purposes without explicit permission from PERCEPIO.
|
||||
* You may distribute the RECORDER in its original source code form, assuming
|
||||
* this text (terms of use, disclaimer, copyright notice) is unchanged. You are
|
||||
* allowed to distribute the RECORDER with minor modifications intended for
|
||||
* configuration or porting of the RECORDER, e.g., to allow using it on a
|
||||
* specific processor, processor family or with a specific communication
|
||||
* interface. Any such modifications should be documented directly below
|
||||
* this comment block.
|
||||
*
|
||||
* Disclaimer
|
||||
* The RECORDER is being delivered to you AS IS and PERCEPIO makes no warranty
|
||||
* as to its use or performance. PERCEPIO does not and cannot warrant the
|
||||
* performance or results you may obtain by using the RECORDER or documentation.
|
||||
* PERCEPIO make no warranties, express or implied, as to noninfringement of
|
||||
* third party rights, merchantability, or fitness for any particular purpose.
|
||||
* In no event will PERCEPIO, its technology partners, or distributors be liable
|
||||
* to you for any consequential, incidental or special damages, including any
|
||||
* lost profits or lost savings, even if a representative of PERCEPIO has been
|
||||
* advised of the possibility of such damages, or for any claim by any third
|
||||
* party. Some jurisdictions do not allow the exclusion or limitation of
|
||||
* incidental, consequential or special damages, or the exclusion of implied
|
||||
* warranties or limitations on how long an implied warranty may last, so the
|
||||
* above limitations may not apply to you.
|
||||
*
|
||||
* Tabs are used for indent in this file (1 tab = 4 spaces)
|
||||
*
|
||||
* Copyright Percepio AB, 2018.
|
||||
* www.percepio.com
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef TRC_CONFIG_H
|
||||
#define TRC_CONFIG_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "trcPortDefines.h"
|
||||
|
||||
/******************************************************************************
|
||||
* Include of processor header file
|
||||
*
|
||||
* Here you may need to include the header file for your processor. This is
|
||||
* required at least for the ARM Cortex-M port, that uses the ARM CMSIS API.
|
||||
* Try that in case of build problems. Otherwise, remove the #error line below.
|
||||
*****************************************************************************/
|
||||
#if 1 /* << EST */
|
||||
#include "McuLib.h" /* include SDK and API used */
|
||||
#include "FreeRTOSConfig.h"
|
||||
|
||||
#if McuLib_CONFIG_PEX_SDK_USED
|
||||
#ifndef __CORTEX_M
|
||||
#if configCPU_FAMILY_IS_ARM_M0(configCPU_FAMILY)
|
||||
#define __CORTEX_M 0
|
||||
#elif configCPU_FAMILY_IS_ARM_M4(configCPU_FAMILY)
|
||||
#define __CORTEX_M 4
|
||||
#elif configCPU_FAMILY_IS_ARM_M7(configCPU_FAMILY)
|
||||
#define __CORTEX_M 7
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
#error "Trace Recorder: Please include your processor's header file here and remove this line."
|
||||
#endif
|
||||
|
||||
/*******************************************************************************
|
||||
* Configuration Macro: TRC_CFG_HARDWARE_PORT
|
||||
*
|
||||
* Specify what hardware port to use (i.e., the "timestamping driver").
|
||||
*
|
||||
* All ARM Cortex-M MCUs are supported by "TRC_HARDWARE_PORT_ARM_Cortex_M".
|
||||
* This port uses the DWT cycle counter for Cortex-M3/M4/M7 devices, which is
|
||||
* available on most such devices. In case your device don't have DWT support,
|
||||
* you will get an error message opening the trace. In that case, you may
|
||||
* force the recorder to use SysTick timestamping instead, using this define:
|
||||
*
|
||||
* #define TRC_CFG_ARM_CM_USE_SYSTICK
|
||||
*
|
||||
* For ARM Cortex-M0/M0+ devices, SysTick mode is used automatically.
|
||||
*
|
||||
* See trcHardwarePort.h for available ports and information on how to
|
||||
* define your own port, if not already present.
|
||||
******************************************************************************/
|
||||
#if 1 /* << EST */
|
||||
#if configCPU_FAMILY_IS_ARM(configCPU_FAMILY)
|
||||
#define TRC_CFG_HARDWARE_PORT TRC_HARDWARE_PORT_ARM_Cortex_M
|
||||
#else
|
||||
#define TRC_CFG_HARDWARE_PORT TRC_HARDWARE_PORT_PROCESSOR_EXPERT
|
||||
#endif
|
||||
#else
|
||||
#define TRC_CFG_HARDWARE_PORT TRC_HARDWARE_PORT_NOT_SET
|
||||
#endif
|
||||
|
||||
/*******************************************************************************
|
||||
* Configuration Macro: TRC_CFG_RECORDER_MODE
|
||||
*
|
||||
* Specify what recording mode to use. Snapshot means that the data is saved in
|
||||
* an internal RAM buffer, for later upload. Streaming means that the data is
|
||||
* transferred continuously to the host PC.
|
||||
*
|
||||
* For more information, see http://percepio.com/2016/10/05/rtos-tracing/
|
||||
* and the Tracealyzer User Manual.
|
||||
*
|
||||
* Values:
|
||||
* TRC_RECORDER_MODE_SNAPSHOT
|
||||
* TRC_RECORDER_MODE_STREAMING
|
||||
******************************************************************************/
|
||||
#define TRC_CFG_RECORDER_MODE TRC_RECORDER_MODE_STREAMING
|
||||
|
||||
/******************************************************************************
|
||||
* TRC_CFG_FREERTOS_VERSION
|
||||
*
|
||||
* Specify what version of FreeRTOS that is used (don't change unless using the
|
||||
* trace recorder library with an older version of FreeRTOS).
|
||||
*
|
||||
* TRC_FREERTOS_VERSION_7_3_X If using FreeRTOS v7.3.X
|
||||
* TRC_FREERTOS_VERSION_7_4_X If using FreeRTOS v7.4.X
|
||||
* TRC_FREERTOS_VERSION_7_5_X If using FreeRTOS v7.5.X
|
||||
* TRC_FREERTOS_VERSION_7_6_X If using FreeRTOS v7.6.X
|
||||
* TRC_FREERTOS_VERSION_8_X_X If using FreeRTOS v8.X.X
|
||||
* TRC_FREERTOS_VERSION_9_0_0 If using FreeRTOS v9.0.0
|
||||
* TRC_FREERTOS_VERSION_9_0_1 If using FreeRTOS v9.0.1
|
||||
* TRC_FREERTOS_VERSION_9_0_2 If using FreeRTOS v9.0.2
|
||||
* TRC_FREERTOS_VERSION_10_0_0 If using FreeRTOS v10.0.0
|
||||
* TRC_FREERTOS_VERSION_10_0_1 If using FreeRTOS v10.0.1
|
||||
* TRC_FREERTOS_VERSION_10_1_0 If using FreeRTOS v10.1.0
|
||||
* TRC_FREERTOS_VERSION_10_1_1 If using FreeRTOS v10.1.1
|
||||
* TRC_FREERTOS_VERSION_10_2_0 If using FreeRTOS v10.2.0
|
||||
* TRC_FREERTOS_VERSION_10_2_1 If using FreeRTOS v10.2.1
|
||||
* TRC_FREERTOS_VERSION_10_3_0 If using FreeRTOS v10.3.0
|
||||
* TRC_FREERTOS_VERSION_10_3_1 If using FreeRTOS v10.3.1
|
||||
* TRC_FREERTOS_VERSION_10_4_0 If using FreeRTOS v10.4.0
|
||||
* TRC_FREERTOS_VERSION_10_4_1 If using FreeRTOS v10.4.1 or later
|
||||
*****************************************************************************/
|
||||
#define TRC_CFG_FREERTOS_VERSION TRC_FREERTOS_VERSION_10_4_1 /* << EST */
|
||||
|
||||
/*******************************************************************************
|
||||
* TRC_CFG_SCHEDULING_ONLY
|
||||
*
|
||||
* Macro which should be defined as an integer value.
|
||||
*
|
||||
* If this setting is enabled (= 1), only scheduling events are recorded.
|
||||
* If disabled (= 0), all events are recorded (unless filtered in other ways).
|
||||
*
|
||||
* Default value is 0 (= include additional events).
|
||||
******************************************************************************/
|
||||
#define TRC_CFG_SCHEDULING_ONLY 0
|
||||
|
||||
/******************************************************************************
|
||||
* TRC_CFG_INCLUDE_MEMMANG_EVENTS
|
||||
*
|
||||
* Macro which should be defined as either zero (0) or one (1).
|
||||
*
|
||||
* This controls if malloc and free calls should be traced. Set this to zero (0)
|
||||
* to exclude malloc/free calls, or one (1) to include such events in the trace.
|
||||
*
|
||||
* Default value is 1.
|
||||
*****************************************************************************/
|
||||
#define TRC_CFG_INCLUDE_MEMMANG_EVENTS 0
|
||||
|
||||
/******************************************************************************
|
||||
* TRC_CFG_INCLUDE_USER_EVENTS
|
||||
*
|
||||
* Macro which should be defined as either zero (0) or one (1).
|
||||
*
|
||||
* If this is zero (0), all code related to User Events is excluded in order
|
||||
* to reduce code size. Any attempts of storing User Events are then silently
|
||||
* ignored.
|
||||
*
|
||||
* User Events are application-generated events, like "printf" but for the
|
||||
* trace log, generated using vTracePrint and vTracePrintF.
|
||||
* The formatting is done on host-side, by Tracealyzer. User Events are
|
||||
* therefore much faster than a console printf and can often be used
|
||||
* in timing critical code without problems.
|
||||
*
|
||||
* Note: In streaming mode, User Events are used to provide error messages
|
||||
* and warnings from the recorder (in case of incorrect configuration) for
|
||||
* display in Tracealyzer. Disabling user events will also disable these
|
||||
* warnings. You can however still catch them by calling xTraceGetLastError
|
||||
* or by putting breakpoints in prvTraceError and prvTraceWarning.
|
||||
*
|
||||
* Default value is 1.
|
||||
*****************************************************************************/
|
||||
#define TRC_CFG_INCLUDE_USER_EVENTS 1
|
||||
|
||||
/*****************************************************************************
|
||||
* TRC_CFG_INCLUDE_ISR_TRACING
|
||||
*
|
||||
* Macro which should be defined as either zero (0) or one (1).
|
||||
*
|
||||
* If this is zero (0), the code for recording Interrupt Service Routines is
|
||||
* excluded, in order to reduce code size. This means that any calls to
|
||||
* vTraceStoreISRBegin/vTraceStoreISREnd will be ignored.
|
||||
* This does not completely disable ISR tracing, in cases where an ISR is
|
||||
* calling a traced kernel service. These events will still be recorded and
|
||||
* show up in anonymous ISR instances in Tracealyzer, with names such as
|
||||
* "ISR sending to <queue name>".
|
||||
* To disable such tracing, please refer to vTraceSetFilterGroup and
|
||||
* vTraceSetFilterMask.
|
||||
*
|
||||
* Default value is 1.
|
||||
*
|
||||
* Note: tracing ISRs requires that you insert calls to vTraceStoreISRBegin
|
||||
* and vTraceStoreISREnd in your interrupt handlers.
|
||||
*****************************************************************************/
|
||||
#define TRC_CFG_INCLUDE_ISR_TRACING 1
|
||||
|
||||
/*****************************************************************************
|
||||
* TRC_CFG_INCLUDE_READY_EVENTS
|
||||
*
|
||||
* Macro which should be defined as either zero (0) or one (1).
|
||||
*
|
||||
* If one (1), events are recorded when tasks enter scheduling state "ready".
|
||||
* This allows Tracealyzer to show the initial pending time before tasks enter
|
||||
* the execution state, and present accurate response times.
|
||||
* If zero (0), "ready events" are not created, which allows for recording
|
||||
* longer traces in the same amount of RAM.
|
||||
*
|
||||
* Default value is 1.
|
||||
*****************************************************************************/
|
||||
#define TRC_CFG_INCLUDE_READY_EVENTS 1
|
||||
|
||||
/*****************************************************************************
|
||||
* TRC_CFG_INCLUDE_OSTICK_EVENTS
|
||||
*
|
||||
* Macro which should be defined as either zero (0) or one (1).
|
||||
*
|
||||
* If this is one (1), events will be generated whenever the OS clock is
|
||||
* increased. If zero (0), OS tick events are not generated, which allows for
|
||||
* recording longer traces in the same amount of RAM.
|
||||
*
|
||||
* Default value is 1.
|
||||
*****************************************************************************/
|
||||
#define TRC_CFG_INCLUDE_OSTICK_EVENTS 0
|
||||
|
||||
/*****************************************************************************
|
||||
* TRC_CFG_INCLUDE_EVENT_GROUP_EVENTS
|
||||
*
|
||||
* Macro which should be defined as either zero (0) or one (1).
|
||||
*
|
||||
* If this is zero (0), the trace will exclude any "event group" events.
|
||||
*
|
||||
* Default value is 0 (excluded) since dependent on event_groups.c
|
||||
*****************************************************************************/
|
||||
#define TRC_CFG_INCLUDE_EVENT_GROUP_EVENTS 0
|
||||
|
||||
/*****************************************************************************
|
||||
* TRC_CFG_INCLUDE_TIMER_EVENTS
|
||||
*
|
||||
* Macro which should be defined as either zero (0) or one (1).
|
||||
*
|
||||
* If this is zero (0), the trace will exclude any Timer events.
|
||||
*
|
||||
* Default value is 0 since dependent on timers.c
|
||||
*****************************************************************************/
|
||||
#define TRC_CFG_INCLUDE_TIMER_EVENTS 0
|
||||
|
||||
/*****************************************************************************
|
||||
* TRC_CFG_INCLUDE_PEND_FUNC_CALL_EVENTS
|
||||
*
|
||||
* Macro which should be defined as either zero (0) or one (1).
|
||||
*
|
||||
* If this is zero (0), the trace will exclude any "pending function call"
|
||||
* events, such as xTimerPendFunctionCall().
|
||||
*
|
||||
* Default value is 0 since dependent on timers.c
|
||||
*****************************************************************************/
|
||||
#define TRC_CFG_INCLUDE_PEND_FUNC_CALL_EVENTS 0
|
||||
|
||||
/*******************************************************************************
|
||||
* Configuration Macro: TRC_CFG_INCLUDE_STREAM_BUFFER_EVENTS
|
||||
*
|
||||
* Macro which should be defined as either zero (0) or one (1).
|
||||
*
|
||||
* If this is zero (0), the trace will exclude any stream buffer or message
|
||||
* buffer events.
|
||||
*
|
||||
* Default value is 0 since dependent on stream_buffer.c (new in FreeRTOS v10)
|
||||
******************************************************************************/
|
||||
#define TRC_CFG_INCLUDE_STREAM_BUFFER_EVENTS 0
|
||||
|
||||
/******************************************************************************
|
||||
* TRC_CFG_ENABLE_STACK_MONITOR
|
||||
*
|
||||
* If enabled (1), the recorder periodically reports the unused stack space of
|
||||
* all active tasks.
|
||||
* The stack monitoring runs in the Tracealyzer Control task, TzCtrl. This task
|
||||
* is always created by the recorder when in streaming mode.
|
||||
* In snapshot mode, the TzCtrl task is only used for stack monitoring and is
|
||||
* not created unless this is enabled.
|
||||
*****************************************************************************/
|
||||
#define TRC_CFG_ENABLE_STACK_MONITOR 1
|
||||
|
||||
/******************************************************************************
|
||||
* TRC_CFG_STACK_MONITOR_MAX_TASKS
|
||||
*
|
||||
* Macro which should be defined as a non-zero integer value.
|
||||
*
|
||||
* This controls how many tasks that can be monitored by the stack monitor.
|
||||
* If this is too small, some tasks will be excluded and a warning is shown.
|
||||
*
|
||||
* Default value is 10.
|
||||
*****************************************************************************/
|
||||
#define TRC_CFG_STACK_MONITOR_MAX_TASKS 10
|
||||
|
||||
/******************************************************************************
|
||||
* TRC_CFG_STACK_MONITOR_MAX_REPORTS
|
||||
*
|
||||
* Macro which should be defined as a non-zero integer value.
|
||||
*
|
||||
* This defines how many tasks that will be subject to stack usage analysis for
|
||||
* each execution of the Tracealyzer Control task (TzCtrl). Note that the stack
|
||||
* monitoring cycles between the tasks, so this does not affect WHICH tasks that
|
||||
* are monitored, but HOW OFTEN each task stack is analyzed.
|
||||
*
|
||||
* This setting can be combined with TRC_CFG_CTRL_TASK_DELAY to tune the
|
||||
* frequency of the stack monitoring. This is motivated since the stack analysis
|
||||
* can take some time to execute.
|
||||
* However, note that the stack analysis runs in a separate task (TzCtrl) that
|
||||
* can be executed on low priority. This way, you can avoid that the stack
|
||||
* analysis disturbs any time-sensitive tasks.
|
||||
*
|
||||
* Default value is 1.
|
||||
*****************************************************************************/
|
||||
#define TRC_CFG_STACK_MONITOR_MAX_REPORTS 1
|
||||
|
||||
/*******************************************************************************
|
||||
* Configuration Macro: TRC_CFG_CTRL_TASK_PRIORITY
|
||||
*
|
||||
* The scheduling priority of the Tracealyzer Control (TzCtrl) task.
|
||||
*
|
||||
* In streaming mode, TzCtrl is used to receive start/stop commands from
|
||||
* Tracealyzer and in some cases also to transmit the trace data (for stream
|
||||
* ports that uses the internal buffer, like TCP/IP). For such stream ports,
|
||||
* make sure the TzCtrl priority is high enough to ensure reliable periodic
|
||||
* execution and transfer of the data, but low enough to avoid disturbing any
|
||||
* time-sensitive functions.
|
||||
*
|
||||
* In Snapshot mode, TzCtrl is only used for the stack usage monitoring and is
|
||||
* not created if stack monitoring is disabled. TRC_CFG_CTRL_TASK_PRIORITY should
|
||||
* be low, to avoid disturbing any time-sensitive tasks.
|
||||
******************************************************************************/
|
||||
#define TRC_CFG_CTRL_TASK_PRIORITY 1
|
||||
|
||||
/*******************************************************************************
|
||||
* Configuration Macro: TRC_CFG_CTRL_TASK_DELAY
|
||||
*
|
||||
* The delay between loops of the TzCtrl task (see TRC_CFG_CTRL_TASK_PRIORITY),
|
||||
* which affects the frequency of the stack monitoring.
|
||||
*
|
||||
* In streaming mode, this also affects the trace data transfer if you are using
|
||||
* a stream port leveraging the internal buffer (like TCP/IP). A shorter delay
|
||||
* increases the CPU load of TzCtrl somewhat, but may improve the performance of
|
||||
* of the trace streaming, especially if the trace buffer is small.
|
||||
******************************************************************************/
|
||||
#define TRC_CFG_CTRL_TASK_DELAY 10
|
||||
|
||||
/*******************************************************************************
|
||||
* Configuration Macro: TRC_CFG_CTRL_TASK_STACK_SIZE
|
||||
*
|
||||
* The stack size of the Tracealyzer Control (TzCtrl) task.
|
||||
* See TRC_CFG_CTRL_TASK_PRIORITY for further information about TzCtrl.
|
||||
******************************************************************************/
|
||||
#define TRC_CFG_CTRL_TASK_STACK_SIZE (configMINIMAL_STACK_SIZE * 2)
|
||||
|
||||
/*******************************************************************************
|
||||
* Configuration Macro: TRC_CFG_RECORDER_BUFFER_ALLOCATION
|
||||
*
|
||||
* Specifies how the recorder buffer is allocated (also in case of streaming, in
|
||||
* port using the recorder's internal temporary buffer)
|
||||
*
|
||||
* Values:
|
||||
* TRC_RECORDER_BUFFER_ALLOCATION_STATIC - Static allocation (internal)
|
||||
* TRC_RECORDER_BUFFER_ALLOCATION_DYNAMIC - Malloc in vTraceEnable
|
||||
* TRC_RECORDER_BUFFER_ALLOCATION_CUSTOM - Use vTraceSetRecorderDataBuffer
|
||||
*
|
||||
* Static and dynamic mode does the allocation for you, either in compile time
|
||||
* (static) or in runtime (malloc).
|
||||
* The custom mode allows you to control how and where the allocation is made,
|
||||
* for details see TRC_ALLOC_CUSTOM_BUFFER and vTraceSetRecorderDataBuffer().
|
||||
******************************************************************************/
|
||||
#define TRC_CFG_RECORDER_BUFFER_ALLOCATION TRC_RECORDER_BUFFER_ALLOCATION_STATIC
|
||||
|
||||
/******************************************************************************
|
||||
* TRC_CFG_MAX_ISR_NESTING
|
||||
*
|
||||
* Defines how many levels of interrupt nesting the recorder can handle, in
|
||||
* case multiple ISRs are traced and ISR nesting is possible. If this
|
||||
* is exceeded, the particular ISR will not be traced and the recorder then
|
||||
* logs an error message. This setting is used to allocate an internal stack
|
||||
* for keeping track of the previous execution context (4 byte per entry).
|
||||
*
|
||||
* This value must be a non-zero positive constant, at least 1.
|
||||
*
|
||||
* Default value: 8
|
||||
*****************************************************************************/
|
||||
#define TRC_CFG_MAX_ISR_NESTING 16
|
||||
|
||||
/******************************************************************************
|
||||
* TRC_CFG_ACKNOWLEDGE_QUEUE_SET_SEND
|
||||
*
|
||||
* When using FreeRTOS v10.3.0 or v10.3.1, please make sure that the trace
|
||||
* point in prvNotifyQueueSetContainer() in queue.c is renamed from
|
||||
* traceQUEUE_SEND to traceQUEUE_SET_SEND in order to tell them apart from
|
||||
* other traceQUEUE_SEND trace points. Then set this to TRC_ACKNOWLEDGED.
|
||||
*****************************************************************************/
|
||||
#define TRC_CFG_ACKNOWLEDGE_QUEUE_SET_SEND 0 /* TRC_ACKNOWLEDGED */
|
||||
|
||||
/* Specific configuration, depending on Streaming/Snapshot mode */
|
||||
#if (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_SNAPSHOT)
|
||||
#include "trcSnapshotConfig.h"
|
||||
#elif (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING)
|
||||
#include "trcStreamingConfig.h"
|
||||
#endif
|
||||
|
||||
/* << EST: additional configuration item */
|
||||
/******************************************************************************
|
||||
* TRC_CFG_TRACE_DESCRIPTION
|
||||
*
|
||||
* Macro which should be defined as a string.
|
||||
*
|
||||
* This string is stored in the trace and displayed in Tracealyzer. Can be
|
||||
* used to store, e.g., system version or build date. This is also used to store
|
||||
* internal error messages from the recorder, which if occurs overwrites the
|
||||
* value defined here. This may be maximum 256 chars.
|
||||
*****************************************************************************/
|
||||
#define TRC_CFG_TRACE_DESCRIPTION "FreeRTOS+Trace"
|
||||
|
||||
/* << EST: additional configuration item */
|
||||
/******************************************************************************
|
||||
* TRC_CFG_TRACE_DESCRIPTION_MAX_LENGTH
|
||||
*
|
||||
* The maximum length (including zero termination) for the TRC_CFG_TRACE_DESCRIPTION
|
||||
* string. Since this string also is used for internal error messages from the
|
||||
* recorder do not make it too short, as this may truncate the error messages.
|
||||
* Default is 80.
|
||||
* Maximum allowed length is 256 - the trace will fail to load if longer.
|
||||
*****************************************************************************/
|
||||
#define TRC_CFG_TRACE_DESCRIPTION_MAX_LENGTH 80
|
||||
|
||||
/******************************************************************************
|
||||
* TRC_CFG_INCLUDE_OBJECT_DELETE
|
||||
*
|
||||
* Macro which should be defined as either zero (0) or one (1).
|
||||
*
|
||||
* This must be enabled (1) if tasks, queues or other
|
||||
* traced kernel objects are deleted at runtime. If no deletes are made, this
|
||||
* can be set to 0 in order to exclude the delete-handling code.
|
||||
*
|
||||
* Default value is 1.
|
||||
*****************************************************************************/
|
||||
#define TRC_CFG_INCLUDE_OBJECT_DELETE 1
|
||||
|
||||
/******************************************************************************
|
||||
* TRC_CFG_INCLUDE_QUEUE_EVENTS
|
||||
*
|
||||
* Macro which should be defined as either zero (0) or one (1).
|
||||
*
|
||||
* This must be enabled (1) for recording queue events.
|
||||
*
|
||||
* Default value is 1.
|
||||
*****************************************************************************/
|
||||
#define TRC_CFG_INCLUDE_QUEUE_EVENTS 1
|
||||
/* << EST: end additional configuration item */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _TRC_CONFIG_H */
|
||||
|
||||
378
pico-sensor/McuLib/TraceRecorder/config/trcSnapshotConfig.h
Normal file
378
pico-sensor/McuLib/TraceRecorder/config/trcSnapshotConfig.h
Normal file
@@ -0,0 +1,378 @@
|
||||
/*******************************************************************************
|
||||
* Trace Recorder Library for Tracealyzer v4.4.1
|
||||
* Percepio AB, www.percepio.com
|
||||
*
|
||||
* trcSnapshotConfig.h
|
||||
*
|
||||
* Configuration parameters for trace recorder library in snapshot mode.
|
||||
* Read more at http://percepio.com/2016/10/05/rtos-tracing/
|
||||
*
|
||||
* Terms of Use
|
||||
* This file is part of the trace recorder library (RECORDER), which is the
|
||||
* intellectual property of Percepio AB (PERCEPIO) and provided under a
|
||||
* license as follows.
|
||||
* The RECORDER may be used free of charge for the purpose of recording data
|
||||
* intended for analysis in PERCEPIO products. It may not be used or modified
|
||||
* for other purposes without explicit permission from PERCEPIO.
|
||||
* You may distribute the RECORDER in its original source code form, assuming
|
||||
* this text (terms of use, disclaimer, copyright notice) is unchanged. You are
|
||||
* allowed to distribute the RECORDER with minor modifications intended for
|
||||
* configuration or porting of the RECORDER, e.g., to allow using it on a
|
||||
* specific processor, processor family or with a specific communication
|
||||
* interface. Any such modifications should be documented directly below
|
||||
* this comment block.
|
||||
*
|
||||
* Disclaimer
|
||||
* The RECORDER is being delivered to you AS IS and PERCEPIO makes no warranty
|
||||
* as to its use or performance. PERCEPIO does not and cannot warrant the
|
||||
* performance or results you may obtain by using the RECORDER or documentation.
|
||||
* PERCEPIO make no warranties, express or implied, as to noninfringement of
|
||||
* third party rights, merchantability, or fitness for any particular purpose.
|
||||
* In no event will PERCEPIO, its technology partners, or distributors be liable
|
||||
* to you for any consequential, incidental or special damages, including any
|
||||
* lost profits or lost savings, even if a representative of PERCEPIO has been
|
||||
* advised of the possibility of such damages, or for any claim by any third
|
||||
* party. Some jurisdictions do not allow the exclusion or limitation of
|
||||
* incidental, consequential or special damages, or the exclusion of implied
|
||||
* warranties or limitations on how long an implied warranty may last, so the
|
||||
* above limitations may not apply to you.
|
||||
*
|
||||
* Tabs are used for indent in this file (1 tab = 4 spaces)
|
||||
*
|
||||
* Copyright Percepio AB, 2018.
|
||||
* www.percepio.com
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef TRC_SNAPSHOT_CONFIG_H
|
||||
#define TRC_SNAPSHOT_CONFIG_H
|
||||
|
||||
#define TRC_SNAPSHOT_MODE_RING_BUFFER (0x01)
|
||||
#define TRC_SNAPSHOT_MODE_STOP_WHEN_FULL (0x02)
|
||||
|
||||
/******************************************************************************
|
||||
* TRC_CFG_SNAPSHOT_MODE
|
||||
*
|
||||
* Macro which should be defined as one of:
|
||||
* - TRC_SNAPSHOT_MODE_RING_BUFFER
|
||||
* - TRC_SNAPSHOT_MODE_STOP_WHEN_FULL
|
||||
* Default is TRC_SNAPSHOT_MODE_RING_BUFFER.
|
||||
*
|
||||
* With TRC_CFG_SNAPSHOT_MODE set to TRC_SNAPSHOT_MODE_RING_BUFFER, the
|
||||
* events are stored in a ring buffer, i.e., where the oldest events are
|
||||
* overwritten when the buffer becomes full. This allows you to get the last
|
||||
* events leading up to an interesting state, e.g., an error, without having
|
||||
* to store the whole run since startup.
|
||||
*
|
||||
* When TRC_CFG_SNAPSHOT_MODE is TRC_SNAPSHOT_MODE_STOP_WHEN_FULL, the
|
||||
* recording is stopped when the buffer becomes full. This is useful for
|
||||
* recording events following a specific state, e.g., the startup sequence.
|
||||
*****************************************************************************/
|
||||
#define TRC_CFG_SNAPSHOT_MODE TRC_SNAPSHOT_MODE_RING_BUFFER
|
||||
|
||||
/*******************************************************************************
|
||||
* TRC_CFG_EVENT_BUFFER_SIZE
|
||||
*
|
||||
* Macro which should be defined as an integer value.
|
||||
*
|
||||
* This defines the capacity of the event buffer, i.e., the number of records
|
||||
* it may store. Most events use one record (4 byte), although some events
|
||||
* require multiple 4-byte records. You should adjust this to the amount of RAM
|
||||
* available in the target system.
|
||||
*
|
||||
* Default value is 1000, which means that 4000 bytes is allocated for the
|
||||
* event buffer.
|
||||
******************************************************************************/
|
||||
#define TRC_CFG_EVENT_BUFFER_SIZE 1000
|
||||
|
||||
/*******************************************************************************
|
||||
* TRC_CFG_NTASK, TRC_CFG_NISR, TRC_CFG_NQUEUE, TRC_CFG_NSEMAPHORE...
|
||||
*
|
||||
* A group of macros which should be defined as integer values, zero or larger.
|
||||
*
|
||||
* These define the capacity of the Object Property Table, i.e., the maximum
|
||||
* number of objects active at any given point, within each object class (e.g.,
|
||||
* task, queue, semaphore, ...).
|
||||
*
|
||||
* If tasks or other objects are deleted in your system, this
|
||||
* setting does not limit the total amount of objects created, only the number
|
||||
* of objects that have been successfully created but not yet deleted.
|
||||
*
|
||||
* Using too small values will cause vTraceError to be called, which stores an
|
||||
* error message in the trace that is shown when opening the trace file. The
|
||||
* error message can also be retrieved using xTraceGetLastError.
|
||||
*
|
||||
* It can be wise to start with large values for these constants,
|
||||
* unless you are very confident on these numbers. Then do a recording and
|
||||
* check the actual usage by selecting View menu -> Trace Details ->
|
||||
* Resource Usage -> Object Table.
|
||||
******************************************************************************/
|
||||
#define TRC_CFG_NTASK 15
|
||||
#define TRC_CFG_NISR 5
|
||||
#define TRC_CFG_NQUEUE 10
|
||||
#define TRC_CFG_NSEMAPHORE 10
|
||||
#define TRC_CFG_NMUTEX 10
|
||||
#define TRC_CFG_NTIMER 5
|
||||
#define TRC_CFG_NEVENTGROUP 5
|
||||
#define TRC_CFG_NSTREAMBUFFER 5
|
||||
#define TRC_CFG_NMESSAGEBUFFER 5
|
||||
|
||||
/******************************************************************************
|
||||
* TRC_CFG_INCLUDE_FLOAT_SUPPORT
|
||||
*
|
||||
* Macro which should be defined as either zero (0) or one (1).
|
||||
*
|
||||
* If this is zero (0), the support for logging floating point values in
|
||||
* vTracePrintF is stripped out, in case floating point values are not used or
|
||||
* supported by the platform used.
|
||||
*
|
||||
* Floating point values are only used in vTracePrintF and its subroutines, to
|
||||
* allow for storing float (%f) or double (%lf) arguments.
|
||||
*
|
||||
* vTracePrintF can be used with integer and string arguments in either case.
|
||||
*
|
||||
* Default value is 0.
|
||||
*****************************************************************************/
|
||||
#define TRC_CFG_INCLUDE_FLOAT_SUPPORT 0
|
||||
|
||||
/*******************************************************************************
|
||||
* TRC_CFG_SYMBOL_TABLE_SIZE
|
||||
*
|
||||
* Macro which should be defined as an integer value.
|
||||
*
|
||||
* This defines the capacity of the symbol table, in bytes. This symbol table
|
||||
* stores User Events labels and names of deleted tasks, queues, or other kernel
|
||||
* objects. If you don't use User Events or delete any kernel
|
||||
* objects you set this to a very low value. The minimum recommended value is 4.
|
||||
* A size of zero (0) is not allowed since a zero-sized array may result in a
|
||||
* 32-bit pointer, i.e., using 4 bytes rather than 0.
|
||||
*
|
||||
* Default value is 800.
|
||||
******************************************************************************/
|
||||
#define TRC_CFG_SYMBOL_TABLE_SIZE 800
|
||||
|
||||
#if (TRC_CFG_SYMBOL_TABLE_SIZE == 0)
|
||||
#error "TRC_CFG_SYMBOL_TABLE_SIZE may not be zero!"
|
||||
#endif
|
||||
|
||||
/******************************************************************************
|
||||
* TRC_CFG_NAME_LEN_TASK, TRC_CFG_NAME_LEN_QUEUE, ...
|
||||
*
|
||||
* Macros that specify the maximum lengths (number of characters) for names of
|
||||
* kernel objects, such as tasks and queues. If longer names are used, they will
|
||||
* be truncated when stored in the recorder.
|
||||
*****************************************************************************/
|
||||
#define TRC_CFG_NAME_LEN_TASK 15
|
||||
#define TRC_CFG_NAME_LEN_ISR 15
|
||||
#define TRC_CFG_NAME_LEN_QUEUE 15
|
||||
#define TRC_CFG_NAME_LEN_SEMAPHORE 15
|
||||
#define TRC_CFG_NAME_LEN_MUTEX 15
|
||||
#define TRC_CFG_NAME_LEN_TIMER 15
|
||||
#define TRC_CFG_NAME_LEN_EVENTGROUP 15
|
||||
#define TRC_CFG_NAME_LEN_STREAMBUFFER 15
|
||||
#define TRC_CFG_NAME_LEN_MESSAGEBUFFER 15
|
||||
|
||||
/******************************************************************************
|
||||
*** ADVANCED SETTINGS ********************************************************
|
||||
******************************************************************************
|
||||
* The remaining settings are not necessary to modify but allows for optimizing
|
||||
* the recorder setup for your specific needs, e.g., to exclude events that you
|
||||
* are not interested in, in order to get longer traces.
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
* TRC_CFG_HEAP_SIZE_BELOW_16M
|
||||
*
|
||||
* An integer constant that can be used to reduce the buffer usage of memory
|
||||
* allocation events (malloc/free). This value should be 1 if the heap size is
|
||||
* below 16 MB (2^24 byte), and you can live with reported addresses showing the
|
||||
* lower 24 bits only. If 0, you get the full 32-bit addresses.
|
||||
*
|
||||
* Default value is 0.
|
||||
******************************************************************************/
|
||||
#define TRC_CFG_HEAP_SIZE_BELOW_16M 0
|
||||
|
||||
/******************************************************************************
|
||||
* TRC_CFG_USE_IMPLICIT_IFE_RULES
|
||||
*
|
||||
* Macro which should be defined as either zero (0) or one (1).
|
||||
* Default is 1.
|
||||
*
|
||||
* Tracealyzer groups the events into "instances" based on Instance Finish
|
||||
* Events (IFEs), produced either by default rules or calls to the recorder
|
||||
* functions vTraceInstanceFinishedNow and vTraceInstanceFinishedNext.
|
||||
*
|
||||
* If TRC_CFG_USE_IMPLICIT_IFE_RULES is one (1), the default IFE rules is
|
||||
* used, resulting in a "typical" grouping of events into instances.
|
||||
* If these rules don't give appropriate instances in your case, you can
|
||||
* override the default rules using vTraceInstanceFinishedNow/Next for one
|
||||
* or several tasks. The default IFE rules are then disabled for those tasks.
|
||||
*
|
||||
* If TRC_CFG_USE_IMPLICIT_IFE_RULES is zero (0), the implicit IFE rules are
|
||||
* disabled globally. You must then call vTraceInstanceFinishedNow or
|
||||
* vTraceInstanceFinishedNext to manually group the events into instances,
|
||||
* otherwise the tasks will appear a single long instance.
|
||||
*
|
||||
* The default IFE rules count the following events as "instance finished":
|
||||
* - Task delay, delay until
|
||||
* - Task suspend
|
||||
* - Blocking on "input" operations, i.e., when the task is waiting for the
|
||||
* next a message/signal/event. But only if this event is blocking.
|
||||
*
|
||||
* For details, see trcSnapshotKernelPort.h and look for references to the
|
||||
* macro trcKERNEL_HOOKS_SET_TASK_INSTANCE_FINISHED.
|
||||
*****************************************************************************/
|
||||
#define TRC_CFG_USE_IMPLICIT_IFE_RULES 1
|
||||
|
||||
/******************************************************************************
|
||||
* TRC_CFG_USE_16BIT_OBJECT_HANDLES
|
||||
*
|
||||
* Macro which should be defined as either zero (0) or one (1).
|
||||
*
|
||||
* If set to 0 (zero), the recorder uses 8-bit handles to identify kernel
|
||||
* objects such as tasks and queues. This limits the supported number of
|
||||
* concurrently active objects to 255 of each type (tasks, queues, mutexes,
|
||||
* etc.) Note: 255, not 256, since handle 0 is reserved.
|
||||
*
|
||||
* If set to 1 (one), the recorder uses 16-bit handles to identify kernel
|
||||
* objects such as tasks and queues. This limits the supported number of
|
||||
* concurrent objects to 65535 of each type (object class). However, since the
|
||||
* object property table is limited to 64 KB, the practical limit is about
|
||||
* 3000 objects in total.
|
||||
*
|
||||
* Default is 0 (8-bit handles)
|
||||
*
|
||||
* NOTE: An object with handle above 255 will use an extra 4-byte record in
|
||||
* the event buffer whenever the object is referenced. Moreover, some internal
|
||||
* tables in the recorder gets slightly larger when using 16-bit handles.
|
||||
*****************************************************************************/
|
||||
#define TRC_CFG_USE_16BIT_OBJECT_HANDLES 0
|
||||
|
||||
/******************************************************************************
|
||||
* TRC_CFG_USE_TRACE_ASSERT
|
||||
*
|
||||
* Macro which should be defined as either zero (0) or one (1).
|
||||
* Default is 1.
|
||||
*
|
||||
* If this is one (1), the TRACE_ASSERT macro (used at various locations in the
|
||||
* trace recorder) will verify that a relevant condition is true.
|
||||
* If the condition is false, prvTraceError() will be called, which stops the
|
||||
* recording and stores an error message that is displayed when opening the
|
||||
* trace in Tracealyzer.
|
||||
*
|
||||
* This is used on several places in the recorder code for sanity checks on
|
||||
* parameters. Can be switched off to reduce the footprint of the tracing, but
|
||||
* we recommend to have it enabled initially.
|
||||
*****************************************************************************/
|
||||
#define TRC_CFG_USE_TRACE_ASSERT 1
|
||||
|
||||
/*******************************************************************************
|
||||
* TRC_CFG_USE_SEPARATE_USER_EVENT_BUFFER
|
||||
*
|
||||
* Macro which should be defined as an integer value.
|
||||
*
|
||||
* Set TRC_CFG_USE_SEPARATE_USER_EVENT_BUFFER to 1 to enable the
|
||||
* separate user event buffer (UB).
|
||||
* In this mode, user events are stored separately from other events,
|
||||
* e.g., RTOS events. Thereby you can get a much longer history of
|
||||
* user events as they don't need to share the buffer space with more
|
||||
* frequent events.
|
||||
*
|
||||
* The UB is typically used with the snapshot ring-buffer mode, so the
|
||||
* recording can continue when the main buffer gets full. And since the
|
||||
* main buffer then overwrites the earliest events, Tracealyzer displays
|
||||
* "Unknown Actor" instead of task scheduling for periods with UB data only.
|
||||
*
|
||||
* In UB mode, user events are structured as UB channels, which contains
|
||||
* a channel name and a default format string. Register a UB channel using
|
||||
* xTraceRegisterUBChannel.
|
||||
*
|
||||
* Events and data arguments are written using vTraceUBEvent and
|
||||
* vTraceUBData. They are designed to provide efficient logging of
|
||||
* repeating events, using the same format string within each channel.
|
||||
*
|
||||
* Examples:
|
||||
*
|
||||
* traceString chn1 = xTraceRegisterString("Channel 1");
|
||||
* traceString fmt1 = xTraceRegisterString("Event!");
|
||||
* traceUBChannel UBCh1 = xTraceRegisterUBChannel(chn1, fmt1);
|
||||
*
|
||||
* traceString chn2 = xTraceRegisterString("Channel 2");
|
||||
* traceString fmt2 = xTraceRegisterString("X: %d, Y: %d");
|
||||
* traceUBChannel UBCh2 = xTraceRegisterUBChannel(chn2, fmt2);
|
||||
*
|
||||
* // Result in "[Channel 1] Event!"
|
||||
* vTraceUBEvent(UBCh1);
|
||||
*
|
||||
* // Result in "[Channel 2] X: 23, Y: 19"
|
||||
* vTraceUBData(UBCh2, 23, 19);
|
||||
*
|
||||
* You can also use the other user event functions, like vTracePrintF.
|
||||
* as they are then rerouted to the UB instead of the main event buffer.
|
||||
* vTracePrintF then looks up the correct UB channel based on the
|
||||
* provided channel name and format string, or creates a new UB channel
|
||||
* if no match is found. The format string should therefore not contain
|
||||
* "random" messages but mainly format specifiers. Random strings should
|
||||
* be stored using %s and with the string as an argument.
|
||||
*
|
||||
* // Creates a new UB channel ("Channel 2", "%Z: %d")
|
||||
* vTracePrintF(chn2, "%Z: %d", value1);
|
||||
*
|
||||
* // Finds the existing UB channel
|
||||
* vTracePrintF(chn2, "%Z: %d", value2);
|
||||
|
||||
******************************************************************************/
|
||||
#define TRC_CFG_USE_SEPARATE_USER_EVENT_BUFFER 0
|
||||
|
||||
/*******************************************************************************
|
||||
* TRC_CFG_SEPARATE_USER_EVENT_BUFFER_SIZE
|
||||
*
|
||||
* Macro which should be defined as an integer value.
|
||||
*
|
||||
* This defines the capacity of the user event buffer (UB), in number of slots.
|
||||
* A single user event can use multiple slots, depending on the arguments.
|
||||
*
|
||||
* Only applicable if TRC_CFG_USE_SEPARATE_USER_EVENT_BUFFER is 1.
|
||||
******************************************************************************/
|
||||
#define TRC_CFG_SEPARATE_USER_EVENT_BUFFER_SIZE 200
|
||||
|
||||
/*******************************************************************************
|
||||
* TRC_CFG_UB_CHANNELS
|
||||
*
|
||||
* Macro which should be defined as an integer value.
|
||||
*
|
||||
* This defines the number of User Event Buffer Channels (UB channels).
|
||||
* These are used to structure the events when using the separate user
|
||||
* event buffer, and contains both a User Event Channel (the name) and
|
||||
* a default format string for the channel.
|
||||
*
|
||||
* Only applicable if TRC_CFG_USE_SEPARATE_USER_EVENT_BUFFER is 1.
|
||||
******************************************************************************/
|
||||
#define TRC_CFG_UB_CHANNELS 32
|
||||
|
||||
/*******************************************************************************
|
||||
* TRC_CFG_ISR_TAILCHAINING_THRESHOLD
|
||||
*
|
||||
* Macro which should be defined as an integer value.
|
||||
*
|
||||
* If tracing multiple ISRs, this setting allows for accurate display of the
|
||||
* context-switching also in cases when the ISRs execute in direct sequence.
|
||||
*
|
||||
* vTraceStoreISREnd normally assumes that the ISR returns to the previous
|
||||
* context, i.e., a task or a preempted ISR. But if another traced ISR
|
||||
* executes in direct sequence, Tracealyzer may incorrectly display a minimal
|
||||
* fragment of the previous context in between the ISRs.
|
||||
*
|
||||
* By using TRC_CFG_ISR_TAILCHAINING_THRESHOLD you can avoid this. This is
|
||||
* however a threshold value that must be measured for your specific setup.
|
||||
* See http://percepio.com/2014/03/21/isr_tailchaining_threshold/
|
||||
*
|
||||
* The default setting is 0, meaning "disabled" and that you may get an
|
||||
* extra fragments of the previous context in between tail-chained ISRs.
|
||||
*
|
||||
* Note: This setting has separate definitions in trcSnapshotConfig.h and
|
||||
* trcStreamingConfig.h, since it is affected by the recorder mode.
|
||||
******************************************************************************/
|
||||
#define TRC_CFG_ISR_TAILCHAINING_THRESHOLD 0
|
||||
|
||||
#endif /*TRC_SNAPSHOT_CONFIG_H*/
|
||||
|
||||
145
pico-sensor/McuLib/TraceRecorder/config/trcStreamingConfig.h
Normal file
145
pico-sensor/McuLib/TraceRecorder/config/trcStreamingConfig.h
Normal file
@@ -0,0 +1,145 @@
|
||||
/*******************************************************************************
|
||||
* Trace Recorder Library for Tracealyzer v4.4.1
|
||||
* Percepio AB, www.percepio.com
|
||||
*
|
||||
* trcStreamingConfig.h
|
||||
*
|
||||
* Configuration parameters for the trace recorder library in streaming mode.
|
||||
* Read more at http://percepio.com/2016/10/05/rtos-tracing/
|
||||
*
|
||||
* Terms of Use
|
||||
* This file is part of the trace recorder library (RECORDER), which is the
|
||||
* intellectual property of Percepio AB (PERCEPIO) and provided under a
|
||||
* license as follows.
|
||||
* The RECORDER may be used free of charge for the purpose of recording data
|
||||
* intended for analysis in PERCEPIO products. It may not be used or modified
|
||||
* for other purposes without explicit permission from PERCEPIO.
|
||||
* You may distribute the RECORDER in its original source code form, assuming
|
||||
* this text (terms of use, disclaimer, copyright notice) is unchanged. You are
|
||||
* allowed to distribute the RECORDER with minor modifications intended for
|
||||
* configuration or porting of the RECORDER, e.g., to allow using it on a
|
||||
* specific processor, processor family or with a specific communication
|
||||
* interface. Any such modifications should be documented directly below
|
||||
* this comment block.
|
||||
*
|
||||
* Disclaimer
|
||||
* The RECORDER is being delivered to you AS IS and PERCEPIO makes no warranty
|
||||
* as to its use or performance. PERCEPIO does not and cannot warrant the
|
||||
* performance or results you may obtain by using the RECORDER or documentation.
|
||||
* PERCEPIO make no warranties, express or implied, as to noninfringement of
|
||||
* third party rights, merchantability, or fitness for any particular purpose.
|
||||
* In no event will PERCEPIO, its technology partners, or distributors be liable
|
||||
* to you for any consequential, incidental or special damages, including any
|
||||
* lost profits or lost savings, even if a representative of PERCEPIO has been
|
||||
* advised of the possibility of such damages, or for any claim by any third
|
||||
* party. Some jurisdictions do not allow the exclusion or limitation of
|
||||
* incidental, consequential or special damages, or the exclusion of implied
|
||||
* warranties or limitations on how long an implied warranty may last, so the
|
||||
* above limitations may not apply to you.
|
||||
*
|
||||
* Tabs are used for indent in this file (1 tab = 4 spaces)
|
||||
*
|
||||
* Copyright Percepio AB, 2018.
|
||||
* www.percepio.com
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef TRC_STREAMING_CONFIG_H
|
||||
#define TRC_STREAMING_CONFIG_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*******************************************************************************
|
||||
* Configuration Macro: TRC_CFG_SYMBOL_TABLE_SLOTS
|
||||
*
|
||||
* The maximum number of symbols names that can be stored. This includes:
|
||||
* - Task names
|
||||
* - Named ISRs (vTraceSetISRProperties)
|
||||
* - Named kernel objects (vTraceStoreKernelObjectName)
|
||||
* - User event channels (xTraceRegisterString)
|
||||
*
|
||||
* If this value is too small, not all symbol names will be stored and the
|
||||
* trace display will be affected. In that case, there will be warnings
|
||||
* (as User Events) from TzCtrl task, that monitors this.
|
||||
******************************************************************************/
|
||||
#define TRC_CFG_SYMBOL_TABLE_SLOTS 40
|
||||
|
||||
/*******************************************************************************
|
||||
* Configuration Macro: TRC_CFG_SYMBOL_MAX_LENGTH
|
||||
*
|
||||
* The maximum length of symbol names, including:
|
||||
* - Task names
|
||||
* - Named ISRs (vTraceSetISRProperties)
|
||||
* - Named kernel objects (vTraceStoreKernelObjectName)
|
||||
* - User event channel names (xTraceRegisterString)
|
||||
*
|
||||
* If longer symbol names are used, they will be truncated by the recorder,
|
||||
* which will affect the trace display. In that case, there will be warnings
|
||||
* (as User Events) from TzCtrl task, that monitors this.
|
||||
******************************************************************************/
|
||||
#define TRC_CFG_SYMBOL_MAX_LENGTH 25
|
||||
|
||||
/*******************************************************************************
|
||||
* Configuration Macro: TRC_CFG_OBJECT_DATA_SLOTS
|
||||
*
|
||||
* The maximum number of object data entries (used for task priorities) that can
|
||||
* be stored at the same time. Must be sufficient for all tasks, otherwise there
|
||||
* will be warnings (as User Events) from TzCtrl task, that monitors this.
|
||||
******************************************************************************/
|
||||
#define TRC_CFG_OBJECT_DATA_SLOTS 40
|
||||
|
||||
/*******************************************************************************
|
||||
* Configuration Macro: TRC_CFG_PAGED_EVENT_BUFFER_PAGE_COUNT
|
||||
*
|
||||
* Specifies the number of pages used by the paged event buffer.
|
||||
* This may need to be increased if there are a lot of missed events.
|
||||
*
|
||||
* Note: not used by the J-Link RTT stream port (see trcStreamingPort.h instead)
|
||||
******************************************************************************/
|
||||
#define TRC_CFG_PAGED_EVENT_BUFFER_PAGE_COUNT 10
|
||||
|
||||
/*******************************************************************************
|
||||
* Configuration Macro: TRC_CFG_PAGED_EVENT_BUFFER_PAGE_SIZE
|
||||
*
|
||||
* Specifies the size of each page in the paged event buffer. This can be tuned
|
||||
* to match any internal low-level buffers used by the streaming interface, like
|
||||
* the Ethernet MTU (Maximum Transmission Unit). However, since the currently
|
||||
* active page can't be transfered, having more but smaller pages is more
|
||||
* efficient with respect memory usage, than having a few large pages.
|
||||
*
|
||||
* Note: not used by the J-Link RTT stream port (see trcStreamingPort.h instead)
|
||||
******************************************************************************/
|
||||
#define TRC_CFG_PAGED_EVENT_BUFFER_PAGE_SIZE 500
|
||||
|
||||
/*******************************************************************************
|
||||
* TRC_CFG_ISR_TAILCHAINING_THRESHOLD
|
||||
*
|
||||
* Macro which should be defined as an integer value.
|
||||
*
|
||||
* If tracing multiple ISRs, this setting allows for accurate display of the
|
||||
* context-switching also in cases when the ISRs execute in direct sequence.
|
||||
*
|
||||
* vTraceStoreISREnd normally assumes that the ISR returns to the previous
|
||||
* context, i.e., a task or a preempted ISR. But if another traced ISR
|
||||
* executes in direct sequence, Tracealyzer may incorrectly display a minimal
|
||||
* fragment of the previous context in between the ISRs.
|
||||
*
|
||||
* By using TRC_CFG_ISR_TAILCHAINING_THRESHOLD you can avoid this. This is
|
||||
* however a threshold value that must be measured for your specific setup.
|
||||
* See http://percepio.com/2014/03/21/isr_tailchaining_threshold/
|
||||
*
|
||||
* The default setting is 0, meaning "disabled" and that you may get an
|
||||
* extra fragments of the previous context in between tail-chained ISRs.
|
||||
*
|
||||
* Note: This setting has separate definitions in trcSnapshotConfig.h and
|
||||
* trcStreamingConfig.h, since it is affected by the recorder mode.
|
||||
******************************************************************************/
|
||||
#define TRC_CFG_ISR_TAILCHAINING_THRESHOLD 0
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* TRC_STREAMING_CONFIG_H */
|
||||
|
||||
422
pico-sensor/McuLib/TraceRecorder/include/trcExtensions.h
Normal file
422
pico-sensor/McuLib/TraceRecorder/include/trcExtensions.h
Normal file
@@ -0,0 +1,422 @@
|
||||
/*******************************************************************************
|
||||
* Trace Recorder Library for Tracealyzer v4.4.1
|
||||
* Percepio AB, www.percepio.com
|
||||
*
|
||||
* trcExtensions.h
|
||||
*
|
||||
* The extension interface of the recorder library, allowing for tracing
|
||||
* function calls to any API without modifications. All that is needed is a
|
||||
* single #include line in the .c files calling the API.
|
||||
*
|
||||
* This can be used to provide more detailed traces, including calls to e.g.
|
||||
* middleware, drivers or important APIs in your application code. This can be
|
||||
* applied selectively to specified functions and may include selected
|
||||
* parameters as well as the return value.
|
||||
*
|
||||
* Unlike the "User Event" concept, an extension is intended for systematic use
|
||||
* and can benefit from all powerful features in Tracealyzer via host-side XML
|
||||
* files that configure how Tracealyzer should interpret each event.
|
||||
*
|
||||
* Extensions are self-contained and easy to integrate, which makes them
|
||||
* convenient for distribution. Software vendors can thus develop such
|
||||
* extensions and provide trace support for their users.
|
||||
*
|
||||
* An extension consists of two files:
|
||||
*
|
||||
* - An extension header file (e.g. "api.tzext.h") - this defines how to
|
||||
* trace the API function calls.
|
||||
*
|
||||
* - An XML file for the Tracealyzer application (e.g. "api-v1.0.0.xml").
|
||||
* This needs to match the tracing setup in your extension header file.
|
||||
*
|
||||
*
|
||||
* USAGE
|
||||
*
|
||||
* This description assumes you already have the extension files for the APIs you
|
||||
* like to trace. To include them, follow these steps:
|
||||
*
|
||||
* 1. Update trcExtensions.h with respect to:
|
||||
*
|
||||
* 1.1. TRC_CFG_EXTENSION_COUNT: The number of extensions to enable (max 4).
|
||||
*
|
||||
* 1.2. The name(s) of the extension header file(s) to include.
|
||||
*
|
||||
* 1.3. The Extension Prefix, i.e., the first part of the definition names
|
||||
* used in each header file.
|
||||
*
|
||||
* 2. Add #include "trcExtensions.h" in all .c files calling the API:
|
||||
*
|
||||
* #include ...
|
||||
* #include "api.h" // The API you like to trace
|
||||
* #include ...
|
||||
* #include "trcExtensions.h"
|
||||
*
|
||||
* We recommend to put this as the LAST #include statement.
|
||||
*
|
||||
* HOWEVER, don't include "trcExtensions.h" in the .c files containing the
|
||||
* functions you intend to trace. The compiler will then complain about
|
||||
* multiple definitions of the trace wrapper function.
|
||||
*
|
||||
* 3. Copy the extension XML file to the "Tracealyzer 4/cfg" folder.
|
||||
* On Windows this is typically
|
||||
*
|
||||
* C:\Program Files\Percepio\Tracealyzer 4\cfg
|
||||
*
|
||||
*
|
||||
* HOW IT WORKS
|
||||
*
|
||||
* By including "trcExtensions.h" in your .c files, the preprocessor will
|
||||
* redefine all calls of the functions specified in the extension header file.
|
||||
* Calls to those functions will now instead call the "trace wrapper functions"
|
||||
* defined in the extension header. The trace wrapper functions then call the
|
||||
* original function as well as the trace recorder library.
|
||||
*
|
||||
* call foo(a) ----> foo__trace(a) -----> foo(a)
|
||||
* -----> trace recorder library
|
||||
*
|
||||
* Note that the trace wrapper function should have the same declaration as the
|
||||
* original function (apart from the name) and also returns any return value
|
||||
* back to the original caller. So functionally this is completely transparent.
|
||||
*
|
||||
* This works also for calls via function pointers, as the assignments of the
|
||||
* function pointers will be affected, so the function pointers will point to
|
||||
* the trace wrapper function.
|
||||
*
|
||||
* It even works when calling binary libraries, since only the calling code
|
||||
* is modified, not the API itself.
|
||||
*
|
||||
* Extensions include a version code (Major.Minor.Patch), which is registered
|
||||
* in the trace and also part of the XML file name. This way, Tracealyzer
|
||||
* automatically finds the matching XML file, even if you open a old trace
|
||||
* recorded using a earlier version of the extension (e.g. if the API has
|
||||
* changed).
|
||||
*
|
||||
* LIMITATIONS
|
||||
*
|
||||
* The main limitation of this automatic approach is that it only allows for
|
||||
* tracing call between different .c files. Moreover, you can't trace multiple
|
||||
* APIs with calls between them. This since the calling file must include
|
||||
* trcExtensions.h, while the called file must NOT include this.
|
||||
*
|
||||
* It is however possible to get around this limitation. You need to add
|
||||
* #undef lines for each affected function to locally disable the redefinition,
|
||||
* and modify each function call to instead call the trace wrapper function.
|
||||
*
|
||||
* #include "trcExtensions.h"
|
||||
* #undef foo
|
||||
* ...
|
||||
* void foo(int a)
|
||||
* {
|
||||
* ...
|
||||
* }
|
||||
* ...
|
||||
* foo__trace(a); // in another function - call foo and trace it
|
||||
*
|
||||
* These changes can remain in your code if you like, as the trace wrappers
|
||||
* works even if the recorder is disabled.
|
||||
*
|
||||
* MAKING YOUR OWN EXTENSIONS
|
||||
*
|
||||
* Examples are found in the extensions directory. We recommend that you start
|
||||
* by looking at aws_secure_sockets files (.h and .xml) that provides a basic
|
||||
* example. The aws_wifi files provides a more advanced example.
|
||||
* The header files include detailed documentation about how to design them,
|
||||
*
|
||||
* The XML files should have the same name as specified in the NAME property
|
||||
* in the header file, followed by the version, i.e.
|
||||
*
|
||||
* <NAME>-v<VERSION_MAJOR>.<<VERSION_MINOR>.<VERSION_PATCH>.xml
|
||||
*
|
||||
* Documentation for the XML file format is not yet available, but is under
|
||||
* development.
|
||||
*
|
||||
*
|
||||
* Terms of Use
|
||||
* This file is part of the trace recorder library (RECORDER), which is the
|
||||
* intellectual property of Percepio AB (PERCEPIO) and provided under a
|
||||
* license as follows.
|
||||
* The RECORDER may be used free of charge for the purpose of recording data
|
||||
* intended for analysis in PERCEPIO products. It may not be used or modified
|
||||
* for other purposes without explicit permission from PERCEPIO.
|
||||
* You may distribute the RECORDER in its original source code form, assuming
|
||||
* this text (terms of use, disclaimer, copyright notice) is unchanged. You are
|
||||
* allowed to distribute the RECORDER with minor modifications intended for
|
||||
* configuration or porting of the RECORDER, e.g., to allow using it on a
|
||||
* specific processor, processor family or with a specific communication
|
||||
* interface. Any such modifications should be documented directly below
|
||||
* this comment block.
|
||||
*
|
||||
* Disclaimer
|
||||
* The RECORDER is being delivered to you AS IS and PERCEPIO makes no warranty
|
||||
* as to its use or performance. PERCEPIO does not and cannot warrant the
|
||||
* performance or results you may obtain by using the RECORDER or documentation.
|
||||
* PERCEPIO make no warranties, express or implied, as to noninfringement of
|
||||
* third party rights, merchantability, or fitness for any particular purpose.
|
||||
* In no event will PERCEPIO, its technology partners, or distributors be liable
|
||||
* to you for any consequential, incidental or special damages, including any
|
||||
* lost profits or lost savings, even if a representative of PERCEPIO has been
|
||||
* advised of the possibility of such damages, or for any claim by any third
|
||||
* party. Some jurisdictions do not allow the exclusion or limitation of
|
||||
* incidental, consequential or special damages, or the exclusion of implied
|
||||
* warranties or limitations on how long an implied warranty may last, so the
|
||||
* above limitations may not apply to you.
|
||||
*
|
||||
* Tabs are used for indent in this file (1 tab = 4 spaces)
|
||||
*
|
||||
* Copyright Percepio AB, 2018.
|
||||
* www.percepio.com
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef TRCEXTENSIONS_H_
|
||||
#define TRCEXTENSIONS_H_
|
||||
|
||||
#include "trcRecorder.h"
|
||||
|
||||
/******************************************************************************
|
||||
* TRC_CFG_EXTENSION_COUNT
|
||||
*
|
||||
* Defines the number of extensions included in the trace. Maximum 4 extensions
|
||||
* can be included.
|
||||
*
|
||||
* Default value is 0 (extension support disabled).
|
||||
*
|
||||
*****************************************************************************/
|
||||
#define TRC_CFG_EXTENSION_COUNT 0
|
||||
|
||||
/******************************************************************************
|
||||
* TRC_CFG_EXT_MAX_NAME_LEN
|
||||
*
|
||||
* Defines the maximum length of extension name(s), i.e. the <EXTENSION>_NAME
|
||||
* macro(s) in trcExtensions.h.
|
||||
*
|
||||
* This value should will by rounded up to the nearest multiple of 4, and must
|
||||
* not be zero. To disable extension support, see TRC_CFG_EXTENSION_COUNT.
|
||||
*
|
||||
* It is important that this setting is large enough so extension names are
|
||||
* not truncated, otherwise the host-side Tracealyzer application won't be able
|
||||
* to find the corresponding XML file.
|
||||
*
|
||||
* You may adjust this to reduce memory usage, or increase it to allow for
|
||||
* longer extension names.
|
||||
*
|
||||
* Default value is 20.
|
||||
*****************************************************************************/
|
||||
#define TRC_CFG_EXT_MAX_NAME_LEN 20
|
||||
|
||||
/******************************************************************************
|
||||
* TRC_EXTENSION_EVENTCODE_BASE
|
||||
*
|
||||
* The first event code used for the Extension system. This will be the first
|
||||
* event code of the first extension, and other event codes are relative to
|
||||
* this. This can be modified but this is normally not required.
|
||||
*****************************************************************************/
|
||||
#define TRC_EXTENSION_EVENTCODE_BASE 256
|
||||
|
||||
/*** Included Extensions ******************************************************
|
||||
*
|
||||
* Below you specify what extensions to include. For each
|
||||
* extension you must define:
|
||||
*
|
||||
* - HEADER: The header file that defines the trace extension.
|
||||
*
|
||||
* - EXTENSION_PREFIX: The first part of the HEADER definition names.
|
||||
*
|
||||
*****************************************************************************/
|
||||
#define TRC_EXT1_HEADER "aws_secure_sockets.tzext.h"
|
||||
#define TRC_EXT1_PREFIX TRC_EXT_SOCKETS
|
||||
|
||||
#define TRC_EXT2_HEADER "aws_wifi.tzext.h"
|
||||
#define TRC_EXT2_PREFIX TRC_EXT_WIFI
|
||||
|
||||
#define TRC_EXT3_HEADER "Here you specify the header file for Extensions 3."
|
||||
#define TRC_EXT3_PREFIX NOT_DEFINED
|
||||
|
||||
#define TRC_EXT4_HEADER "Here you specify the header file for Extensions 4."
|
||||
#define TRC_EXT4_PREFIX NOT_DEFINED
|
||||
|
||||
/*** Don't modify below ******************************************************/
|
||||
|
||||
#define ROUNDUP4(n) (4*((n+3)/4))
|
||||
|
||||
typedef struct{
|
||||
uint16_t firstEventCode;
|
||||
uint16_t lastEventCode;
|
||||
uint16_t patchVersion;
|
||||
uint8_t minorVersion;
|
||||
uint8_t majorVersion;
|
||||
char name[ROUNDUP4(TRC_CFG_EXT_MAX_NAME_LEN)];
|
||||
} PSFExtensionEntryType;
|
||||
|
||||
typedef struct{
|
||||
uint16_t extensionEntryCount;
|
||||
uint16_t baseEventCode;
|
||||
#if (TRC_CFG_EXTENSION_COUNT > 0)
|
||||
uint8_t extensionEntryNameMaxLength;
|
||||
uint8_t extensionEntrySize;
|
||||
PSFExtensionEntryType extension[TRC_CFG_EXTENSION_COUNT];
|
||||
#endif
|
||||
} PSFExtensionInfoType;
|
||||
|
||||
|
||||
extern PSFExtensionInfoType PSFExtensionInfo;
|
||||
|
||||
#define CAT(a, ...) PRIMITIVE_CAT(a, __VA_ARGS__)
|
||||
#define PRIMITIVE_CAT(a, ...) a ## __VA_ARGS__
|
||||
|
||||
#define TRC_EXT_BASECODE (PSFExtensionInfo.extension[TRC_EXT_NUMBER-1].firstEventCode)
|
||||
|
||||
#if (TRC_CFG_EXTENSION_COUNT >= 1)
|
||||
#ifdef TRC_EXT1_HEADER
|
||||
#define TRC_EXT_NUMBER 1
|
||||
#include TRC_EXT1_HEADER
|
||||
#undef TRC_EXT_NUMBER
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (TRC_CFG_EXTENSION_COUNT >= 2)
|
||||
#ifdef TRC_EXT2_HEADER
|
||||
#define TRC_EXT_NUMBER 2
|
||||
#include TRC_EXT2_HEADER
|
||||
#undef TRC_EXT_NUMBER
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (TRC_CFG_EXTENSION_COUNT >= 3)
|
||||
#ifdef TRC_EXT3_HEADER
|
||||
#define TRC_EXT_NUMBER 3
|
||||
#include TRC_EXT3_HEADER
|
||||
#undef TRC_EXT_NUMBER
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (TRC_CFG_EXTENSION_COUNT == 4)
|
||||
#ifdef TRC_EXT3_HEADER
|
||||
#define TRC_EXT_NUMBER 4
|
||||
#include TRC_EXT4_HEADER
|
||||
#undef TRC_EXT_NUMBER
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define TRC_EXT1_COUNT CAT(TRC_EXT1_PREFIX, _COUNT)
|
||||
#define TRC_EXT2_COUNT CAT(TRC_EXT2_PREFIX, _COUNT)
|
||||
#define TRC_EXT3_COUNT CAT(TRC_EXT3_PREFIX, _COUNT)
|
||||
#define TRC_EXT4_COUNT CAT(TRC_EXT4_PREFIX, _COUNT)
|
||||
|
||||
#define TRC_EXT1_NAME CAT(TRC_EXT1_PREFIX, _NAME)
|
||||
#define TRC_EXT2_NAME CAT(TRC_EXT2_PREFIX, _NAME)
|
||||
#define TRC_EXT3_NAME CAT(TRC_EXT3_PREFIX, _NAME)
|
||||
#define TRC_EXT4_NAME CAT(TRC_EXT4_PREFIX, _NAME)
|
||||
|
||||
#define TRC_EXT1_VERSION_MAJOR CAT(TRC_EXT1_PREFIX, _VERSION_MAJOR)
|
||||
#define TRC_EXT2_VERSION_MAJOR CAT(TRC_EXT2_PREFIX, _VERSION_MAJOR)
|
||||
#define TRC_EXT3_VERSION_MAJOR CAT(TRC_EXT3_PREFIX, _VERSION_MAJOR)
|
||||
#define TRC_EXT4_VERSION_MAJOR CAT(TRC_EXT4_PREFIX, _VERSION_MAJOR)
|
||||
|
||||
#define TRC_EXT1_VERSION_MINOR CAT(TRC_EXT1_PREFIX, _VERSION_MINOR)
|
||||
#define TRC_EXT2_VERSION_MINOR CAT(TRC_EXT2_PREFIX, _VERSION_MINOR)
|
||||
#define TRC_EXT3_VERSION_MINOR CAT(TRC_EXT3_PREFIX, _VERSION_MINOR)
|
||||
#define TRC_EXT4_VERSION_MINOR CAT(TRC_EXT4_PREFIX, _VERSION_MINOR)
|
||||
|
||||
#define TRC_EXT1_VERSION_PATCH CAT(TRC_EXT1_PREFIX, _VERSION_PATCH)
|
||||
#define TRC_EXT2_VERSION_PATCH CAT(TRC_EXT2_PREFIX, _VERSION_PATCH)
|
||||
#define TRC_EXT3_VERSION_PATCH CAT(TRC_EXT3_PREFIX, _VERSION_PATCH)
|
||||
#define TRC_EXT4_VERSION_PATCH CAT(TRC_EXT4_PREFIX, _VERSION_PATCH)
|
||||
|
||||
#if ((TRC_CFG_EXTENSION_COUNT > 4) || (TRC_CFG_EXTENSION_COUNT < 0))
|
||||
#error "TRC_CFG_EXTENSION_COUNT must be in range [0..4]"
|
||||
#endif
|
||||
|
||||
#if (TRC_CFG_EXTENSION_COUNT == 0)
|
||||
#define TRC_EXTENSIONS_DATA
|
||||
#endif
|
||||
|
||||
#if (TRC_CFG_EXTENSION_COUNT == 1)
|
||||
#define TRC_EXTENSIONS_DATA \
|
||||
{ \
|
||||
{ TRC_EXTENSION_EVENTCODE_BASE, \
|
||||
TRC_EXTENSION_EVENTCODE_BASE + TRC_EXT1_COUNT-1, \
|
||||
TRC_EXT1_VERSION_PATCH, \
|
||||
TRC_EXT1_VERSION_MINOR, \
|
||||
TRC_EXT1_VERSION_MAJOR, \
|
||||
TRC_EXT1_NAME } \
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (TRC_CFG_EXTENSION_COUNT == 2)
|
||||
#define TRC_EXTENSIONS_DATA \
|
||||
{ \
|
||||
{ TRC_EXTENSION_EVENTCODE_BASE, \
|
||||
TRC_EXTENSION_EVENTCODE_BASE + TRC_EXT1_COUNT-1, \
|
||||
TRC_EXT1_VERSION_PATCH, \
|
||||
TRC_EXT1_VERSION_MINOR, \
|
||||
TRC_EXT1_VERSION_MAJOR, \
|
||||
TRC_EXT1_NAME } \
|
||||
,{ TRC_EXTENSION_EVENTCODE_BASE + TRC_EXT1_COUNT, \
|
||||
TRC_EXTENSION_EVENTCODE_BASE + TRC_EXT1_COUNT + TRC_EXT2_COUNT-1, \
|
||||
TRC_EXT2_VERSION_PATCH, \
|
||||
TRC_EXT2_VERSION_MINOR, \
|
||||
TRC_EXT2_VERSION_MAJOR, \
|
||||
TRC_EXT2_NAME } \
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (TRC_CFG_EXTENSION_COUNT == 3)
|
||||
#define TRC_EXTENSIONS_DATA \
|
||||
{ \
|
||||
{ TRC_EXTENSION_EVENTCODE_BASE, \
|
||||
TRC_EXTENSION_EVENTCODE_BASE + TRC_EXT1_COUNT-1, \
|
||||
TRC_EXT1_VERSION_PATCH, \
|
||||
TRC_EXT1_VERSION_MINOR, \
|
||||
TRC_EXT1_VERSION_MAJOR, \
|
||||
TRC_EXT1_NAME } \
|
||||
,{ TRC_EXTENSION_EVENTCODE_BASE + TRC_EXT1_COUNT, \
|
||||
TRC_EXTENSION_EVENTCODE_BASE + TRC_EXT1_COUNT + TRC_EXT2_COUNT-1, \
|
||||
TRC_EXT2_VERSION_PATCH, \
|
||||
TRC_EXT2_VERSION_MINOR, \
|
||||
TRC_EXT2_VERSION_MAJOR, \
|
||||
TRC_EXT2_NAME } \
|
||||
,{ TRC_EXTENSION_EVENTCODE_BASE + TRC_EXT1_COUNT + TRC_EXT2_COUNT, \
|
||||
TRC_EXTENSION_EVENTCODE_BASE + TRC_EXT1_COUNT + TRC_EXT2_COUNT + TRC_EXT3_COUNT - 1, \
|
||||
TRC_EXT3_VERSION_PATCH, \
|
||||
TRC_EXT3_VERSION_MINOR, \
|
||||
TRC_EXT3_VERSION_MAJOR, \
|
||||
TRC_EXT3_NAME } \
|
||||
}
|
||||
#endif
|
||||
#if (TRC_CFG_EXTENSION_COUNT == 4)
|
||||
#define TRC_EXTENSIONS_DATA \
|
||||
{ \
|
||||
{ TRC_EXTENSION_EVENTCODE_BASE, \
|
||||
TRC_EXTENSION_EVENTCODE_BASE + TRC_EXT1_COUNT-1, \
|
||||
TRC_EXT1_VERSION_PATCH, \
|
||||
TRC_EXT1_VERSION_MINOR, \
|
||||
TRC_EXT1_VERSION_MAJOR, \
|
||||
TRC_EXT1_NAME } \
|
||||
,{ TRC_EXTENSION_EVENTCODE_BASE + TRC_EXT1_COUNT, \
|
||||
TRC_EXTENSION_EVENTCODE_BASE + TRC_EXT1_COUNT + TRC_EXT2_COUNT-1, \
|
||||
TRC_EXT2_VERSION_PATCH, \
|
||||
TRC_EXT2_VERSION_MINOR, \
|
||||
TRC_EXT2_VERSION_MAJOR, \
|
||||
TRC_EXT2_NAME } \
|
||||
,{ TRC_EXTENSION_EVENTCODE_BASE + TRC_EXT1_COUNT + TRC_EXT2_COUNT, \
|
||||
TRC_EXTENSION_EVENTCODE_BASE + TRC_EXT1_COUNT + TRC_EXT2_COUNT + TRC_EXT3_COUNT - 1, \
|
||||
TRC_EXT3_VERSION_PATCH, \
|
||||
TRC_EXT3_VERSION_MINOR, \
|
||||
TRC_EXT3_VERSION_MAJOR, \
|
||||
TRC_EXT3_NAME } \
|
||||
,{ TRC_EXTENSION_EVENTCODE_BASE + TRC_EXT1_COUNT + TRC_EXT2_COUNT + TRC_EXT3_COUNT, \
|
||||
TRC_EXTENSION_EVENTCODE_BASE + TRC_EXT1_COUNT + TRC_EXT2_COUNT + TRC_EXT3_COUNT + TRC_EXT4_COUNT- 1, \
|
||||
TRC_EXT4_VERSION_PATCH, \
|
||||
TRC_EXT4_VERSION_MINOR, \
|
||||
TRC_EXT4_VERSION_MAJOR, \
|
||||
TRC_EXT4_NAME } \
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (TRC_CFG_EXTENSION_COUNT > 0)
|
||||
#define TRC_EXTENSION_INFO {TRC_CFG_EXTENSION_COUNT, TRC_EXTENSION_EVENTCODE_BASE, ROUNDUP4(TRC_CFG_EXT_MAX_NAME_LEN), sizeof(PSFExtensionEntryType), TRC_EXTENSIONS_DATA}
|
||||
#else
|
||||
#define TRC_EXTENSION_INFO {TRC_CFG_EXTENSION_COUNT, TRC_EXTENSION_EVENTCODE_BASE}
|
||||
#endif
|
||||
|
||||
#endif /* TRCEXTENSIONS_H_ */
|
||||
597
pico-sensor/McuLib/TraceRecorder/include/trcHardwarePort.h
Normal file
597
pico-sensor/McuLib/TraceRecorder/include/trcHardwarePort.h
Normal file
@@ -0,0 +1,597 @@
|
||||
/*******************************************************************************
|
||||
* Trace Recorder Library for Tracealyzer v4.4.1
|
||||
* Percepio AB, www.percepio.com
|
||||
*
|
||||
* trcHardwarePort.h
|
||||
*
|
||||
* The hardware abstraction layer for the trace recorder.
|
||||
*
|
||||
* Terms of Use
|
||||
* This file is part of the trace recorder library (RECORDER), which is the
|
||||
* intellectual property of Percepio AB (PERCEPIO) and provided under a
|
||||
* license as follows.
|
||||
* The RECORDER may be used free of charge for the purpose of recording data
|
||||
* intended for analysis in PERCEPIO products. It may not be used or modified
|
||||
* for other purposes without explicit permission from PERCEPIO.
|
||||
* You may distribute the RECORDER in its original source code form, assuming
|
||||
* this text (terms of use, disclaimer, copyright notice) is unchanged. You are
|
||||
* allowed to distribute the RECORDER with minor modifications intended for
|
||||
* configuration or porting of the RECORDER, e.g., to allow using it on a
|
||||
* specific processor, processor family or with a specific communication
|
||||
* interface. Any such modifications should be documented directly below
|
||||
* this comment block.
|
||||
*
|
||||
* Disclaimer
|
||||
* The RECORDER is being delivered to you AS IS and PERCEPIO makes no warranty
|
||||
* as to its use or performance. PERCEPIO does not and cannot warrant the
|
||||
* performance or results you may obtain by using the RECORDER or documentation.
|
||||
* PERCEPIO make no warranties, express or implied, as to noninfringement of
|
||||
* third party rights, merchantability, or fitness for any particular purpose.
|
||||
* In no event will PERCEPIO, its technology partners, or distributors be liable
|
||||
* to you for any consequential, incidental or special damages, including any
|
||||
* lost profits or lost savings, even if a representative of PERCEPIO has been
|
||||
* advised of the possibility of such damages, or for any claim by any third
|
||||
* party. Some jurisdictions do not allow the exclusion or limitation of
|
||||
* incidental, consequential or special damages, or the exclusion of implied
|
||||
* warranties or limitations on how long an implied warranty may last, so the
|
||||
* above limitations may not apply to you.
|
||||
*
|
||||
* Tabs are used for indent in this file (1 tab = 4 spaces)
|
||||
*
|
||||
* Copyright Percepio AB, 2018.
|
||||
* www.percepio.com
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef TRC_HARDWARE_PORT_H
|
||||
#define TRC_HARDWARE_PORT_H
|
||||
|
||||
#include "trcPortDefines.h"
|
||||
|
||||
#if 1 /* << EST */
|
||||
#include "FreeRTOSConfig.h"
|
||||
|
||||
#if configCPU_FAMILY_IS_ARM(configCPU_FAMILY)
|
||||
#if McuLib_CONFIG_PEX_SDK_USED/* << EST Kinetis SDK is using CMSIS core, therefore the functions below are defined in core_cmFunc.h. For non-SDK projects, define them locally here */
|
||||
/** \brief Get Priority Mask
|
||||
This function returns the current state of the priority mask bit from the Priority Mask Register.
|
||||
\return Priority Mask value
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) static inline uint32_t __get_PRIMASK(void)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__asm volatile ("MRS %0, primask" : "=r" (result) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
|
||||
/** \brief Set Priority Mask
|
||||
This function assigns the given value to the Priority Mask Register.
|
||||
\param [in] priMask Priority Mask
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) static inline void __set_PRIMASK(uint32_t priMask)
|
||||
{
|
||||
__asm volatile ("MSR primask, %0" : : "r" (priMask) : "memory");
|
||||
}
|
||||
#elif McuLib_CONFIG_CPU_IS_STM32
|
||||
#include "stm32f3xx_hal.h" /* header file for STM32F303K8 */
|
||||
#elif McuLib_CONFIG_CPU_IS_NORDIC_NRF
|
||||
#include "nrf.h" /* header file Nordic devices */
|
||||
#else
|
||||
#include "fsl_device_registers.h"
|
||||
#endif /* #if McuLib_CONFIG_PEX_SDK_USED */
|
||||
#endif /* configCPU_FAMILY_IS_ARM */
|
||||
#endif /* << EST */
|
||||
|
||||
#if (TRC_CFG_HARDWARE_PORT == TRC_HARDWARE_PORT_NOT_SET)
|
||||
#error "TRC_CFG_HARDWARE_PORT not selected - see trcConfig.h"
|
||||
#endif
|
||||
|
||||
/*******************************************************************************
|
||||
* TRC_IRQ_PRIORITY_ORDER
|
||||
*
|
||||
* Macro which should be defined as an integer of 0 or 1.
|
||||
*
|
||||
* This should be 0 if lower IRQ priority values implies higher priority
|
||||
* levels, such as on ARM Cortex M. If the opposite scheme is used, i.e.,
|
||||
* if higher IRQ priority values means higher priority, this should be 1.
|
||||
*
|
||||
* This setting is not critical. It is used only to sort and colorize the
|
||||
* interrupts in priority order, in case you record interrupts using
|
||||
* the vTraceStoreISRBegin and vTraceStoreISREnd routines.
|
||||
*
|
||||
******************************************************************************
|
||||
*
|
||||
* HWTC Macros
|
||||
*
|
||||
* These macros provides a hardware isolation layer representing the
|
||||
* hardware timer/counter used for the event timestamping.
|
||||
*
|
||||
* TRC_HWTC_COUNT: How to read the current value of the timer/counter.
|
||||
*
|
||||
* TRC_HWTC_TYPE: Tells the type of timer/counter used for TRC_HWTC_COUNT:
|
||||
*
|
||||
* - TRC_FREE_RUNNING_32BIT_INCR:
|
||||
* Free-running 32-bit timer/counter, counting upwards from 0.
|
||||
*
|
||||
* - TRC_FREE_RUNNING_32BIT_DECR
|
||||
* Free-running 32-bit timer/counter, counting downwards from 0xFFFFFFFF.
|
||||
*
|
||||
* - TRC_OS_TIMER_INCR
|
||||
* Periodic timer that drives the OS tick interrupt, counting upwards
|
||||
* from 0 until (TRC_HWTC_PERIOD-1).
|
||||
*
|
||||
* - TRC_OS_TIMER_DECR
|
||||
* Periodic timer that drives the OS tick interrupt, counting downwards
|
||||
* from TRC_HWTC_PERIOD-1 until 0.
|
||||
*
|
||||
* - TRC_CUSTOM_TIMER_INCR
|
||||
* A custom timer or counter independent of the OS tick, counting
|
||||
* downwards from TRC_HWTC_PERIOD-1 until 0. (Currently only supported
|
||||
* in streaming mode).
|
||||
*
|
||||
* - TRC_CUSTOM_TIMER_DECR
|
||||
* A custom timer independent of the OS tick, counting downwards
|
||||
* from TRC_HWTC_PERIOD-1 until 0. (Currently only supported
|
||||
* in streaming mode).
|
||||
*
|
||||
* TRC_HWTC_PERIOD: The number of HWTC_COUNT ticks until the timer wraps
|
||||
* around. If using TRC_FREE_RUNNING_32BIT_INCR/DECR, this should be 0.
|
||||
*
|
||||
* TRC_HWTC_FREQ_HZ: The clock rate of the TRC_HWTC_COUNT counter in Hz. If using
|
||||
* TRC_OS_TIMER_INCR/DECR, this is should be TRC_HWTC_PERIOD * TRACE_TICK_RATE_HZ.
|
||||
* If using a free-running timer, this is often TRACE_CPU_CLOCK_HZ (if running at
|
||||
* the core clock rate). If using TRC_CUSTOM_TIMER_INCR/DECR, this should match
|
||||
* the clock rate of your custom timer (i.e., TRC_HWTC_COUNT). If the default value
|
||||
* of TRC_HWTC_FREQ_HZ is incorrect for your setup, you can override it by calling
|
||||
* vTraceSetFrequency before calling vTraceEnable.
|
||||
*
|
||||
* TRC_HWTC_DIVISOR (used in snapshot mode only):
|
||||
* In snapshot mode, the timestamp resolution is TRC_HWTC_FREQ_HZ/TRC_HWTC_DIVISOR.
|
||||
* If the timer frequency is very high (hundreds of MHz), we recommend increasing
|
||||
* the TRC_HWTC_DIVISOR prescaler, to reduce the bandwidth needed to store
|
||||
* timestamps. This since extra "XTS" events are inserted if the time since the
|
||||
* previous event exceeds a certain limit (255 or 65535 depending on event type).
|
||||
* It is advised to keep the time between most events below 65535 native ticks
|
||||
* (after division by TRC_HWTC_DIVISOR) to avoid frequent XTS events.
|
||||
******************************************************************************/
|
||||
|
||||
#if (TRC_CFG_HARDWARE_PORT == TRC_HARDWARE_PORT_NOT_SET)
|
||||
#error "TRC_CFG_HARDWARE_PORT not selected - see trcConfig.h"
|
||||
#endif
|
||||
|
||||
#if (TRC_CFG_HARDWARE_PORT == TRC_HARDWARE_PORT_Win32)
|
||||
/* This can be used as a template for any free-running 32-bit counter */
|
||||
#define TRC_HWTC_TYPE TRC_FREE_RUNNING_32BIT_INCR
|
||||
#define TRC_HWTC_COUNT (ulGetRunTimeCounterValue())
|
||||
#define TRC_HWTC_PERIOD 0
|
||||
#define TRC_HWTC_DIVISOR 1
|
||||
#define TRC_HWTC_FREQ_HZ 100000
|
||||
|
||||
#define TRC_IRQ_PRIORITY_ORDER 1
|
||||
|
||||
#define TRC_PORT_SPECIFIC_INIT()
|
||||
|
||||
#elif (TRC_CFG_HARDWARE_PORT == TRC_HARDWARE_PORT_HWIndependent)
|
||||
/* Timestamping by OS tick only (typically 1 ms resolution) */
|
||||
#define TRC_HWTC_TYPE TRC_OS_TIMER_INCR
|
||||
#define TRC_HWTC_COUNT 0
|
||||
#define TRC_HWTC_PERIOD 1
|
||||
#define TRC_HWTC_DIVISOR 1
|
||||
#define TRC_HWTC_FREQ_HZ TRACE_TICK_RATE_HZ
|
||||
|
||||
/* Set the meaning of IRQ priorities in ISR tracing - see above */
|
||||
#define TRC_IRQ_PRIORITY_ORDER NOT_SET
|
||||
|
||||
#elif (TRC_CFG_HARDWARE_PORT == TRC_HARDWARE_PORT_ARM_Cortex_M)
|
||||
|
||||
#ifndef __CORTEX_M
|
||||
#error "Can't find the CMSIS API. Please include your processor's header file in trcConfig.h"
|
||||
#endif
|
||||
|
||||
/**************************************************************************
|
||||
* For Cortex-M3, M4 and M7, the DWT cycle counter is used for timestamping.
|
||||
* For Cortex-M0 and M0+, the SysTick timer is used since DWT is not
|
||||
* available. Systick timestamping can also be forced on Cortex-M3, M4 and
|
||||
* M7 by defining the preprocessor directive TRC_CFG_ARM_CM_USE_SYSTICK,
|
||||
* either directly below or in trcConfig.h.
|
||||
*
|
||||
* #define TRC_CFG_ARM_CM_USE_SYSTICK
|
||||
**************************************************************************/
|
||||
|
||||
#if ((__CORTEX_M >= 0x03) && (! defined TRC_CFG_ARM_CM_USE_SYSTICK))
|
||||
|
||||
void prvTraceInitCortexM(void);
|
||||
|
||||
#define TRC_REG_DEMCR (*(volatile uint32_t*)0xE000EDFC)
|
||||
#define TRC_REG_DWT_CTRL (*(volatile uint32_t*)0xE0001000)
|
||||
#define TRC_REG_DWT_CYCCNT (*(volatile uint32_t*)0xE0001004)
|
||||
#define TRC_REG_DWT_EXCCNT (*(volatile uint32_t*)0xE000100C)
|
||||
|
||||
#define TRC_REG_ITM_LOCKACCESS (*(volatile uint32_t*)0xE0001FB0)
|
||||
#define TRC_ITM_LOCKACCESS_UNLOCK (0xC5ACCE55)
|
||||
|
||||
/* Bit mask for TRCENA bit in DEMCR - Global enable for DWT and ITM */
|
||||
#define TRC_DEMCR_TRCENA (1 << 24)
|
||||
|
||||
/* Bit mask for NOPRFCNT bit in DWT_CTRL. If 1, DWT_EXCCNT is not supported */
|
||||
#define TRC_DWT_CTRL_NOPRFCNT (1 << 24)
|
||||
|
||||
/* Bit mask for NOCYCCNT bit in DWT_CTRL. If 1, DWT_CYCCNT is not supported */
|
||||
#define TRC_DWT_CTRL_NOCYCCNT (1 << 25)
|
||||
|
||||
/* Bit mask for EXCEVTENA_ bit in DWT_CTRL. Set to 1 to enable DWT_EXCCNT */
|
||||
#define TRC_DWT_CTRL_EXCEVTENA (1 << 18)
|
||||
|
||||
/* Bit mask for EXCEVTENA_ bit in DWT_CTRL. Set to 1 to enable DWT_CYCCNT */
|
||||
#define TRC_DWT_CTRL_CYCCNTENA (1)
|
||||
|
||||
#define TRC_PORT_SPECIFIC_INIT() prvTraceInitCortexM()
|
||||
|
||||
#define TRC_HWTC_TYPE TRC_FREE_RUNNING_32BIT_INCR
|
||||
#define TRC_HWTC_COUNT TRC_REG_DWT_CYCCNT
|
||||
#define TRC_HWTC_PERIOD 0
|
||||
#define TRC_HWTC_DIVISOR 4
|
||||
#define TRC_HWTC_FREQ_HZ TRACE_CPU_CLOCK_HZ
|
||||
#define TRC_IRQ_PRIORITY_ORDER 0
|
||||
|
||||
#else
|
||||
|
||||
#define TRC_HWTC_TYPE TRC_OS_TIMER_DECR
|
||||
#define TRC_HWTC_COUNT (*((volatile uint32_t*)0xE000E018))
|
||||
#define TRC_HWTC_PERIOD ((*((volatile uint32_t*)0xE000E014)) + 1)
|
||||
#define TRC_HWTC_DIVISOR 4
|
||||
#define TRC_HWTC_FREQ_HZ TRACE_CPU_CLOCK_HZ
|
||||
#define TRC_IRQ_PRIORITY_ORDER 0
|
||||
|
||||
#endif
|
||||
|
||||
#elif (TRC_CFG_HARDWARE_PORT == TRC_HARDWARE_PORT_Renesas_RX600)
|
||||
|
||||
#include "iodefine.h"
|
||||
|
||||
#if (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING)
|
||||
|
||||
#define TRC_HWTC_TYPE TRC_OS_TIMER_INCR
|
||||
#define TRC_HWTC_COUNT (CMT0.CMCNT)
|
||||
|
||||
#elif (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_SNAPSHOT)
|
||||
|
||||
/* Decreasing counters better for Tickless Idle? */
|
||||
#define TRC_HWTC_TYPE TRC_OS_TIMER_DECR
|
||||
#define TRC_HWTC_COUNT (CMT0.CMCOR - CMT0.CMCNT)
|
||||
|
||||
#endif
|
||||
|
||||
#define TRC_HWTC_PERIOD (CMT0.CMCOR + 1)
|
||||
#define TRC_HWTC_DIVISOR 1
|
||||
#define TRC_HWTC_FREQ_HZ (TRACE_TICK_RATE_HZ * TRC_HWTC_PERIOD)
|
||||
#define TRC_IRQ_PRIORITY_ORDER 1
|
||||
|
||||
#elif (TRC_CFG_HARDWARE_PORT == TRC_HARDWARE_PORT_MICROCHIP_PIC24_PIC32)
|
||||
|
||||
#define TRC_HWTC_TYPE TRC_OS_TIMER_INCR
|
||||
#define TRC_HWTC_COUNT (TMR1)
|
||||
#define TRC_HWTC_PERIOD (PR1 + 1)
|
||||
#define TRC_HWTC_DIVISOR 1
|
||||
#define TRC_HWTC_FREQ_HZ (TRACE_TICK_RATE_HZ * TRC_HWTC_PERIOD)
|
||||
#define TRC_IRQ_PRIORITY_ORDER 1
|
||||
|
||||
#elif (TRC_CFG_HARDWARE_PORT == TRC_HARDWARE_PORT_TEXAS_INSTRUMENTS_TMS570_RM48)
|
||||
|
||||
#define TRC_RTIFRC0 *((uint32_t *)0xFFFFFC10)
|
||||
#define TRC_RTICOMP0 *((uint32_t *)0xFFFFFC50)
|
||||
#define TRC_RTIUDCP0 *((uint32_t *)0xFFFFFC54)
|
||||
|
||||
#define TRC_HWTC_TYPE TRC_OS_TIMER_INCR
|
||||
#define TRC_HWTC_COUNT (TRC_RTIFRC0 - (TRC_RTICOMP0 - TRC_RTIUDCP0))
|
||||
#define TRC_HWTC_PERIOD (TRC_RTIUDCP0)
|
||||
#define TRC_HWTC_DIVISOR 1
|
||||
#define TRC_HWTC_FREQ_HZ (TRACE_TICK_RATE_HZ * TRC_HWTC_PERIOD)
|
||||
#define TRC_IRQ_PRIORITY_ORDER 0
|
||||
|
||||
#elif (TRC_CFG_HARDWARE_PORT == TRC_HARDWARE_PORT_Atmel_AT91SAM7)
|
||||
|
||||
/* UNOFFICIAL PORT - NOT YET VERIFIED BY PERCEPIO */
|
||||
|
||||
#define TRC_HWTC_TYPE TRC_OS_TIMER_INCR
|
||||
#define TRC_HWTC_COUNT ((uint32_t)(AT91C_BASE_PITC->PITC_PIIR & 0xFFFFF))
|
||||
#define TRC_HWTC_PERIOD ((uint32_t)(AT91C_BASE_PITC->PITC_PIMR + 1))
|
||||
#define TRC_HWTC_DIVISOR 1
|
||||
#define TRC_HWTC_FREQ_HZ (TRACE_TICK_RATE_HZ * TRC_HWTC_PERIOD)
|
||||
#define TRC_IRQ_PRIORITY_ORDER 1
|
||||
|
||||
#elif (TRC_CFG_HARDWARE_PORT == TRC_HARDWARE_PORT_Atmel_UC3A0)
|
||||
|
||||
/* UNOFFICIAL PORT - NOT YET VERIFIED BY PERCEPIO*/
|
||||
|
||||
/* For Atmel AVR32 (AT32UC3A) */
|
||||
|
||||
#define TRC_HWTC_TYPE TRC_OS_TIMER_INCR
|
||||
#define TRC_HWTC_COUNT ((uint32_t)sysreg_read(AVR32_COUNT))
|
||||
#define TRC_HWTC_PERIOD ((uint32_t)(sysreg_read(AVR32_COMPARE) + 1))
|
||||
#define TRC_HWTC_DIVISOR 1
|
||||
#define TRC_HWTC_FREQ_HZ (TRACE_TICK_RATE_HZ * TRC_HWTC_PERIOD)
|
||||
#define TRC_IRQ_PRIORITY_ORDER 1
|
||||
|
||||
#elif (TRC_CFG_HARDWARE_PORT == TRC_HARDWARE_PORT_NXP_LPC210X)
|
||||
|
||||
/* UNOFFICIAL PORT - NOT YET VERIFIED BY PERCEPIO */
|
||||
|
||||
/* Tested with LPC2106, but should work with most LPC21XX chips. */
|
||||
|
||||
#define TRC_HWTC_TYPE TRC_OS_TIMER_INCR
|
||||
#define TRC_HWTC_COUNT *((uint32_t *)0xE0004008 )
|
||||
#define TRC_HWTC_PERIOD *((uint32_t *)0xE0004018 )
|
||||
#define TRC_HWTC_DIVISOR 1
|
||||
#define TRC_HWTC_FREQ_HZ (TRACE_TICK_RATE_HZ * TRC_HWTC_PERIOD)
|
||||
#define TRC_IRQ_PRIORITY_ORDER 0
|
||||
|
||||
#elif (TRC_CFG_HARDWARE_PORT == TRC_HARDWARE_PORT_TEXAS_INSTRUMENTS_MSP430)
|
||||
|
||||
/* UNOFFICIAL PORT - NOT YET VERIFIED */
|
||||
|
||||
#define TRC_HWTC_TYPE TRC_OS_TIMER_INCR
|
||||
#define TRC_HWTC_COUNT (TA0R)
|
||||
#define TRC_HWTC_PERIOD (((uint16_t)TACCR0)+1)
|
||||
#define TRC_HWTC_DIVISOR 1
|
||||
#define TRC_HWTC_FREQ_HZ (TRACE_TICK_RATE_HZ * TRC_HWTC_PERIOD)
|
||||
#define TRC_IRQ_PRIORITY_ORDER 1
|
||||
|
||||
#elif (TRC_CFG_HARDWARE_PORT == TRC_HARDWARE_PORT_XILINX_PPC405)
|
||||
|
||||
/* UNOFFICIAL PORT - NOT YET VERIFIED */
|
||||
|
||||
#define TRC_HWTC_TYPE TRC_OS_TIMER_DECR
|
||||
#define TRC_HWTC_COUNT mfspr(0x3db)
|
||||
#define TRC_HWTC_PERIOD (TRACE_CPU_CLOCK_HZ / TRACE_TICK_RATE_HZ)
|
||||
#define TRC_HWTC_DIVISOR 1
|
||||
#define TRC_HWTC_FREQ_HZ (TRACE_TICK_RATE_HZ * TRC_HWTC_PERIOD)
|
||||
#define TRC_IRQ_PRIORITY_ORDER 0
|
||||
|
||||
#elif (TRC_CFG_HARDWARE_PORT == TRC_HARDWARE_PORT_XILINX_PPC440)
|
||||
|
||||
/* UNOFFICIAL PORT */
|
||||
|
||||
/* This should work with most PowerPC chips */
|
||||
|
||||
#define TRC_HWTC_TYPE TRC_OS_TIMER_DECR
|
||||
#define TRC_HWTC_COUNT mfspr(0x016)
|
||||
#define TRC_HWTC_PERIOD (TRACE_CPU_CLOCK_HZ / TRACE_TICK_RATE_HZ)
|
||||
#define TRC_HWTC_DIVISOR 1
|
||||
#define TRC_HWTC_FREQ_HZ (TRACE_TICK_RATE_HZ * TRC_HWTC_PERIOD)
|
||||
#define TRC_IRQ_PRIORITY_ORDER 0
|
||||
|
||||
#elif (TRC_CFG_HARDWARE_PORT == TRC_HARDWARE_PORT_XILINX_MICROBLAZE)
|
||||
|
||||
/* UNOFFICIAL PORT - NOT YET VERIFIED BY PERCEPIO */
|
||||
|
||||
/* This should work with most Microblaze configurations.
|
||||
* It uses the AXI Timer 0 - the tick interrupt source.
|
||||
* If an AXI Timer 0 peripheral is available on your hardware platform, no modifications are required.
|
||||
*/
|
||||
#include "xtmrctr_l.h"
|
||||
|
||||
#define TRC_HWTC_TYPE TRC_OS_TIMER_DECR
|
||||
#define TRC_HWTC_COUNT XTmrCtr_GetTimerCounterReg( XPAR_TMRCTR_0_BASEADDR, 0 )
|
||||
#define TRC_HWTC_PERIOD (XTmrCtr_mGetLoadReg( XPAR_TMRCTR_0_BASEADDR, 0) + 1)
|
||||
#define TRC_HWTC_DIVISOR 16
|
||||
#define TRC_HWTC_FREQ_HZ (TRACE_TICK_RATE_HZ * TRC_HWTC_PERIOD)
|
||||
#define TRC_IRQ_PRIORITY_ORDER 0
|
||||
|
||||
#elif (TRC_CFG_HARDWARE_PORT == TRC_HARDWARE_PORT_XILINX_ZyncUltraScaleR5)
|
||||
|
||||
#include "xttcps_hw.h"
|
||||
|
||||
#define TRC_HWTC_TYPE TRC_OS_TIMER_INCR
|
||||
#define TRC_HWTC_COUNT (*(volatile uint32_t *)(configTIMER_BASEADDR + XTTCPS_COUNT_VALUE_OFFSET))
|
||||
#define TRC_HWTC_PERIOD (*(volatile uint32_t *)(configTIMER_BASEADDR + XTTCPS_INTERVAL_VAL_OFFSET))
|
||||
#define TRC_HWTC_DIVISOR 16
|
||||
#define TRC_HWTC_FREQ_HZ (TRC_HWTC_PERIOD * TRACE_TICK_RATE_HZ)
|
||||
#define TRC_IRQ_PRIORITY_ORDER 0
|
||||
|
||||
#ifdef __GNUC__
|
||||
/* For Arm Cortex-A and Cortex-R in general. */
|
||||
static inline uint32_t prvGetCPSR(void)
|
||||
{
|
||||
unsigned long ret;
|
||||
/* GCC-style assembly for getting the CPSR/APSR register, where the system execution mode is found. */
|
||||
asm volatile (" mrs %0, cpsr" : "=r" (ret) : /* no inputs */ );
|
||||
return ret;
|
||||
}
|
||||
#else
|
||||
#error "Only GCC Supported!"
|
||||
#endif
|
||||
|
||||
#elif (TRC_CFG_HARDWARE_PORT == TRC_HARDWARE_PORT_Altera_NiosII)
|
||||
|
||||
/* OFFICIAL PORT */
|
||||
|
||||
#include <system.h>
|
||||
#include <altera_avalon_timer_regs.h>
|
||||
|
||||
#define NOT_SET 1
|
||||
|
||||
/* The base address for the sustem timer set.
|
||||
* The name user for the system timer can be found in the BSP editor.
|
||||
* If the name of the timer is sys_tmr SYSTEM_TIMER_BASE should be set to SYS_TMR_BASE.
|
||||
*/
|
||||
#define SYSTEM_TIMER_BASE NOT_SET
|
||||
|
||||
#if (SYSTEM_TIMER == NOT_SET)
|
||||
#error "Set SYSTEM_TIMER_BASE to the timer base used for system ticks."
|
||||
#endif
|
||||
|
||||
static inline uint32_t altera_nios2_GetTimerSnapReg(void)
|
||||
{
|
||||
/* A processor can read the current counter value by first writing to either snapl or snaph to request a coherent snapshot of the counter,
|
||||
* and then reading snapl and snaph for the full 32-bit value.
|
||||
*/
|
||||
IOWR_ALTERA_AVALON_TIMER_SNAPL(SYSTEM_TIMER_BASE, 0);
|
||||
return (IORD_ALTERA_AVALON_TIMER_SNAPH(SYSTEM_TIMER_BASE) << 16) | IORD_ALTERA_AVALON_TIMER_SNAPL(SYSTEM_TIMER_BASE);
|
||||
}
|
||||
|
||||
#define TRC_HWTC_TYPE TRC_OS_TIMER_DECR
|
||||
#define TRC_HWTC_COUNT altera_nios2_GetTimerSnapReg()
|
||||
#define TRC_HWTC_PERIOD (configCPU_CLOCK_HZ / configTICK_RATE_HZ )
|
||||
#define TRC_HWTC_DIVISOR 16
|
||||
#define TRC_HWTC_FREQ_HZ (TRACE_TICK_RATE_HZ * TRC_HWTC_PERIOD)
|
||||
#define TRC_IRQ_PRIORITY_ORDER 0
|
||||
|
||||
#elif (TRC_CFG_HARDWARE_PORT == TRC_HARDWARE_PORT_ARM_CORTEX_A9)
|
||||
|
||||
/**************************************************************************
|
||||
* This hardware port only supports FreeRTOS and the GCC compiler at the
|
||||
* moment, due to the implementation of critical sections (trcKernelPort.h).
|
||||
*
|
||||
* Assuming FreeRTOS is used:
|
||||
*
|
||||
* For critical sections, this uses vTaskEnterCritical is when called from
|
||||
* task context and ulPortSetInterruptMask when called from ISR context.
|
||||
* Thus, it does not disable all ISRs. This means that the trace recorder
|
||||
* can only be called from ISRs with priority less or equal to
|
||||
* configMAX_API_CALL_INTERRUPT_PRIORITY (like FreeRTOS fromISR functions).
|
||||
*
|
||||
* This hardware port has been tested on it a Xilinx Zync 7000 (Cortex-A9),
|
||||
* but should work with all Cortex-A and R processors assuming that
|
||||
* TRC_CA9_MPCORE_PERIPHERAL_BASE_ADDRESS is set accordingly.
|
||||
**************************************************************************/
|
||||
|
||||
/* INPUT YOUR PERIPHERAL BASE ADDRESS HERE (0xF8F00000 for Xilinx Zynq 7000)*/
|
||||
#define TRC_CA9_MPCORE_PERIPHERAL_BASE_ADDRESS 0
|
||||
|
||||
#if (TRC_CA9_MPCORE_PERIPHERAL_BASE_ADDRESS == 0)
|
||||
#error "Please specify TRC_CA9_MPCORE_PERIPHERAL_BASE_ADDRESS."
|
||||
#endif
|
||||
|
||||
#define TRC_CA9_MPCORE_PRIVATE_MEMORY_OFFSET 0x0600
|
||||
#define TRC_CA9_MPCORE_PRIVCTR_PERIOD_REG (*(volatile uint32_t*)(TRC_CA9_MPCORE_PERIPHERAL_BASE_ADDRESS + TRC_CA9_MPCORE_PRIVATE_MEMORY_OFFSET + 0x00))
|
||||
#define TRC_CA9_MPCORE_PRIVCTR_COUNTER_REG (*(volatile uint32_t*)(TRC_CA9_MPCORE_PERIPHERAL_BASE_ADDRESS + TRC_CA9_MPCORE_PRIVATE_MEMORY_OFFSET + 0x04))
|
||||
#define TRC_CA9_MPCORE_PRIVCTR_CONTROL_REG (*(volatile uint32_t*)(TRC_CA9_MPCORE_PERIPHERAL_BASE_ADDRESS + TRC_CA9_MPCORE_PRIVATE_MEMORY_OFFSET + 0x08))
|
||||
|
||||
#define TRC_CA9_MPCORE_PRIVCTR_CONTROL_PRESCALER_MASK 0x0000FF00
|
||||
#define TRC_CA9_MPCORE_PRIVCTR_CONTROL_PRESCALER_SHIFT 8
|
||||
#define TRC_CA9_MPCORE_PRIVCTR_PRESCALER (((TRC_CA9_MPCORE_PRIVCTR_CONTROL_REG & TRC_CA9_MPCORE_PRIVCTR_CONTROL_PRESCALER_MASK) >> TRC_CA9_MPCORE_PRIVCTR_CONTROL_PRESCALER_SHIFT) + 1)
|
||||
|
||||
#define TRC_HWTC_TYPE TRC_OS_TIMER_DECR
|
||||
#define TRC_HWTC_COUNT TRC_CA9_MPCORE_PRIVCTR_COUNTER_REG
|
||||
#define TRC_HWTC_PERIOD (TRC_CA9_MPCORE_PRIVCTR_PERIOD_REG + 1)
|
||||
|
||||
/****************************************************************************************
|
||||
NOTE: The private timer ticks with a very high frequency (half the core-clock usually),
|
||||
depending on the prescaler used. If a low prescaler is used, the number of HW ticks between
|
||||
the trace events gets large, and thereby inefficient to store (sometimes extra events are
|
||||
needed). To improve efficiency, you may use the TRC_HWTC_DIVISOR as an additional prescaler.
|
||||
*****************************************************************************************/
|
||||
#define TRC_HWTC_DIVISOR 1
|
||||
|
||||
#define TRC_HWTC_FREQ_HZ (TRACE_TICK_RATE_HZ * TRC_HWTC_PERIOD)
|
||||
#define TRC_IRQ_PRIORITY_ORDER 0
|
||||
|
||||
#ifdef __GNUC__
|
||||
/* For Arm Cortex-A and Cortex-R in general. */
|
||||
static inline uint32_t prvGetCPSR(void)
|
||||
{
|
||||
unsigned long ret;
|
||||
/* GCC-style assembly for getting the CPSR/APSR register, where the system execution mode is found. */
|
||||
asm volatile (" mrs %0, cpsr" : "=r" (ret) : /* no inputs */ );
|
||||
return ret;
|
||||
}
|
||||
#else
|
||||
#error "Only GCC Supported!"
|
||||
#endif
|
||||
|
||||
|
||||
#elif (TRC_CFG_HARDWARE_PORT == TRC_HARDWARE_PORT_POWERPC_Z4)
|
||||
|
||||
/* UNOFFICIAL PORT - NOT YET VERIFIED BY PERCEPIO */
|
||||
|
||||
#define TRC_HWTC_TYPE TRC_OS_TIMER_DECR
|
||||
//#define HWTC_COUNT_DIRECTION DIRECTION_DECREMENTING
|
||||
#define TRC_HWTC_COUNT PIT.TIMER[configTICK_PIT_CHANNEL].CVAL.R // must be the PIT channel used for the systick
|
||||
#define TRC_HWTC_PERIOD ((configPIT_CLOCK_HZ / configTICK_RATE_HZ) - 1U) // TODO FIXME or maybe not -1? what's the right "period" value?
|
||||
#define TRC_HWTC_FREQ_HZ configPIT_CLOCK_HZ
|
||||
#define TRC_HWTC_DIVISOR 1
|
||||
#define TRC_IRQ_PRIORITY_ORDER 1 // higher IRQ priority values are more significant
|
||||
|
||||
#elif (TRC_CFG_HARDWARE_PORT == TRC_HARDWARE_PORT_APPLICATION_DEFINED)
|
||||
|
||||
#if !( defined (TRC_HWTC_TYPE) && defined (TRC_HWTC_COUNT) && defined (TRC_HWTC_PERIOD) && defined (TRC_HWTC_FREQ_HZ) && defined (TRC_IRQ_PRIORITY_ORDER) )
|
||||
#error "The hardware port is not completely defined!"
|
||||
#endif
|
||||
|
||||
#elif (TRC_CFG_HARDWARE_PORT == TRC_HARDWARE_PORT_PROCESSOR_EXPERT) /* << EST */
|
||||
#include "portTicks.h" /* << EST */
|
||||
|
||||
#elif (TRC_CFG_HARDWARE_PORT != TRC_HARDWARE_PORT_NOT_SET)
|
||||
|
||||
#error "TRC_CFG_HARDWARE_PORT had unsupported value!"
|
||||
#define TRC_CFG_HARDWARE_PORT TRC_HARDWARE_PORT_NOT_SET
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef TRC_HWTC_DIVISOR
|
||||
#define TRC_HWTC_DIVISOR 1
|
||||
#endif
|
||||
|
||||
#ifndef TRC_PORT_SPECIFIC_INIT
|
||||
#define TRC_PORT_SPECIFIC_INIT()
|
||||
#endif
|
||||
|
||||
/* If Win32 port */
|
||||
#ifdef WIN32
|
||||
|
||||
#undef _WIN32_WINNT
|
||||
#define _WIN32_WINNT 0x0600
|
||||
|
||||
/* Standard includes. */
|
||||
#include <stdio.h>
|
||||
#include <windows.h>
|
||||
#include <direct.h>
|
||||
|
||||
/***************************************************************************
|
||||
* The Win32 port by default saves the trace to file and then kills the
|
||||
* program when the recorder is stopped, to facilitate quick, simple tests
|
||||
* of the recorder.
|
||||
***************************************************************************/
|
||||
#define WIN32_PORT_SAVE_WHEN_STOPPED 1
|
||||
#define WIN32_PORT_EXIT_WHEN_STOPPED 1
|
||||
|
||||
#endif
|
||||
|
||||
#if (TRC_CFG_HARDWARE_PORT != TRC_HARDWARE_PORT_NOT_SET)
|
||||
|
||||
#ifndef TRC_HWTC_TYPE
|
||||
#error "TRC_HWTC_TYPE is not set!"
|
||||
#endif
|
||||
|
||||
#ifndef TRC_HWTC_COUNT
|
||||
#error "TRC_HWTC_COUNT is not set!"
|
||||
#endif
|
||||
|
||||
#ifndef TRC_HWTC_PERIOD
|
||||
#error "TRC_HWTC_PERIOD is not set!"
|
||||
#endif
|
||||
|
||||
#ifndef TRC_HWTC_DIVISOR
|
||||
#error "TRC_HWTC_DIVISOR is not set!"
|
||||
#endif
|
||||
|
||||
#ifndef TRC_IRQ_PRIORITY_ORDER
|
||||
#error "TRC_IRQ_PRIORITY_ORDER is not set!"
|
||||
#elif (TRC_IRQ_PRIORITY_ORDER != 0) && (TRC_IRQ_PRIORITY_ORDER != 1)
|
||||
#error "TRC_IRQ_PRIORITY_ORDER has bad value!"
|
||||
#endif
|
||||
|
||||
#if (TRC_HWTC_DIVISOR < 1)
|
||||
#error "TRC_HWTC_DIVISOR must be a non-zero positive value!"
|
||||
#endif
|
||||
|
||||
#ifndef TRC_HWTC_FREQ_HZ
|
||||
#error "TRC_HWTC_FREQ_HZ not defined!"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif /*TRC_SNAPSHOT_HARDWARE_PORT_H*/
|
||||
|
||||
2831
pico-sensor/McuLib/TraceRecorder/include/trcKernelPort.h
Normal file
2831
pico-sensor/McuLib/TraceRecorder/include/trcKernelPort.h
Normal file
File diff suppressed because it is too large
Load Diff
140
pico-sensor/McuLib/TraceRecorder/include/trcPortDefines.h
Normal file
140
pico-sensor/McuLib/TraceRecorder/include/trcPortDefines.h
Normal file
@@ -0,0 +1,140 @@
|
||||
/*******************************************************************************
|
||||
* Trace Recorder Library for Tracealyzer v4.4.1
|
||||
* Percepio AB, www.percepio.com
|
||||
*
|
||||
* trcPortDefines.h
|
||||
*
|
||||
* Some common defines for the trace recorder.
|
||||
*
|
||||
* Terms of Use
|
||||
* This file is part of the trace recorder library (RECORDER), which is the
|
||||
* intellectual property of Percepio AB (PERCEPIO) and provided under a
|
||||
* license as follows.
|
||||
* The RECORDER may be used free of charge for the purpose of recording data
|
||||
* intended for analysis in PERCEPIO products. It may not be used or modified
|
||||
* for other purposes without explicit permission from PERCEPIO.
|
||||
* You may distribute the RECORDER in its original source code form, assuming
|
||||
* this text (terms of use, disclaimer, copyright notice) is unchanged. You are
|
||||
* allowed to distribute the RECORDER with minor modifications intended for
|
||||
* configuration or porting of the RECORDER, e.g., to allow using it on a
|
||||
* specific processor, processor family or with a specific communication
|
||||
* interface. Any such modifications should be documented directly below
|
||||
* this comment block.
|
||||
*
|
||||
* Disclaimer
|
||||
* The RECORDER is being delivered to you AS IS and PERCEPIO makes no warranty
|
||||
* as to its use or performance. PERCEPIO does not and cannot warrant the
|
||||
* performance or results you may obtain by using the RECORDER or documentation.
|
||||
* PERCEPIO make no warranties, express or implied, as to noninfringement of
|
||||
* third party rights, merchantability, or fitness for any particular purpose.
|
||||
* In no event will PERCEPIO, its technology partners, or distributors be liable
|
||||
* to you for any consequential, incidental or special damages, including any
|
||||
* lost profits or lost savings, even if a representative of PERCEPIO has been
|
||||
* advised of the possibility of such damages, or for any claim by any third
|
||||
* party. Some jurisdictions do not allow the exclusion or limitation of
|
||||
* incidental, consequential or special damages, or the exclusion of implied
|
||||
* warranties or limitations on how long an implied warranty may last, so the
|
||||
* above limitations may not apply to you.
|
||||
*
|
||||
* Tabs are used for indent in this file (1 tab = 4 spaces)
|
||||
*
|
||||
* Copyright Percepio AB, 2018.
|
||||
* www.percepio.com
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef TRC_PORTDEFINES_H
|
||||
#define TRC_PORTDEFINES_H
|
||||
|
||||
#define TRC_FREE_RUNNING_32BIT_INCR 1
|
||||
#define TRC_FREE_RUNNING_32BIT_DECR 2
|
||||
#define TRC_OS_TIMER_INCR 3
|
||||
#define TRC_OS_TIMER_DECR 4
|
||||
#define TRC_CUSTOM_TIMER_INCR 5
|
||||
#define TRC_CUSTOM_TIMER_DECR 6
|
||||
|
||||
/* Start options for vTraceEnable. */
|
||||
#define TRC_INIT 0
|
||||
#define TRC_START 1
|
||||
#define TRC_START_AWAIT_HOST 2
|
||||
|
||||
/* Command codes for TzCtrl task */
|
||||
#define CMD_SET_ACTIVE 1 /* Start (param1 = 1) or Stop (param1 = 0) */
|
||||
|
||||
/* The final command code, used to validate commands. */
|
||||
#define CMD_LAST_COMMAND 1
|
||||
|
||||
#define TRC_RECORDER_MODE_SNAPSHOT 0
|
||||
#define TRC_RECORDER_MODE_STREAMING 1
|
||||
|
||||
#define TRC_RECORDER_BUFFER_ALLOCATION_STATIC (0x00)
|
||||
#define TRC_RECORDER_BUFFER_ALLOCATION_DYNAMIC (0x01)
|
||||
#define TRC_RECORDER_BUFFER_ALLOCATION_CUSTOM (0x02)
|
||||
|
||||
/* Filter Groups */
|
||||
#define FilterGroup0 (uint16_t)0x0001
|
||||
#define FilterGroup1 (uint16_t)0x0002
|
||||
#define FilterGroup2 (uint16_t)0x0004
|
||||
#define FilterGroup3 (uint16_t)0x0008
|
||||
#define FilterGroup4 (uint16_t)0x0010
|
||||
#define FilterGroup5 (uint16_t)0x0020
|
||||
#define FilterGroup6 (uint16_t)0x0040
|
||||
#define FilterGroup7 (uint16_t)0x0080
|
||||
#define FilterGroup8 (uint16_t)0x0100
|
||||
#define FilterGroup9 (uint16_t)0x0200
|
||||
#define FilterGroup10 (uint16_t)0x0400
|
||||
#define FilterGroup11 (uint16_t)0x0800
|
||||
#define FilterGroup12 (uint16_t)0x1000
|
||||
#define FilterGroup13 (uint16_t)0x2000
|
||||
#define FilterGroup14 (uint16_t)0x4000
|
||||
#define FilterGroup15 (uint16_t)0x8000
|
||||
|
||||
/******************************************************************************
|
||||
* Supported ports
|
||||
*
|
||||
* TRC_HARDWARE_PORT_HWIndependent
|
||||
* A hardware independent fallback option for event timestamping. Provides low
|
||||
* resolution timestamps based on the OS tick.
|
||||
* This may be used on the Win32 port, but may also be used on embedded hardware
|
||||
* platforms. All time durations will be truncated to the OS tick frequency,
|
||||
* typically 1 KHz. This means that a task or ISR that executes in less than
|
||||
* 1 ms get an execution time of zero.
|
||||
*
|
||||
* TRC_HARDWARE_PORT_APPLICATION_DEFINED
|
||||
* Allows for defining the port macros in other source code files.
|
||||
*
|
||||
* TRC_HARDWARE_PORT_Win32
|
||||
* "Accurate" timestamping based on the Windows performance counter for Win32
|
||||
* builds. Note that this gives the host machine time, not the kernel time.
|
||||
*
|
||||
* Hardware specific ports
|
||||
* To get accurate timestamping, a hardware timer is necessary. Below are the
|
||||
* available ports. Some of these are "unofficial", meaning that
|
||||
* they have not yet been verified by Percepio but have been contributed by
|
||||
* external developers. They should work, otherwise let us know by emailing
|
||||
* support@percepio.com. Some work on any OS platform, while other are specific
|
||||
* to a certain operating system.
|
||||
*****************************************************************************/
|
||||
|
||||
/****** Port Name ************************************* Code ** Official ** OS Platform *********/
|
||||
#define TRC_HARDWARE_PORT_APPLICATION_DEFINED 98 /* - - */
|
||||
#define TRC_HARDWARE_PORT_NOT_SET 99 /* - - */
|
||||
#define TRC_HARDWARE_PORT_HWIndependent 0 /* Yes Any */
|
||||
#define TRC_HARDWARE_PORT_Win32 1 /* Yes FreeRTOS on Win32 */
|
||||
#define TRC_HARDWARE_PORT_Atmel_AT91SAM7 2 /* No Any */
|
||||
#define TRC_HARDWARE_PORT_Atmel_UC3A0 3 /* No Any */
|
||||
#define TRC_HARDWARE_PORT_ARM_Cortex_M 4 /* Yes Any */
|
||||
#define TRC_HARDWARE_PORT_Renesas_RX600 6 /* Yes Any */
|
||||
#define TRC_HARDWARE_PORT_MICROCHIP_PIC24_PIC32 7 /* Yes Any */
|
||||
#define TRC_HARDWARE_PORT_TEXAS_INSTRUMENTS_TMS570_RM48 8 /* Yes Any */
|
||||
#define TRC_HARDWARE_PORT_TEXAS_INSTRUMENTS_MSP430 9 /* No Any */
|
||||
#define TRC_HARDWARE_PORT_XILINX_PPC405 11 /* No FreeRTOS */
|
||||
#define TRC_HARDWARE_PORT_XILINX_PPC440 12 /* No FreeRTOS */
|
||||
#define TRC_HARDWARE_PORT_XILINX_MICROBLAZE 13 /* No Any */
|
||||
#define TRC_HARDWARE_PORT_XILINX_ZyncUltraScaleR5 14 /* No FreeRTOS */
|
||||
#define TRC_HARDWARE_PORT_NXP_LPC210X 15 /* No Any */
|
||||
#define TRC_HARDWARE_PORT_ARM_CORTEX_A9 16 /* Yes Any */
|
||||
#define TRC_HARDWARE_PORT_POWERPC_Z4 17 /* No FreeRTOS */
|
||||
#define TRC_HARDWARE_PORT_Altera_NiosII 18 /* Yes Any (Tested with FreeRTOS) */
|
||||
#define TRC_HARDWARE_PORT_PROCESSOR_EXPERT 95 /* No FreeRTOS */ /* << EST */
|
||||
#endif /*TRC_PORTDEFINES_H*/
|
||||
|
||||
1912
pico-sensor/McuLib/TraceRecorder/include/trcRecorder.h
Normal file
1912
pico-sensor/McuLib/TraceRecorder/include/trcRecorder.h
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,195 @@
|
||||
/*******************************************************************************
|
||||
* Trace Recorder Library for Tracealyzer v3.3.0
|
||||
* Percepio AB, www.percepio.com
|
||||
*
|
||||
* trcStreamingPort.h
|
||||
*
|
||||
* The interface definitions for trace streaming ("stream ports").
|
||||
* This "stream port" sets up the recorder to use SEGGER RTT as streaming channel.
|
||||
*
|
||||
* Note that this stream port is more complex than the typical case, since
|
||||
* the J-Link interface uses a separate RAM buffer in SEGGER_RTT.c, instead
|
||||
* of the default buffer included in the recorder core. The other stream ports
|
||||
* offer more typical examples of how to define a custom streaming interface.
|
||||
*
|
||||
* Terms of Use
|
||||
* This file is part of the trace recorder library (RECORDER), which is the
|
||||
* intellectual property of Percepio AB (PERCEPIO) and provided under a
|
||||
* license as follows.
|
||||
* The RECORDER may be used free of charge for the purpose of recording data
|
||||
* intended for analysis in PERCEPIO products. It may not be used or modified
|
||||
* for other purposes without explicit permission from PERCEPIO.
|
||||
* You may distribute the RECORDER in its original source code form, assuming
|
||||
* this text (terms of use, disclaimer, copyright notice) is unchanged. You are
|
||||
* allowed to distribute the RECORDER with minor modifications intended for
|
||||
* configuration or porting of the RECORDER, e.g., to allow using it on a
|
||||
* specific processor, processor family or with a specific communication
|
||||
* interface. Any such modifications should be documented directly below
|
||||
* this comment block.
|
||||
*
|
||||
* Disclaimer
|
||||
* The RECORDER is being delivered to you AS IS and PERCEPIO makes no warranty
|
||||
* as to its use or performance. PERCEPIO does not and cannot warrant the
|
||||
* performance or results you may obtain by using the RECORDER or documentation.
|
||||
* PERCEPIO make no warranties, express or implied, as to noninfringement of
|
||||
* third party rights, merchantability, or fitness for any particular purpose.
|
||||
* In no event will PERCEPIO, its technology partners, or distributors be liable
|
||||
* to you for any consequential, incidental or special damages, including any
|
||||
* lost profits or lost savings, even if a representative of PERCEPIO has been
|
||||
* advised of the possibility of such damages, or for any claim by any third
|
||||
* party. Some jurisdictions do not allow the exclusion or limitation of
|
||||
* incidental, consequential or special damages, or the exclusion of implied
|
||||
* warranties or limitations on how long an implied warranty may last, so the
|
||||
* above limitations may not apply to you.
|
||||
*
|
||||
* Tabs are used for indent in this file (1 tab = 4 spaces)
|
||||
*
|
||||
* Copyright Percepio AB, 2017.
|
||||
* www.percepio.com
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef TRC_STREAMING_PORT_H
|
||||
#define TRC_STREAMING_PORT_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Configuration Macro: TRC_CFG_RTT_BUFFER_SIZE_UP
|
||||
*
|
||||
* Defines the size of the "up" RTT buffer (target -> host) to use for writing
|
||||
* the trace data, for RTT buffer 1 or higher.
|
||||
*
|
||||
* This setting is ignored for RTT buffer 0, which can't be reconfigured
|
||||
* in runtime and therefore hard-coded to use the defines in SEGGER_RTT_Conf.h.
|
||||
*
|
||||
* Default buffer size for Tracealyzer is 5000 bytes.
|
||||
*
|
||||
* If you have a stand-alone J-Link probe, the can be decreased to around 1 KB.
|
||||
* But integrated J-Link OB interfaces are slower and needs about 5-10 KB,
|
||||
* depending on the amount of data produced.
|
||||
******************************************************************************/
|
||||
#define TRC_CFG_RTT_BUFFER_SIZE_UP 1024
|
||||
|
||||
/*******************************************************************************
|
||||
* Configuration Macro: TRC_CFG_RTT_BUFFER_SIZE_DOWN
|
||||
*
|
||||
* Defines the size of the "down" RTT buffer (host -> target) to use for reading
|
||||
* commands from Tracealyzer, for RTT buffer 1 or higher.
|
||||
*
|
||||
* Default buffer size for Tracealyzer is 32 bytes.
|
||||
*
|
||||
* This setting is ignored for RTT buffer 0, which can't be reconfigured
|
||||
* in runtime and therefore hard-coded to use the defines in SEGGER_RTT_Conf.h.
|
||||
******************************************************************************/
|
||||
#define TRC_CFG_RTT_BUFFER_SIZE_DOWN 32
|
||||
|
||||
/*******************************************************************************
|
||||
* Configuration Macro: TRC_CFG_RTT_UP_BUFFER_INDEX
|
||||
*
|
||||
* Defines the RTT buffer to use for writing the trace data. Make sure that
|
||||
* the PC application has the same setting (File->Settings).
|
||||
*
|
||||
* Default: 1
|
||||
*
|
||||
* We don't recommend using RTT buffer 0, since mainly intended for terminals.
|
||||
* If you prefer to use buffer 0, it must be configured in SEGGER_RTT_Conf.h.
|
||||
******************************************************************************/
|
||||
#define TRC_CFG_RTT_UP_BUFFER_INDEX 2 /* << EST */
|
||||
|
||||
/*******************************************************************************
|
||||
* Configuration Macro: TRC_CFG_RTT_DOWN_BUFFER_INDEX
|
||||
*
|
||||
* Defines the RTT buffer to use for reading the trace data. Make sure that
|
||||
* the PC application has the same setting (File->Settings).
|
||||
*
|
||||
* Default: 1
|
||||
*
|
||||
* We don't recommend using RTT buffer 0, since mainly intended for terminals.
|
||||
* If you prefer to use buffer 0, it must be configured in SEGGER_RTT_Conf.h.
|
||||
******************************************************************************/
|
||||
#define TRC_CFG_RTT_DOWN_BUFFER_INDEX 2 /* << EST */
|
||||
/*******************************************************************************
|
||||
* TRC_CFG_RTT_MODE
|
||||
* This stream port for J-Link streaming relies on SEGGER RTT, that contains an
|
||||
* internal RAM buffer read by the J-Link probes during execution.
|
||||
*
|
||||
* Possible values:
|
||||
* - SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL (default)
|
||||
* - SEGGER_RTT_MODE_NO_BLOCK_SKIP
|
||||
*
|
||||
* We recommend using SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL, to ensure you get a
|
||||
* complete and valid trace. This may however cause blocking if your streaming
|
||||
* interface isn't fast enough, which may disturb the real-time behavior.
|
||||
* We therefore recommend to try SEGGER_RTT_MODE_NO_BLOCK_SKIP as well.
|
||||
* In this mode, Tracealyzer will report lost events if the transfer is not
|
||||
* fast enough. In that case, try increasing the size of the "up buffer".
|
||||
******************************************************************************/
|
||||
#define TRC_CFG_RTT_MODE SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL
|
||||
|
||||
#include "SEGGER_RTT_Conf.h"
|
||||
#include "SEGGER_RTT.h"
|
||||
|
||||
#if (TRC_CFG_RTT_UP_BUFFER_INDEX >= SEGGER_RTT_MAX_NUM_UP_BUFFERS)
|
||||
#error "TRC_CFG_RTT_UP_BUFFER_INDEX must be smaller than SEGGER_RTT_MAX_NUM_UP_BUFFERS"
|
||||
#endif
|
||||
|
||||
#if (TRC_CFG_RTT_DOWN_BUFFER_INDEX >= SEGGER_RTT_MAX_NUM_DOWN_BUFFERS)
|
||||
#error "TRC_CFG_RTT_DOWN_BUFFER_INDEX must be smaller than SEGGER_RTT_MAX_NUM_DOWN_BUFFERS"
|
||||
#endif
|
||||
|
||||
/* If index is defined as 0, the internal RTT buffers will be used instead of this. */
|
||||
#if TRC_CFG_RTT_UP_BUFFER_INDEX == 0
|
||||
#define TRC_RTT_ALLOC_UP() static char* _TzTraceData = NULL; /* Not actually used. Ignore allocation method. */
|
||||
#define TRC_STREAM_PORT_MALLOC() /* Static allocation. Not used. */
|
||||
#else
|
||||
#if TRC_CFG_RECORDER_BUFFER_ALLOCATION == TRC_RECORDER_BUFFER_ALLOCATION_STATIC
|
||||
#define TRC_RTT_ALLOC_UP() char _TzTraceData[TRC_CFG_RTT_BUFFER_SIZE_UP]; /* Static allocation */
|
||||
#define TRC_STREAM_PORT_MALLOC() /* Static allocation. Not used. */
|
||||
#endif
|
||||
#if TRC_CFG_RECORDER_BUFFER_ALLOCATION == TRC_RECORDER_BUFFER_ALLOCATION_DYNAMIC
|
||||
#define TRC_RTT_ALLOC_UP() char* _TzTraceData = NULL; /* Dynamic allocation */
|
||||
#define TRC_STREAM_PORT_MALLOC() _TzTraceData = TRC_PORT_MALLOC(TRC_CFG_RTT_BUFFER_SIZE_UP);
|
||||
#endif
|
||||
#if TRC_CFG_RECORDER_BUFFER_ALLOCATION == TRC_RECORDER_BUFFER_ALLOCATION_CUSTOM
|
||||
#define TRC_RTT_ALLOC_UP() char* _TzTraceData = NULL; /* Custom allocation, user needs to call vTraceSetRecorderDataBuffer before vTraceEnable, to assign this */
|
||||
#define TRC_STREAM_PORT_MALLOC() /* Not used in custom mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Down-buffer. If index is defined as 0, the internal RTT buffers will be used instead of this. */ \
|
||||
#if TRC_CFG_RTT_DOWN_BUFFER_INDEX == 0
|
||||
#define TRC_RTT_ALLOC_DOWN() static char* _TzCtrlData = NULL; /* Not actually used. Ignore allocation method. */
|
||||
#else
|
||||
#define TRC_RTT_ALLOC_DOWN() static char _TzCtrlData[TRC_CFG_RTT_BUFFER_SIZE_DOWN]; /* Always static allocation, since usually small. */
|
||||
#endif
|
||||
|
||||
#define TRC_STREAM_PORT_ALLOCATE_FIELDS() \
|
||||
TRC_RTT_ALLOC_UP() /* Macro that will result in proper UP buffer allocation */ \
|
||||
TRC_RTT_ALLOC_DOWN() /* Macro that will result in proper DOWN buffer allocation */
|
||||
|
||||
int32_t readFromRTT(void* ptrData, uint32_t size, int32_t* ptrBytesRead);
|
||||
|
||||
int32_t writeToRTT(void* ptrData, uint32_t size, int32_t* ptrBytesWritten);
|
||||
|
||||
|
||||
#define TRC_STREAM_PORT_INIT() \
|
||||
TRC_STREAM_PORT_MALLOC(); /*Dynamic allocation or empty if static */ \
|
||||
SEGGER_RTT_ConfigUpBuffer(TRC_CFG_RTT_UP_BUFFER_INDEX, "TzData", _TzTraceData, TRC_CFG_RTT_BUFFER_SIZE_UP, TRC_CFG_RTT_MODE ); \
|
||||
SEGGER_RTT_ConfigDownBuffer(TRC_CFG_RTT_DOWN_BUFFER_INDEX, "TzCtrl", _TzCtrlData, TRC_CFG_RTT_BUFFER_SIZE_DOWN, TRC_CFG_RTT_MODE);
|
||||
|
||||
/* Important for the J-Link port, in most other ports this can be skipped (default is 1) */
|
||||
#define TRC_STREAM_PORT_USE_INTERNAL_BUFFER 0
|
||||
|
||||
#define TRC_STREAM_PORT_WRITE_DATA(_ptrData, _size, _ptrBytesWritten) writeToRTT(_ptrData, _size, _ptrBytesWritten)
|
||||
|
||||
#define TRC_STREAM_PORT_READ_DATA(_ptrData, _size, _ptrBytesRead) readFromRTT(_ptrData, _size, _ptrBytesRead)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* TRC_STREAMING_PORT_H */
|
||||
|
||||
419
pico-sensor/McuLib/TraceRecorder/tracealyzer_readme.txt
Normal file
419
pico-sensor/McuLib/TraceRecorder/tracealyzer_readme.txt
Normal file
@@ -0,0 +1,419 @@
|
||||
-------------------------------------------------------------------------------
|
||||
Tracealyzer Recorder Library for FreeRTOS
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Tracealyzer is a sophisticated tool for tracing and visualization
|
||||
of FreeRTOS-based software systems.
|
||||
|
||||
Tracealyzer gives an unprecedented insight into the runtime behavior, which
|
||||
speeds up debugging, validation and optimization.
|
||||
|
||||
This, the Trace Recorder Library, is the target-side part of Tracealyzer, that
|
||||
performs the actual tracing. The resulting data can then be viewed in the
|
||||
Tracealyzer PC application, found at https://percepio.com/tracealyzer
|
||||
|
||||
To learn more, see these links.
|
||||
|
||||
- Getting Started (videos etc): https://percepio.com/gettingstarted
|
||||
|
||||
- FAQ: https://percepio.com/category/faq
|
||||
|
||||
In case you have any questions, don't hesitate to contact support@percepio.com
|
||||
|
||||
Tracealyzer supports FreeRTOS v7.3 and newer, including Amazon FreeRTOS.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Changes, v4.3.11 -> v4.4.1
|
||||
- Updates to the USB CDC streamport
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Changes, v4.3.10 -> v4.3.11
|
||||
- Adapted for new Task Notify changes
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Changes, v4.3.8 -> v4.3.10
|
||||
- Fixed accidental C99 reliance
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Changes, v4.3.7 -> v4.3.8
|
||||
- Modified how FreeRTOS versions are configured in the trace library.
|
||||
- traceQUEUE_SET_SEND() was added.
|
||||
- Now informs users of FreeRTOS v10.3.X that the trace point traceQUEUE_SEND in
|
||||
prvNotifyQueueSetContainer() should be changed to traceQUEUE_SET_SEND.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Changes, v4.3.5 -> v4.3.7
|
||||
- Fixed issue where ISR naming would not always work.
|
||||
- Fixed "errno" issue with certain compilers when using lwip streaming port.
|
||||
- Recorder now makes sure all streaming trace header info is successfully sent
|
||||
before moving on.
|
||||
- Recorder warns if TRC_CFG_PAGED_EVENT_BUFFER_PAGE_COUNT > 128 since code
|
||||
isn't designed for that.
|
||||
- Made sure uiTraceSystemState is always declared in snapshot recorder.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Changes, v4.3.1 -> v4.3.5
|
||||
- A previously removed define is no longer used when configSUPPORT_STATIC_ALLOCATION is 1
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Changes, v4.3.0 -> v4.3.1
|
||||
- Name string no longer has to have unique address when calling xTraceSetISRProperties()
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Changes, v4.2.12 -> v4.3.0
|
||||
- Improved Streaming stability in regards to starting/stopping.
|
||||
- Added support for STACK usage reports.
|
||||
- Added vTraceVPrintF() that accepts a va_list as argument.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Changes, v4.2.2 -> v4.2.12
|
||||
|
||||
- Changed a call to vTracePrintF() into vTracePrint().
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Changes, v4.2.1 -> v4.2.2
|
||||
|
||||
- TRC_STREAM_PORT_WRITE_DATA() no longer has to deal with null pointers. Better
|
||||
for custom StreamPort implementations.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Changes, v4.1.7 -> v4.2.1
|
||||
|
||||
- Added support for initial heap usage at trace start in Streaming mode.
|
||||
- Fixed bug regarding failed malloc calls in Streaming mode.
|
||||
- Added support for tracing failed malloc calls in Snapshot mode.
|
||||
- Better way of setting initial task "(startup)" in Streaming mode.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Changes, v4.1.5 -> v4.1.7
|
||||
|
||||
- vQueueSendToFront() and vQueueSendToFrontFromISR() are now traced properly in
|
||||
Snaphot mode.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Changes, v4.1.4 -> v4.1.5
|
||||
|
||||
- Fixed a bug in the ITM stream port, that required Port 0 to be enabled.
|
||||
- Added missing include of stdio.h (needed by vTraceConsoleChannelPrintF).
|
||||
- Moved standard includes from trcRecorder.h into the .c files needing them.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Changes, v4.1.2 -> v4.1.4
|
||||
|
||||
- Fixed a compile error when certain FreeRTOS settings were used
|
||||
- Disabled filter support for FreeRTOS v7.3 since it uses "char" for object id
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Changes, v4.1.0 -> v4.1.2
|
||||
|
||||
- Added vTraceConsoleChannelPrintF(...)
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Changes, v4.0.3 -> v4.1.0
|
||||
|
||||
- Improved performance of User Events
|
||||
- Fixed handling of format strings ending with '%'
|
||||
- Improved handling of creative user configuration macros
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Changes, v4.0.2 -> v4.0.3
|
||||
|
||||
- Minor fix for TCP/IP stream port.
|
||||
- Corrected default RTT mode setting.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Changes, v4.0.1 -> v4.0.2
|
||||
|
||||
- Memory allocation trace events now ignore filters.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Changes, v4.0.0 -> v4.0.1
|
||||
|
||||
- Minor fixes to default values.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Changes, v3.3.0 -> v4.0.0
|
||||
|
||||
- Fixed some issues with filters.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Changes, v3.2.0 -> v3.3.0
|
||||
|
||||
- Added support for FreeRTOS v10, including the new object types Message Buffer
|
||||
and Stream Buffer.
|
||||
|
||||
- Improved the object-level filtering to also support Timer, Event Group,
|
||||
Message Buffer and Stream Buffer objects.
|
||||
|
||||
- Fixed a few remaining build problems with older FreeRTOS versions (v7.x).
|
||||
|
||||
- vTraceStoreISRBegin now reports an error on invalid handles, i.e., if the
|
||||
initialization of the handle (xTraceSetISRProperties) had not been made.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Changes, v3.1.2 -> v3.2.0
|
||||
|
||||
- Added new filtering system - that works in both snapshot and streaming mode.
|
||||
Filtering was previously not supported in streaming mode, but can be very
|
||||
useful for slower streaming interfaces. By exluding irrelevant events, the
|
||||
amount of data produced can be reduced a lot.
|
||||
|
||||
* New functions vTraceSetFilterGroup and vTraceSetFilterMask allows for
|
||||
excluding all events from specific objects (like a semaphore or queue).
|
||||
|
||||
* Added new "generic" filters (preprocessor level) to trcConfig.h, that
|
||||
exclude all events of a particular types.
|
||||
- TRC_CFG_INCLUDE_NOTIFY_EVENTS
|
||||
- TRC_CFG_INCLUDE_EVENT_GROUP_EVENTS
|
||||
- TRC_CFG_INCLUDE_PEND_FUNC_CALL_EVENTS
|
||||
- TRC_CFG_INCLUDE_TIMER_EVENTS
|
||||
|
||||
* Upgraded some previous filters from "Snapshot only" to the Common API
|
||||
and thereby moved them from trcSnapshotConfig.h to trcConfig.h.
|
||||
- TRC_CFG_SCHEDULING_ONLY
|
||||
- TRC_CFG_INCLUDE_MEMMANG_EVENTS
|
||||
- TRC_CFG_INCLUDE_USER_EVENTS
|
||||
- TRC_CFG_INCLUDE_ISR_TRACING
|
||||
- TRC_CFG_INCLUDE_READY_EVENTS
|
||||
- TRC_CFG_INCLUDE_OSTICK_EVENTS
|
||||
|
||||
* Removed the old filter system from trcSnapshotRecorder.c.
|
||||
|
||||
- Improved streaming interface - Now only two (2) macros are needed to be
|
||||
defined in most cases, read and write. This makes it a lot easier to make
|
||||
custom stream ports.
|
||||
|
||||
* Many definitions that were identical in most stream ports, have been
|
||||
replaced by default definitions in the recorder core. If needed, they
|
||||
can be overriden by custom definitions in trcStreamingPort.h.
|
||||
|
||||
* Stream ports are now assumed to use recorder's internal event buffer.
|
||||
Other stream ports that writes directly to the streaming interface
|
||||
(like J-Link) should define TRC_STREAM_PORT_USE_INTERNAL_BUFFER
|
||||
as zero (0) to make it work correctly.
|
||||
|
||||
* Macro TRC_STREAM_PORT_PERIODIC_SEND_DATA has been replaced by
|
||||
TRC_STREAM_PORT_WRITE_DATA. Together with TRC_STREAM_PORT_READ_DATA,
|
||||
this is all that is necessary for a typical stream port.
|
||||
|
||||
* Return values from the stream port macros READ_DATA and WRITE_DATA are
|
||||
now checked. Expects 0 on success, anything else produces a warning
|
||||
that can be retrived using xTraceGetLastError() and also seen in
|
||||
Tracealyzer if a trace was produced.
|
||||
|
||||
* Stream ports should no longer call prvPagedEventBufferInit explicitly
|
||||
(e.g. in TRC_STREAM_PORT_ON_TRACE_BEGIN). This is now called
|
||||
automatically if TRC_STREAM_PORT_USE_INTERNAL_BUFFER == 1.
|
||||
|
||||
* Macros TRC_STREAM_PORT_ON_TRACE_BEGIN and TRC_STREAM_PORT_ON_TRACE_END
|
||||
are now unused by default and don't need to be defined.
|
||||
You can however use them to hook in some own function at these events.
|
||||
|
||||
- Added two new stream ports
|
||||
|
||||
* TCPIP-Win32: allows for testing the streaming on Windows ports of your
|
||||
RTOS, using Winsock.
|
||||
|
||||
* File: example of streaming to a local file system (tested on Windows,
|
||||
but easy to modify).
|
||||
|
||||
- Added support for FreeRTOS v9.0.1
|
||||
|
||||
* Replaced FreeRTOS version code TRC_FREERTOS_VERSION_9_X with
|
||||
- TRC_FREERTOS_VERSION_9_0_0
|
||||
- TRC_FREERTOS_VERSION_9_0_1
|
||||
|
||||
* Using TRC_FREERTOS_VERSION_9_X is no longer allowed.
|
||||
|
||||
- Added additional events for xQueuePeek, for blocking and timeouts events.
|
||||
|
||||
- Added event for traceTIMER_EXPIRED, showing when the timer callback
|
||||
function is called.
|
||||
|
||||
- Improved diagnostics in streaming mode, in case of errors in the recorder.
|
||||
|
||||
* Added prvTraceWarning() - registers a "warning" error code, without
|
||||
stopping the recorder. Called if READ_DATA or WRITE_DATA returns a
|
||||
non-zero value, and in several other cases where the recorder
|
||||
configuration is incorrect (e.g., too small symbol table).
|
||||
|
||||
* Added several new warning codes (PSF_WARNING_XYZ), corresponding to the
|
||||
issues detected by prvCheckRecorderStatus.
|
||||
|
||||
* Fixed duplicate definitions of warning messages, so the warnings reported
|
||||
to Tracealyzer are the same as those provided in xTraceGetLastError().
|
||||
|
||||
* Added better explainations of warning/error messages in the body of
|
||||
xTraceGetLastError (in streaming mode).
|
||||
|
||||
- Added xTraceIsRecordingEnabled() to Common API.
|
||||
|
||||
- Added "unofficial" hardware port for Altera Nios-II.
|
||||
This is a user contribition, not yet verified by Percerpio.
|
||||
|
||||
- Fixed bug in vTraceEnable - option TRC_START_AWAIT_HOST was ignored if already initialized.
|
||||
|
||||
- Fixed a few remaining compiler warnings.
|
||||
|
||||
- Changed order of some settings in trcConfig.h - moved advanced stuff to the
|
||||
bottom.
|
||||
|
||||
- Removed SEGGER_RTT_Printf.c from the J-Link stream port since not required
|
||||
for Tracealyzer.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Changes, v3.1.1 -> v3.1.2
|
||||
- Fixed two bugs related to User Events, one in vTracePrintF and other in vTracePrint.
|
||||
|
||||
- Fixed a build problem related to a single reference of the old FreeRTOS type "xTaskHandle", in trcKernelPort.c.
|
||||
Changed to "TaskHandle_t", unless if using an older FreeRTOS kernel or the "compatibility mode".
|
||||
|
||||
- Removed traceCREATE_MUTEX hook for FreeRTOS v9 or later (no longer required)
|
||||
|
||||
- Updated the User Manual regarding snapshot trace via IAR Embedded Workbench.
|
||||
|
||||
- Renamed vTraceGetTraceBuffer to xTraceGetTraceBuffer, since returning a pointer.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Changes, v3.1.0 -> v3.1.1
|
||||
|
||||
After the major changes in the v3.1.0 trace recorder library, this update
|
||||
corrects a number of minor issues. Only minor functional improvements.
|
||||
|
||||
- You can now use TRC_ALLOC_CUSTOM_BUFFER to declare a trace buffer on a custom
|
||||
location (using linker directives).
|
||||
The related function vTraceSetRecorderDataBuffer has been promoted to the
|
||||
Common API (previously only supported in snapshot mode, but custom allocation
|
||||
is now generally supported also in streaming mode).
|
||||
|
||||
- Removed TRC_CFG_USE_LINKER_PRAGMA. No longer necessary thanks to the custom
|
||||
allocation mode.
|
||||
|
||||
- Added support for timestamping from custom periodic timers, required for
|
||||
accurate timestamping on Cortex-M0/M0+ devices when using tickless idle.
|
||||
Only for streaming mode so far. See TRC_CUSTOM_TIMER_INCR / DECR.
|
||||
|
||||
- ARM Cortex-M port: Made sure the DWT unit is initialized properly, in case
|
||||
the debugger doesn't handle this.
|
||||
|
||||
- ARM Cortex-M port: Added possibility to use Systick timestamping also on
|
||||
Cortex-M3/M4/M7 devices (that otherwise use DWT timestamping by default).
|
||||
To use this option, define the macro TRC_CFG_ARM_CM_USE_SYSTICK.
|
||||
|
||||
- J-Link streaming: The default RTT buffer has been changed from 0 to 1.
|
||||
|
||||
- J-Link streaming: The RTT buffer settings for buffer 1 and higher, are now
|
||||
found in trcStreamingPort.h. Note: These settings don't apply to buffer 0.
|
||||
|
||||
- vTracePrint has been optimized for better performance in string logging.
|
||||
|
||||
- Minor performance improvement related to symbol table transfer in streaming mode.
|
||||
|
||||
- Timer names now registered also in streaming mode.
|
||||
|
||||
- Timer start and stop event are now traced.
|
||||
|
||||
- Implemented support for queue registry (traceQUEUE_REGISTRY_ADD) also for streaming.
|
||||
|
||||
- Fixed a bug related to repeated calls of vTraceEnable.
|
||||
|
||||
- Fixed a bug where task-switches seemed to occur even though the scheduler was disabled.
|
||||
|
||||
- Renamed HARDWARE_PORT_TEXAS_INSTRUMENTS_TMS570_RM48, added prefix TRC.
|
||||
|
||||
- Fixed several language issues in the comments and documentation.
|
||||
|
||||
- Fixed several minor issues and warnings from different compilers
|
||||
(including PowerPC/gcc) and configurations.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Changes, v3.0.9 -> v3.1.0
|
||||
|
||||
- Merge of previously separated snapshot and streaming recorders into a single
|
||||
recorder supporting both streaming and snapshot as different modes.
|
||||
|
||||
- New common API for supporting both streaming and snapshot modes.
|
||||
|
||||
- New integration guide, see the User Manual.
|
||||
|
||||
- Major improvement of API documentation in source files and User Manual.
|
||||
|
||||
- New concept of "stream ports", giving a better structure defining streaming
|
||||
interfaces, and restructured the J-Link and TCP/IP streaming as stream ports.
|
||||
|
||||
- Added a stream port for USB CDC connections, with STM32 as example.
|
||||
Since Tracealyzer now can receive serial data on Windows COM ports, this is
|
||||
really easy to use.
|
||||
|
||||
- Added a warning (#error) for cases where FreeRTOS tickless idle mode is used
|
||||
together with timestamping using SysTick or other periodic interrupt timers,
|
||||
Tracing with tickless idle requires an independent time source to correctly
|
||||
capture the length of the idle periods.
|
||||
|
||||
- Major changes in the recorder API. Important examples are:
|
||||
|
||||
* Some configuration macros have changed names, e.g. for "hardware port".
|
||||
Make sure to remove any old "trcConfig.h" files if upgrading from an
|
||||
earlier version!
|
||||
|
||||
* Recorder configuration in trcConfig.h has been minimized and now only
|
||||
includes the important settings that are independent of recorder mode.
|
||||
Advanced settings for each mode are found in trcSnapshotConfig.h and
|
||||
trcStreamingConfig.h.
|
||||
|
||||
* vTraceEnable replaces Trace_Init and vTraceInitTraceData, as well as
|
||||
vTraceStart and uiTraceStart.
|
||||
|
||||
* vTraceStop now part of the common API and thereby available also in
|
||||
streaming. And since vTraceEnable can start the streaming directly
|
||||
you have the option control the tracing from target, e.g., for
|
||||
streaming to a device file system.
|
||||
|
||||
* vTraceStoreKernelObjectName from old streaming recorder has been replaced
|
||||
by vTraceSetQueueName, vTraceSetSemaphoreName, etc.
|
||||
|
||||
* vTraceSetISRProperties now returns a "traceHandle" that should be passed as
|
||||
parameter to vTraceStoreISRBegin and vTraceStoreISREnd.
|
||||
|
||||
* xTraceRegisterString has replaced the old functions xTraceOpenLabel and
|
||||
vTraceStoreUserEventChannelName. This now returns a "traceString" for use
|
||||
as "channel" parameter in vTracePrintF, and in other places where strings
|
||||
are stored.
|
||||
|
||||
* Removed vTraceStoreISREndManual and vTraceStoreISREndAuto, use
|
||||
vTraceStoreISREnd instead.
|
||||
|
||||
* Renamed the functions for saving User Events in a separate buffer:
|
||||
- xTraceRegisterChannelFormat -> xTraceRegisterUBChannel
|
||||
- vTraceChannelPrintF -> vTraceUBData
|
||||
- vTraceChannelUserEvent -> vTraceUBEvent
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright Percepio AB, 2018.
|
||||
|
||||
1088
pico-sensor/McuLib/TraceRecorder/trcKernelPort.c
Normal file
1088
pico-sensor/McuLib/TraceRecorder/trcKernelPort.c
Normal file
File diff suppressed because it is too large
Load Diff
3103
pico-sensor/McuLib/TraceRecorder/trcSnapshotRecorder.c
Normal file
3103
pico-sensor/McuLib/TraceRecorder/trcSnapshotRecorder.c
Normal file
File diff suppressed because it is too large
Load Diff
46
pico-sensor/McuLib/TraceRecorder/trcStreamingPort.c
Normal file
46
pico-sensor/McuLib/TraceRecorder/trcStreamingPort.c
Normal file
@@ -0,0 +1,46 @@
|
||||
|
||||
#include "trcRecorder.h"
|
||||
|
||||
#if (TRC_USE_TRACEALYZER_RECORDER == 1)
|
||||
#if (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING)
|
||||
|
||||
int32_t readFromRTT(void* ptrData, uint32_t size, int32_t* ptrBytesRead)
|
||||
{
|
||||
uint32_t bytesRead = 0;
|
||||
|
||||
if (SEGGER_RTT_HASDATA(TRC_CFG_RTT_DOWN_BUFFER_INDEX))
|
||||
{
|
||||
bytesRead = SEGGER_RTT_Read(TRC_CFG_RTT_DOWN_BUFFER_INDEX, (char*)ptrData, size);
|
||||
|
||||
if (ptrBytesRead != NULL)
|
||||
*ptrBytesRead = (int32_t)bytesRead;
|
||||
|
||||
if (bytesRead != size)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t writeToRTT(void* ptrData, uint32_t size, int32_t* ptrBytesWritten)
|
||||
{
|
||||
uint32_t bytesWritten = SEGGER_RTT_Write(TRC_CFG_RTT_UP_BUFFER_INDEX, (const char*)ptrData, size);
|
||||
|
||||
if (ptrBytesWritten != NULL)
|
||||
*ptrBytesWritten = (int32_t)bytesWritten;
|
||||
|
||||
if (bytesWritten != size)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
2043
pico-sensor/McuLib/TraceRecorder/trcStreamingRecorder.c
Normal file
2043
pico-sensor/McuLib/TraceRecorder/trcStreamingRecorder.c
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user