#define INCLUDE_pcTaskGetTaskName 1\r
#define INCLUDE_eTaskGetState 1\r
#define INCLUDE_xSemaphoreGetMutexHolder 1\r
-#define INCLUDE_xTimerPendFunctionCallFromISR 1\r
+#define INCLUDE_xTimerPendFunctionCall 1\r
\r
/* It is a good idea to define configASSERT() while developing. configASSERT()\r
uses the same semantics as the standard C assert() macro. */\r
/*******************************************************************************\r
- * Tracealyzer v2.4.1 Recorder Library\r
+ * Tracealyzer v2.6.0 Recorder Library\r
* Percepio AB, www.percepio.com\r
*\r
* trcConfig.h\r
#ifndef TRCCONFIG_H\r
#define TRCCONFIG_H\r
\r
-#include <stdint.h>\r
-\r
/*******************************************************************************\r
* CONFIGURATION RELATED TO CAPACITY AND ALLOCATION \r
******************************************************************************/\r
* stores User Events labels and names of deleted tasks, queues, or other kernel\r
* objects. Note that the names of active objects not stored here but in the \r
* Object Table. Thus, if you don't use User Events or delete any kernel \r
- * objects you set this to zero (0) to minimize RAM usage.\r
+ * objects you set this to a very low value, e.g. 4, but not zero (0) since \r
+ * this causes a declaration of a zero-sized array, for which the C compiler\r
+ * behavior is not standardized and may cause misaligned data.\r
******************************************************************************/\r
#define SYMBOL_TABLE_SIZE 5000\r
\r
+#if (SYMBOL_TABLE_SIZE == 0)\r
+#error "SYMBOL_TABLE_SIZE may not be zero!"\r
+#endif\r
+\r
/*******************************************************************************\r
* USE_SEPARATE_USER_EVENT_BUFFER\r
*\r
* check the actual usage in Tracealyzer. This is shown by selecting\r
* View -> Trace Details -> Resource Usage -> Object Table\r
* \r
- * NOTE 2: Remember to account for all tasks created by the kernel, such as the \r
- * IDLE task, timer task, and any tasks created by other 3rd party \r
- * software components, such as communication stacks. The recorder also has an \r
- * optional monitor task to account for, if this is used.\r
+ * NOTE 2: Remember to account for all tasks and other objects created by \r
+ * the kernel, such as the IDLE task, any timer tasks, and any tasks created \r
+ * by other 3rd party software components, such as communication stacks.\r
* Moreover, one task slot is used to indicate "(startup)", i.e., a fictive \r
* task that represent the time before the scheduler starts. \r
* NTask should thus be at least 2-3 slots larger than your application task count.\r
#define NQueue 60\r
#define NSemaphore 60\r
#define NMutex 60\r
+#define NTimer 200\r
+#define NEventGroup 60\r
\r
/* Maximum object name length for each class (includes zero termination) */\r
#define NameLenTask 15\r
#define NameLenQueue 15\r
#define NameLenSemaphore 15\r
#define NameLenMutex 15\r
+#define NameLenTimer 15\r
+#define NameLenEventGroup 15\r
\r
/******************************************************************************\r
* TRACE_DESCRIPTION\r
* much faster than a printf and can therefore be used in timing critical code.\r
* See vTraceUserEvent() and vTracePrintF() in trcUser.h\r
* \r
- * Note that Tracealyzer Standard Edition or Professional Edition is required\r
- * for User Events, they are not displayed in Tracealyzer Free Edition.\r
+ * Note that User Events are not displayed in FreeRTOS+Trace Free Edition.\r
*****************************************************************************/\r
#define INCLUDE_USER_EVENTS 1\r
\r
* traced kernel objects are deleted at runtime. If no deletes are made, this \r
* can be set to 0 in order to exclude the delete-handling code.\r
*****************************************************************************/\r
-#define INCLUDE_OBJECT_DELETE 0\r
+#define INCLUDE_OBJECT_DELETE 1\r
\r
/******************************************************************************\r
* CONFIGURATION RELATED TO BEHAVIOR\r
#define TRACE_PROGRESS_MONITOR_TASK_PERIOD 1000\r
#endif\r
\r
+\r
/******************************************************************************\r
- * TEAM_LICENSE_CODE\r
+ * USE_16BIT_OBJECT_HANDLES\r
+ *\r
+ * Macro which should be defined as either zero (0) or one (1).\r
+ * Default is 0.\r
+ *\r
+ * If set to 0 (zero), the recorder uses 8-bit handles to identify kernel \r
+ * objects such as tasks and queues. This limits the supported number of\r
+ * concurrently active objects to 255 of each type (object class).\r
*\r
- * Macro which defines a string - the team license code.\r
- * If no team license is available, this should be an empty string "".\r
- * This should be maximum 32 chars, including zero-termination.\r
+ * If set to 1 (one), the recorder uses 16-bit handles to identify kernel \r
+ * objects such as tasks and queues. This limits the supported number of\r
+ * concurrent objects to 65535 of each type (object class). However, since the\r
+ * object property table is limited to 64 KB, the practical limit is about\r
+ * 3000 objects in total. \r
+ * \r
+ * NOTE: An object with a high ID (> 255) will generate an extra event \r
+ * (= 4 byte) in the event buffer. \r
+ * \r
+ * NOTE: Some internal tables in the recorder gets larger when using 16-bit \r
+ * handles. The additional RAM usage is 5-10 byte plus 1 byte per kernel object\r
+ *, i.e., task, queue, semaphore, mutex, etc.\r
*****************************************************************************/\r
-#define TEAM_LICENSE_CODE ""\r
+#define USE_16BIT_OBJECT_HANDLES 0\r
+\r
+/****** Port Name ******************** Code ** Official ** OS Platform ******\r
+* PORT_APPLICATION_DEFINED -2 - - \r
+* PORT_NOT_SET -1 - - \r
+* PORT_HWIndependent 0 Yes Any \r
+* PORT_Win32 1 Yes FreeRTOS Win32\r
+* PORT_Atmel_AT91SAM7 2 No Any \r
+* PORT_Atmel_UC3A0 3 No Any \r
+* PORT_ARM_CortexM 4 Yes Any \r
+* PORT_Renesas_RX600 5 Yes Any \r
+* PORT_Microchip_dsPIC_AND_PIC24 6 Yes Any \r
+* PORT_TEXAS_INSTRUMENTS_TMS570 7 No Any \r
+* PORT_TEXAS_INSTRUMENTS_MSP430 8 No Any \r
+* PORT_MICROCHIP_PIC32 9 No Any \r
+* PORT_XILINX_PPC405 10 No FreeRTOS \r
+* PORT_XILINX_PPC440 11 No FreeRTOS \r
+* PORT_XILINX_MICROBLAZE 12 No Any \r
+* PORT_NXP_LPC210X 13 No Any \r
+*****************************************************************************/\r
+#define SELECTED_PORT PORT_Win32\r
+\r
+#if (SELECTED_PORT == PORT_NOT_SET)\r
+#error "You need to define SELECTED_PORT here!"\r
+#endif\r
+\r
+/******************************************************************************\r
+* USE_PRIMASK_CS (for Cortex M devices only)\r
+*\r
+* An integer constant that selects between two options for the critical\r
+* sections of the recorder library.\r
+ *\r
+* 0: The default FreeRTOS critical section (BASEPRI) - default setting\r
+* 1: Always disable ALL interrupts (using PRIMASK)\r
+ *\r
+* Option 0 uses the standard FreeRTOS macros for critical sections.\r
+* However, on Cortex-M devices they only disable interrupts with priorities \r
+* below a certain configurable level, while higher priority ISRs remain active.\r
+* Such high-priority ISRs may not use the recorder functions in this mode.\r
+*\r
+* Option 1 allows you to safely call the recorder from any ISR, independent of \r
+* the interrupt priority. This mode may however cause higher IRQ latencies\r
+* (some microseconds) since ALL configurable interrupts are disabled during \r
+* the recorder's critical sections in this mode, using the PRIMASK register.\r
+ ******************************************************************************/\r
+#define USE_PRIMASK_CS 0\r
+\r
\r
#endif\r
\r
+++ /dev/null
-/******************************************************************************* \r
- * Tracealyzer v2.4.1 Recorder Library\r
- * Percepio AB, www.percepio.com\r
- *\r
- * trcHardwarePort.h\r
- *\r
- * Contains together with trcHardwarePort.c all hardware portability issues of \r
- * the trace recorder library.\r
- *\r
- * Terms of Use\r
- * This software is copyright Percepio AB. The recorder library is free for\r
- * use together with Percepio products. You may distribute the recorder library\r
- * in its original form, including modifications in trcPort.c and trcPort.h\r
- * given that these modification are clearly marked as your own modifications\r
- * and documented in the initial comment section of these source files. \r
- * This software is the intellectual property of Percepio AB and may not be \r
- * sold or in other ways commercially redistributed without explicit written \r
- * permission by Percepio AB.\r
- *\r
- * Disclaimer \r
- * The trace tool and recorder library is being delivered to you AS IS and \r
- * Percepio AB makes no warranty as to its use or performance. Percepio AB does \r
- * not and cannot warrant the performance or results you may obtain by using the \r
- * software or documentation. Percepio AB make no warranties, express or \r
- * implied, as to noninfringement of third party rights, merchantability, or \r
- * fitness for any particular purpose. In no event will Percepio AB, its \r
- * technology partners, or distributors be liable to you for any consequential, \r
- * incidental or special damages, including any lost profits or lost savings, \r
- * even if a representative of Percepio AB has been advised of the possibility \r
- * of such damages, or for any claim by any third party. Some jurisdictions do \r
- * not allow the exclusion or limitation of incidental, consequential or special \r
- * damages, or the exclusion of implied warranties or limitations on how long an \r
- * implied warranty may last, so the above limitations may not apply to you.\r
- *\r
- * Copyright Percepio AB, 2013.\r
- * www.percepio.com\r
- ******************************************************************************/\r
-\r
-#ifndef TRCPORT_H\r
-#define TRCPORT_H\r
-\r
-#include "trcKernelPort.h"\r
-\r
-/* If Win32 port */\r
-#ifdef WIN32\r
-\r
- #undef _WIN32_WINNT\r
- #define _WIN32_WINNT 0x0600\r
-\r
- /* Standard includes. */\r
- #include <stdio.h>\r
- #include <windows.h>\r
- #include <direct.h>\r
-\r
-/*******************************************************************************\r
- * The Win32 port by default saves the trace to file and then kills the\r
- * program when the recorder is stopped, to facilitate quick, simple tests\r
- * of the recorder.\r
- ******************************************************************************/\r
- #define WIN32_PORT_SAVE_WHEN_STOPPED 1\r
- #define WIN32_PORT_EXIT_WHEN_STOPPED 1\r
-\r
-#endif\r
-\r
-#define DIRECTION_INCREMENTING 1\r
-#define DIRECTION_DECREMENTING 2\r
-\r
-/******************************************************************************\r
- * Supported ports\r
- * \r
- * PORT_HWIndependent\r
- * A hardware independent fallback option for event timestamping. Provides low \r
- * resolution timestamps based on the OS tick.\r
- * This may be used on the Win32 port, but may also be used on embedded hardware \r
- * platforms. All time durations will be truncated to the OS tick frequency, \r
- * typically 1 KHz. This means that a task or ISR that executes in less than \r
- * 1 ms get an execution time of zero.\r
- *\r
- * PORT_Win32\r
- * "Accurate" timestamping based on the Windows performance counter. Note that\r
- * this gives the host machine time.\r
- *\r
- * Officially supported hardware timer ports:\r
- * - PORT_Atmel_AT91SAM7\r
- * - PORT_Atmel_UC3A0\r
- * - PORT_ARM_CortexM \r
- * - PORT_Renesas_RX600\r
- * - PORT_Microchip_dsPIC_AND_PIC24\r
- *\r
- * We also provide several "unofficial" hardware-specific ports. There have \r
- * been developed by external contributors, and have not yet been verified \r
- * by Percepio AB. Let us know if you have problems getting these to work.\r
- * \r
- * Unofficial hardware specific ports provided are:\r
- * - PORT_TEXAS_INSTRUMENTS_TMS570\r
- * - PORT_TEXAS_INSTRUMENTS_MSP430\r
- * - PORT_MICROCHIP_PIC32\r
- * - PORT_XILINX_PPC405\r
- * - PORT_XILINX_PPC440\r
- * - PORT_XILINX_MICROBLAZE\r
- * - PORT_NXP_LPC210X\r
- *\r
- *****************************************************************************/\r
-\r
-#define PORT_NOT_SET -1\r
-\r
-/*** Officially supported hardware timer ports *******************************/\r
-#define PORT_HWIndependent 0\r
-#define PORT_Win32 1\r
-#define PORT_Atmel_AT91SAM7 2\r
-#define PORT_Atmel_UC3A0 3\r
-#define PORT_ARM_CortexM 4\r
-#define PORT_Renesas_RX600 5\r
-#define PORT_Microchip_dsPIC_AND_PIC24 6\r
-\r
-/*** Unofficial ports, provided by external developers, not yet verified *****/\r
-#define PORT_TEXAS_INSTRUMENTS_TMS570 7\r
-#define PORT_TEXAS_INSTRUMENTS_MSP430 8\r
-#define PORT_MICROCHIP_PIC32 9\r
-#define PORT_XILINX_PPC405 10\r
-#define PORT_XILINX_PPC440 11\r
-#define PORT_XILINX_MICROBLAZE 12\r
-#define PORT_NXP_LPC210X 13\r
-\r
-/*** Select your port here! **************************************************/\r
-#define SELECTED_PORT PORT_Win32\r
-/*****************************************************************************/\r
-\r
-#if (SELECTED_PORT == PORT_NOT_SET) \r
-#error "You need to define SELECTED_PORT here!"\r
-#endif\r
-\r
-/*******************************************************************************\r
- * IRQ_PRIORITY_ORDER\r
- *\r
- * Macro which should be defined as an integer of 0 or 1.\r
- *\r
- * This should be 0 if lower IRQ priority values implies higher priority \r
- * levels, such as on ARM Cortex M. If the opposite scheme is used, i.e., \r
- * if higher IRQ priority values means higher priority, this should be 1.\r
- *\r
- * This setting is not critical. It is used only to sort and colorize the \r
- * interrupts in priority order, in case you record interrupts using\r
- * the vTraceStoreISRBegin and vTraceStoreISREnd routines.\r
- *\r
- * We provide this setting for some hardware architectures below:\r
- * - ARM Cortex M: 0 (lower IRQ priority values are more significant)\r
- * - Atmel AT91SAM7x: 1 (higher IRQ priority values are more significant)\r
- * - Atmel AVR32: 1 (higher IRQ priority values are more significant)\r
- * - Renesas RX600: 1 (higher IRQ priority values are more significant)\r
- * - Microchip PIC24: 0 (lower IRQ priority values are more significant)\r
- * - Microchip dsPIC: 0 (lower IRQ priority values are more significant)\r
- * - TI TMS570: 0 (lower IRQ priority values are more significant)\r
- * - Freescale HCS08: 0 (lower IRQ priority values are more significant)\r
- * - Freescale HCS12: 0 (lower IRQ priority values are more significant)\r
- * - PowerPC 405: 0 (lower IRQ priority values are more significant)\r
- * - PowerPC 440: 0 (lower IRQ priority values are more significant)\r
- * - Freescale ColdFire: 1 (higher IRQ priority values are more significant)\r
- * - NXP LPC210x: 0 (lower IRQ priority values are more significant)\r
- * - MicroBlaze: 0 (lower IRQ priority values are more significant)\r
- *\r
- * If your chip is not on the above list, and you perhaps know this detail by \r
- * heart, please inform us by e-mail to support@percepio.com.\r
- *\r
- ******************************************************************************\r
- *\r
- * HWTC Macros \r
- *\r
- * These four HWTC macros provides a hardware isolation layer representing a \r
- * generic hardware timer/counter used for driving the operating system tick, \r
- * such as the SysTick feature of ARM Cortex M3/M4, or the PIT of the Atmel \r
- * AT91SAM7X.\r
- *\r
- * HWTC_COUNT: The current value of the counter. This is expected to be reset \r
- * a each tick interrupt. Thus, when the tick handler starts, the counter has \r
- * already wrapped.\r
- *\r
- * HWTC_COUNT_DIRECTION: Should be one of:\r
- * - DIRECTION_INCREMENTING - for hardware timer/counters of incrementing type\r
- * such as the PIT on Atmel AT91SAM7X.\r
- * When the counter value reach HWTC_PERIOD, it is reset to zero and the\r
- * interrupt is signaled.\r
- * - DIRECTION_DECREMENTING - for hardware timer/counters of decrementing type\r
- * such as the SysTick on ARM Cortex M3/M4 chips.\r
- * When the counter value reach 0, it is reset to HWTC_PERIOD and the\r
- * interrupt is signaled.\r
- *\r
- * HWTC_PERIOD: The number of increments or decrements of HWTC_COUNT between\r
- * two tick interrupts. This should preferably be mapped to the reload\r
- * register of the hardware timer, to make it more portable between chips in the \r
- * same family. The macro should in most cases be (reload register + 1).\r
- *\r
- * HWTC_DIVISOR: If the timer frequency is very high, like on the Cortex M chips\r
- * (where the SysTick runs at the core clock frequency), the "differential \r
- * timestamping" used in the recorder will more frequently insert extra XTS \r
- * events to store the timestamps, which increases the event buffer usage. \r
- * In such cases, to reduce the number of XTS events and thereby get longer \r
- * traces, you use HWTC_DIVISOR to scale down the timestamps and frequency.\r
- * Assuming a OS tick rate of 1 KHz, it is suggested to keep the effective timer\r
- * frequency below 65 MHz to avoid an excessive amount of XTS events. Thus, a\r
- * Cortex M chip running at 72 MHZ should use a HWTC_DIVISOR of 2, while a \r
- * faster chip require a higher HWTC_DIVISOR value. \r
- *\r
- * The HWTC macros and vTracePortGetTimeStamp is the main porting issue\r
- * or the trace recorder library. Typically you should not need to change\r
- * the code of vTracePortGetTimeStamp if using the HWTC macros.\r
- *\r
- ******************************************************************************/\r
-\r
-#if (SELECTED_PORT == PORT_Win32)\r
- \r
- #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
- #define HWTC_COUNT (ulGetRunTimeCounterValue())\r
- #define HWTC_PERIOD 0\r
- #define HWTC_DIVISOR 1\r
- \r
- #define IRQ_PRIORITY_ORDER 1 // Please update according to your hardware...\r
-\r
-#elif (SELECTED_PORT == PORT_HWIndependent)\r
- \r
- #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
- #define HWTC_COUNT 0\r
- #define HWTC_PERIOD 1\r
- #define HWTC_DIVISOR 1\r
-\r
- #define IRQ_PRIORITY_ORDER 1 // Please update according to your hardware...\r
-\r
-#elif (SELECTED_PORT == PORT_Atmel_AT91SAM7)\r
-\r
- /* HWTC_PERIOD is hardcoded for AT91SAM7X256-EK Board (48 MHz)\r
- A more generic solution is to get the period from pxPIT->PITC_PIMR */\r
- \r
- #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
- #define HWTC_COUNT (AT91C_BASE_PITC->PITC_PIIR & 0xFFFFF)\r
- #define HWTC_PERIOD 2995 \r
- #define HWTC_DIVISOR 1\r
-\r
- #define IRQ_PRIORITY_ORDER 1 // higher IRQ priority values are more significant\r
-\r
-#elif (SELECTED_PORT == PORT_Atmel_UC3A0) \r
- \r
- /* For Atmel AVR32 (AT32UC3A) */\r
- \r
- #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
- #define HWTC_COUNT sysreg_read(AVR32_COUNT)\r
- #define HWTC_PERIOD ( TRACE_CPU_CLOCK_HZ / TRACE_TICK_RATE_HZ )\r
- #define HWTC_DIVISOR 1 \r
-\r
- #define IRQ_PRIORITY_ORDER 1 // higher IRQ priority values are more significant\r
-\r
-#elif (SELECTED_PORT == PORT_ARM_CortexM)\r
-\r
- /* For all chips using ARM Cortex M cores */\r
-\r
- #define HWTC_COUNT_DIRECTION DIRECTION_DECREMENTING\r
- #define HWTC_COUNT (*((uint32_t*)0xE000E018))\r
- #define HWTC_PERIOD ((*(uint32_t*)0xE000E014) + 1)\r
- #define HWTC_DIVISOR 2\r
- \r
- #define IRQ_PRIORITY_ORDER 0 // lower IRQ priority values are more significant\r
-\r
-#elif (SELECTED_PORT == PORT_Renesas_RX600) \r
-\r
- #include "iodefine.h"\r
-\r
- #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
- #define HWTC_COUNT (CMT0.CMCNT)\r
- #define HWTC_PERIOD ((((TRACE_PERIPHERAL_CLOCK_HZ/TRACE_TICK_RATE_HZ)-1)/8))\r
- #define HWTC_DIVISOR 1\r
-\r
- #define IRQ_PRIORITY_ORDER 1 // higher IRQ priority values are more significant\r
-\r
-#elif (SELECTED_PORT == PORT_Microchip_dsPIC_AND_PIC24) \r
-\r
- /* For Microchip PIC24 and dsPIC (16 bit) */\r
-\r
- /* Note: The trace library was originally designed for 32-bit MCUs, and is slower\r
- than intended on 16-bit MCUs. Storing an event on a PIC24 takes about 70 µs. \r
- In comparison, 32-bit MCUs are often 10-20 times faster. If recording overhead \r
- becomes a problem on PIC24, use the filters to exclude less interesting tasks \r
- or system calls. */\r
-\r
- #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
- #define HWTC_COUNT (TMR1)\r
- #define HWTC_PERIOD (PR1+1)\r
- #define HWTC_DIVISOR 1\r
-\r
- #define IRQ_PRIORITY_ORDER 0 // lower IRQ priority values are more significant\r
-\r
-#elif (SELECTED_PORT == PORT_NXP_LPC210X)\r
- /* UNOFFICIAL PORT - NOT YET VERIFIED BY PERCEPIO */\r
- \r
- /* Tested with LPC2106, but should work with most LPC21XX chips. */\r
- \r
- #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
- #define HWTC_COUNT *((uint32_t *)0xE0004008 )\r
- #define HWTC_PERIOD ( TRACE_CPU_CLOCK_HZ / TRACE_TICK_RATE_HZ ) \r
- #define HWTC_DIVISOR 1 \r
-\r
- #define IRQ_PRIORITY_ORDER 0 // lower IRQ priority values are more significant\r
-\r
-#elif (SELECTED_PORT == PORT_TEXAS_INSTRUMENTS_TMS570)\r
- /* UNOFFICIAL PORT - NOT YET VERIFIED BY PERCEPIO */\r
-\r
- #define RTIFRC0 *((uint32_t *)0xFFFFFC10)\r
- #define RTICOMP0 *((uint32_t *)0xFFFFFC50)\r
- #define RTIUDCP0 *((uint32_t *)0xFFFFFC54)\r
- #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
- #define HWTC_COUNT (RTIFRC0 - (RTICOMP0 - RTIUDCP0))\r
- #define HWTC_PERIOD (RTIUDCP0)\r
- #define HWTC_DIVISOR 1\r
-\r
- #define IRQ_PRIORITY_ORDER 0 // lower IRQ priority values are more significant\r
-\r
-#elif (SELECTED_PORT == PORT_TEXAS_INSTRUMENTS_MSP430)\r
- /* UNOFFICIAL PORT - NOT YET VERIFIED BY PERCEPIO */\r
-\r
- #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
- #define HWTC_COUNT (TA0R)\r
- #define HWTC_PERIOD TRACE_CPU_CLOCKS_PER_TICK \r
- #define HWTC_DIVISOR 1\r
-\r
- #define IRQ_PRIORITY_ORDER 1 // higher IRQ priority values are more significant\r
-\r
-#elif (SELECTED_PORT == PORT_MICROCHIP_PIC32)\r
- /* UNOFFICIAL PORT - NOT YET VERIFIED BY PERCEPIO */\r
-\r
- #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
- #define HWTC_COUNT (ReadTimer1()) /* Should be available in BSP */\r
- #define HWTC_PERIOD (ReadPeriod1()+1) /* Should be available in BSP */\r
- #define HWTC_DIVISOR 1\r
-\r
- #define IRQ_PRIORITY_ORDER 0 // lower IRQ priority values are more significant\r
-\r
-#elif (SELECTED_PORT == PORT_XILINX_PPC405) \r
- /* UNOFFICIAL PORT - NOT YET VERIFIED BY PERCEPIO */\r
-\r
- #define HWTC_COUNT_DIRECTION DIRECTION_DECREMENTING\r
- #define HWTC_COUNT mfspr( 0x3db)\r
- #define HWTC_PERIOD ( TRACE_CPU_CLOCK_HZ / TRACE_TICK_RATE_HZ )\r
- #define HWTC_DIVISOR 1\r
-\r
- #define IRQ_PRIORITY_ORDER 0 // lower IRQ priority values are more significant\r
-\r
-#elif (SELECTED_PORT == PORT_XILINX_PPC440) \r
- /* UNOFFICIAL PORT - NOT YET VERIFIED BY PERCEPIO */\r
-\r
- /* This should work with most PowerPC chips */\r
- \r
- #define HWTC_COUNT_DIRECTION DIRECTION_DECREMENTING\r
- #define HWTC_COUNT mfspr( 0x016 )\r
- #define HWTC_PERIOD ( TRACE_CPU_CLOCK_HZ / TRACE_TICK_RATE_HZ )\r
- #define HWTC_DIVISOR 1 \r
-\r
- #define IRQ_PRIORITY_ORDER 0 // lower IRQ priority values are more significant\r
- \r
-#elif (SELECTED_PORT == PORT_XILINX_MICROBLAZE)\r
- /* UNOFFICIAL PORT - NOT YET VERIFIED BY PERCEPIO */\r
-\r
- /* This should work with most Microblaze configurations.\r
- * It uses the AXI Timer 0 - the tick interrupt source.\r
- * If an AXI Timer 0 peripheral is available on your hardware platform, no modifications are required.\r
- */\r
- #include "xtmrctr_l.h"\r
-\r
- #define HWTC_COUNT_DIRECTION DIRECTION_DECREMENTING\r
- #define HWTC_COUNT XTmrCtr_GetTimerCounterReg( XPAR_TMRCTR_0_BASEADDR, 0 )\r
- #define HWTC_PERIOD ( TRACE_CPU_CLOCK_HZ / TRACE_TICK_RATE_HZ )\r
- #define HWTC_DIVISOR 16\r
-\r
- #define IRQ_PRIORITY_ORDER 0 // lower IRQ priority values are more significant\r
-\r
-#elif (SELECTED_PORT != PORT_NOT_SET)\r
-\r
- #error "SELECTED_PORT had unsupported value!"\r
- #define SELECTED_PORT PORT_NOT_SET\r
-\r
-#endif\r
-\r
-#if (SELECTED_PORT != PORT_NOT_SET)\r
- \r
- #ifndef HWTC_COUNT_DIRECTION\r
- #error "HWTC_COUNT_DIRECTION is not set!"\r
- #endif \r
- \r
- #ifndef HWTC_COUNT\r
- #error "HWTC_COUNT is not set!" \r
- #endif \r
- \r
- #ifndef HWTC_PERIOD\r
- #error "HWTC_PERIOD is not set!"\r
- #endif \r
- \r
- #ifndef HWTC_DIVISOR\r
- #error "HWTC_DIVISOR is not set!" \r
- #endif \r
- \r
- #ifndef IRQ_PRIORITY_ORDER\r
- #error "IRQ_PRIORITY_ORDER is not set!"\r
- #elif (IRQ_PRIORITY_ORDER != 0) && (IRQ_PRIORITY_ORDER != 1)\r
- #error "IRQ_PRIORITY_ORDER has bad value!"\r
- #endif \r
- \r
- #if (HWTC_DIVISOR < 1)\r
- #error "HWTC_DIVISOR must be a non-zero positive value!"\r
- #endif \r
-\r
-#endif\r
-/*******************************************************************************\r
- * vTraceConsoleMessage\r
- *\r
- * A wrapper for your system-specific console "printf" console output function.\r
- * This needs to be correctly defined to see status reports from the trace \r
- * status monitor task (this is defined in trcUser.c).\r
- ******************************************************************************/ \r
-#if (SELECTED_PORT == PORT_Atmel_AT91SAM7)\r
-/* Port specific includes */\r
-#include "console.h"\r
-#endif\r
-\r
-#define vTraceConsoleMessage(x)\r
-\r
-/*******************************************************************************\r
- * vTracePortGetTimeStamp\r
- *\r
- * Returns the current time based on the HWTC macros which provide a hardware\r
- * isolation layer towards the hardware timer/counter.\r
- *\r
- * The HWTC macros and vTracePortGetTimeStamp is the main porting issue\r
- * or the trace recorder library. Typically you should not need to change\r
- * the code of vTracePortGetTimeStamp if using the HWTC macros.\r
- *\r
- ******************************************************************************/\r
-void vTracePortGetTimeStamp(uint32_t *puiTimestamp);\r
-\r
-/*******************************************************************************\r
- * vTracePortEnd\r
- * \r
- * This function is called when the recorder is stopped due to full buffer.\r
- * Mainly intended to show a message in the console.\r
- * This is used by the Win32 port to store the trace to a file. The file path is\r
- * set using vTracePortSetFileName.\r
- ******************************************************************************/\r
-void vTracePortEnd(void);\r
-\r
-#if (INCLUDE_SAVE_TO_FILE == 1)\r
-\r
-/*******************************************************************************\r
- * vTracePortSetOutFile\r
- *\r
- * Sets the filename/path used in vTracePortSave.\r
- * This is set in a separate function, since the Win32 port calls vTracePortSave\r
- * in vTracePortEnd if WIN32_PORT_SAVE_WHEN_STOPPED is set.\r
- ******************************************************************************/\r
-void vTracePortSetOutFile(char* path);\r
-\r
-/******************************************************************************\r
- * vTracePortSave\r
- *\r
- * Saves the trace to a file on a target-side file system. The path is set in a \r
- * separate function, vTracePortSetOutFile, since the Win32 port may call\r
- * vTracePortSave in vTracePortEnd, if using WIN32_PORT_SAVE_WHEN_STOPPED.\r
- ******************************************************************************/\r
-void vTracePortSave(void);\r
-\r
-#else\r
-\r
-#define vTraceConsoleMessage(x)\r
-#define vTracePortSetOutFile(path)\r
-#define vTracePortSave(void)\r
-\r
-#endif\r
-\r
-#endif\r
function, because it is the responsibility of the idle task to clean up\r
memory allocated by the kernel to any task that has since been deleted. */\r
\r
- /* The trace can be stopped with any key press. */\r
- if( _kbhit() != pdFALSE )\r
- {\r
- if( xTraceRunning == pdTRUE )\r
+ /* Uncomment the following code to allow the trace to be stopped with any \r
+ key press. The code is commented out by default as the kbhit() function\r
+ interferes with the run time behaviour. */\r
+ /* \r
+ if( _kbhit() != pdFALSE )\r
{\r
- vTraceStop();\r
- prvSaveTraceFile();\r
- xTraceRunning = pdFALSE;\r
+ if( xTraceRunning == pdTRUE )\r
+ {\r
+ vTraceStop();\r
+ prvSaveTraceFile();\r
+ xTraceRunning = pdFALSE;\r
+ }\r
}\r
- }\r
+ */\r
\r
#if ( mainCREATE_SIMPLE_BLINKY_DEMO_ONLY != 1 )\r
{\r
* application. It is provided as a convenient development and demonstration\r
* test bed only. This was tested using Windows XP on a dual core laptop.\r
*\r
- * Windows will not be running the FreeRTOS simulator threads continuously, so \r
- * the timing information in the FreeRTOS+Trace logs have no meaningful units. \r
- * See the documentation page for the Windows simulator for an explanation of \r
+ * Windows will not be running the FreeRTOS simulator threads continuously, so\r
+ * the timing information in the FreeRTOS+Trace logs have no meaningful units.\r
+ * See the documentation page for the Windows simulator for an explanation of\r
* the slow timing:\r
* http://www.freertos.org/FreeRTOS-Windows-Simulator-Emulator-for-Visual-Studio-and-Eclipse-MingW.html\r
* - READ THE WEB DOCUMENTATION FOR THIS PORT FOR MORE INFORMATION ON USING IT -\r
*\r
* NOTE 2: This project provides two demo applications. A simple blinky style\r
* project, and a more comprehensive test and demo application. The\r
- * mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting in main.c is used to select \r
- * between the two. See the notes on using mainCREATE_SIMPLE_BLINKY_DEMO_ONLY \r
+ * mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting in main.c is used to select\r
+ * between the two. See the notes on using mainCREATE_SIMPLE_BLINKY_DEMO_ONLY\r
* in main.c. This file implements the simply blinky style version.\r
*\r
* NOTE 3: This file only contains the source code that is specific to the\r
- * basic demo. Generic functions, such FreeRTOS hook functions, are defined \r
+ * basic demo. Generic functions, such FreeRTOS hook functions, are defined\r
* in main.c.\r
******************************************************************************\r
*\r
* The queue send task is implemented by the prvQueueSendTask() function in\r
* this file. prvQueueSendTask() sits in a loop that causes it to repeatedly\r
* block for 200 (simulated as far as the scheduler is concerned, but in\r
- * reality much longer - see notes above) milliseconds, before sending the \r
- * value 100 to the queue that was created within main_blinky(). Once the \r
- * value is sent, the task loops back around to block for another 200 \r
+ * reality much longer - see notes above) milliseconds, before sending the\r
+ * value 100 to the queue that was created within main_blinky(). Once the\r
+ * value is sent, the task loops back around to block for another 200\r
* (simulated) milliseconds.\r
*\r
* The Queue Receive Task:\r
* in this file. prvQueueReceiveTask() sits in a loop where it repeatedly\r
* blocks on attempts to read data from the queue that was created within\r
* main_blinky(). When data is received, the task checks the value of the\r
- * data, and if the value equals the expected 100, outputs a message. The \r
- * 'block time' parameter passed to the queue receive function specifies that \r
- * the task should be held in the Blocked state indefinitely to wait for data \r
+ * data, and if the value equals the expected 100, outputs a message. The\r
+ * 'block time' parameter passed to the queue receive function specifies that\r
+ * the task should be held in the Blocked state indefinitely to wait for data\r
* to be available on the queue. The queue receive task will only leave the\r
* Blocked state when the queue send task writes to the queue. As the queue\r
- * send task writes to the queue every 200 (simulated - see notes above) \r
- * milliseconds, the queue receive task leaves the Blocked state every 200 \r
+ * send task writes to the queue every 200 (simulated - see notes above)\r
+ * milliseconds, the queue receive task leaves the Blocked state every 200\r
* milliseconds, and therefore outputs a message every 200 milliseconds.\r
*/\r
\r
portTickType xNextWakeTime;\r
const unsigned long ulValueToSend = 100UL;\r
\r
- /* Remove compiler warning in the case that configASSERT() is not \r
+ /* Remove compiler warning in the case that configASSERT() is not\r
defined. */\r
( void ) pvParameters;\r
\r
{\r
unsigned long ulReceivedValue;\r
\r
- /* Remove compiler warning in the case that configASSERT() is not \r
+ /* Remove compiler warning in the case that configASSERT() is not\r
defined. */\r
( void ) pvParameters;\r
\r
/*\r
- FreeRTOS V8.0.0:rc1 - Copyright (C) 2014 Real Time Engineers Ltd. \r
+ FreeRTOS V8.0.0:rc1 - Copyright (C) 2014 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
* application. It is provided as a convenient development and demonstration\r
* test bed only. This was tested using Windows XP on a dual core laptop.\r
*\r
- * Windows will not be running the FreeRTOS simulator threads continuously, so \r
- * the timing information in the FreeRTOS+Trace logs have no meaningful units. \r
- * See the documentation page for the Windows simulator for an explanation of \r
+ * Windows will not be running the FreeRTOS simulator threads continuously, so\r
+ * the timing information in the FreeRTOS+Trace logs have no meaningful units.\r
+ * See the documentation page for the Windows simulator for an explanation of\r
* the slow timing:\r
* http://www.freertos.org/FreeRTOS-Windows-Simulator-Emulator-for-Visual-Studio-and-Eclipse-MingW.html\r
* - READ THE WEB DOCUMENTATION FOR THIS PORT FOR MORE INFORMATION ON USING IT -\r
*\r
* NOTE 2: This project provides two demo applications. A simple blinky style\r
* project, and a more comprehensive test and demo application. The\r
- * mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting in main.c is used to select \r
- * between the two. See the notes on using mainCREATE_SIMPLE_BLINKY_DEMO_ONLY \r
+ * mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting in main.c is used to select\r
+ * between the two. See the notes on using mainCREATE_SIMPLE_BLINKY_DEMO_ONLY\r
* in main.c. This file implements the comprehensive test and demo version.\r
*\r
* NOTE 3: This file only contains the source code that is specific to the\r
- * basic demo. Generic functions, such FreeRTOS hook functions, are defined in \r
+ * basic demo. Generic functions, such FreeRTOS hook functions, are defined in\r
* main.c.\r
*******************************************************************************\r
*\r
- * main() creates all the demo application tasks, then starts the scheduler. \r
- * The web documentation provides more details of the standard demo application \r
- * tasks, which provide no particular functionality but do provide a good \r
+ * main() creates all the demo application tasks, then starts the scheduler.\r
+ * The web documentation provides more details of the standard demo application\r
+ * tasks, which provide no particular functionality but do provide a good\r
* example of how to use the FreeRTOS API.\r
*\r
* In addition to the standard demo tasks, the following tasks and tests are\r
#define mainBLOCK_Q_PRIORITY ( tskIDLE_PRIORITY + 2 )\r
#define mainCREATOR_TASK_PRIORITY ( tskIDLE_PRIORITY + 3 )\r
#define mainFLASH_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 )\r
-#define mainuIP_TASK_PRIORITY ( tskIDLE_PRIORITY + 2 )\r
#define mainINTEGER_TASK_PRIORITY ( tskIDLE_PRIORITY )\r
#define mainGEN_QUEUE_TASK_PRIORITY ( tskIDLE_PRIORITY )\r
#define mainFLOP_TASK_PRIORITY ( tskIDLE_PRIORITY )\r
/* Task function prototypes. */\r
static void prvCheckTask( void *pvParameters );\r
\r
-/* A task that is created from the idle task to test the functionality of \r
+/* A task that is created from the idle task to test the functionality of\r
eTaskStateGet(). */\r
static void prvTestTask( void *pvParameters );\r
\r
*/\r
static void prvDemonstrateTaskStateAndHandleGetFunctions( void );\r
\r
+/*\r
+ * Called from the idle task hook function to demonstrate the use of \r
+ * xTimerPendFunctionCall() as xTimerPendFunctionCall() is not demonstrated by\r
+ * any of the standard demo tasks.\r
+ */\r
+static void prvDemonstratePendingFunctionCall( void );\r
+\r
+/*\r
+ * The function that is pended by prvDemonstratePendingFunctionCall().\r
+ */\r
+static void prvPendedFunction( void *pvParameter1, uint32_t ulParameter2 );\r
+\r
/*\r
* A task to demonstrate the use of the xQueueSpacesAvailable() function.\r
*/\r
/* Start the scheduler itself. */\r
vTaskStartScheduler();\r
\r
- /* Should never get here unless there was not enough heap space to create \r
+ /* Should never get here unless there was not enough heap space to create\r
the idle and other system tasks. */\r
return 0;\r
}\r
else if( xAreIntegerMathsTaskStillRunning() != pdTRUE )\r
{\r
pcStatusMessage = "Error: IntMath";\r
- } \r
+ }\r
else if( xAreGenericQueueTasksStillRunning() != pdTRUE )\r
- { \r
+ {\r
pcStatusMessage = "Error: GenQueue";\r
}\r
else if( xAreQueuePeekTasksStillRunning() != pdTRUE )\r
pcStatusMessage = "Error: Queue overwrite";\r
}\r
\r
- /* This is the only task that uses stdout so its ok to call printf() \r
+ /* This is the only task that uses stdout so its ok to call printf()\r
directly. */\r
printf( ( char * ) "%s - %u\r\n", pcStatusMessage, ( unsigned int ) xTaskGetTickCount() );\r
fflush( stdout );\r
direct use from application code, hence their prototypes are not in queue.h. */\r
extern void vQueueSetQueueNumber( xQueueHandle pxQueue, unsigned portBASE_TYPE uxQueueNumber );\r
extern unsigned portBASE_TYPE uxQueueGetQueueNumber( xQueueHandle pxQueue );\r
-extern unsigned char ucQueueGetQueueType( xQueueHandle pxQueue );\r
+extern uint8_t ucQueueGetQueueType( xQueueHandle pxQueue );\r
extern void vTaskSetTaskNumber( xTaskHandle xTask, unsigned portBASE_TYPE uxHandle );\r
extern unsigned portBASE_TYPE uxTaskGetTaskNumber( xTaskHandle xTask );\r
\r
the standard demo tasks. */\r
prvDemonstrateTaskStateAndHandleGetFunctions();\r
\r
+ /* Demonstrate the use of xTimerPendFunctionCall(), which is not\r
+ demonstrated by any of the standard demo tasks. */\r
+ prvDemonstratePendingFunctionCall();\r
+\r
/* If xMutexToDelete has not already been deleted, then delete it now.\r
- This is done purely to demonstrate the use of, and test, the \r
+ This is done purely to demonstrate the use of, and test, the\r
vSemaphoreDelete() macro. Care must be taken not to delete a semaphore\r
that has tasks blocked on it. */\r
if( xMutexToDelete != NULL )\r
xMutexToDelete = NULL;\r
}\r
\r
- /* Exercise heap_4 a bit. The malloc failed hook will trap failed \r
+ /* Exercise heap_4 a bit. The malloc failed hook will trap failed\r
allocations so there is no need to test here. */\r
pvAllocated = pvPortMalloc( ( rand() % 100 ) + 1 );\r
vPortFree( pvAllocated );\r
/* Call the periodic queue overwrite from ISR demo. */\r
vQueueOverwritePeriodicISRDemo();\r
\r
- /* Write to a queue that is in use as part of the queue set demo to \r
+ /* Write to a queue that is in use as part of the queue set demo to\r
demonstrate using queue sets from an ISR. */\r
vQueueSetAccessQueueSetFromISR();\r
+\r
+ /* Exercise event groups from interrupts. */\r
+ vPeriodicEventGroupsProcessing();\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvPendedFunction( void *pvParameter1, uint32_t ulParameter2 )\r
+{\r
+static uint32_t ulLastParameter1 = 1000UL, ulLastParameter2 = 0UL;\r
+uint32_t ulParameter1;\r
+\r
+ ulParameter1 = ( uint32_t ) pvParameter1;\r
+\r
+ /* Ensure the parameters are as expected. */\r
+ configASSERT( ulParameter1 == ( ulLastParameter1 + 1 ) );\r
+ configASSERT( ulParameter2 == ( ulLastParameter2 + 1 ) );\r
+\r
+ /* Remember the parameters for the next time the function is called. */\r
+ ulLastParameter1 = ulParameter1;\r
+ ulLastParameter2 = ulParameter2;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvDemonstratePendingFunctionCall( void )\r
+{\r
+static uint32_t ulParameter1 = 1000UL, ulParameter2 = 0UL;\r
+const TickType_t xDontBlock = 0; /* This is called from the idle task so must *not* attempt to block. */\r
+\r
+ /* prvPendedFunction() just expects the parameters to be incremented by one\r
+ each time it is called. */\r
+ ulParameter1++;\r
+ ulParameter2++;\r
+\r
+ /* Pend the function call, sending the parameters. */\r
+ xTimerPendFunctionCall( prvPendedFunction, ( void * ) ulParameter1, ulParameter2, xDontBlock );\r
}\r
/*-----------------------------------------------------------*/\r
\r
static portBASE_TYPE xPerformedOneShotTests = pdFALSE;\r
xTaskHandle xTestTask;\r
\r
- /* Demonstrate the use of the xTimerGetTimerDaemonTaskHandle() and \r
+ /* Demonstrate the use of the xTimerGetTimerDaemonTaskHandle() and\r
xTaskGetIdleTaskHandle() functions. Also try using the function that sets\r
the task number. */\r
xIdleTaskHandle = xTaskGetIdleTaskHandle();\r
vTaskSetTaskNumber( xIdleTaskHandle, ( unsigned long ) ucConstTaskNumber );\r
configASSERT( uxTaskGetTaskNumber( xIdleTaskHandle ) == ucConstTaskNumber );\r
\r
- /* This is the idle hook, so the current task handle should equal the \r
+ /* This is the idle hook, so the current task handle should equal the\r
returned idle task handle. */\r
if( xTaskGetCurrentTaskHandle() != xIdleTaskHandle )\r
{\r
\r
/* Check the timer task handle was returned correctly. */\r
pcTaskName = pcTaskGetTaskName( xTimerTaskHandle );\r
- if( strcmp( ( char * ) pcTaskName, "Tmr Svc" ) != 0 )\r
+ if( strcmp( pcTaskName, "Tmr Svc" ) != 0 )\r
{\r
pcStatusMessage = "Error: Returned timer task handle was incorrect";\r
}\r
{\r
/* Ask how many messages are available... */\r
uxReturn = uxQueueMessagesWaiting( xQueue );\r
- \r
+\r
/* Check the number of messages being reported as being available\r
is as expected, and force an assert if not. */\r
if( uxReturn != x )\r
\r
/* Ask how many spaces remain in the queue... */\r
uxReturn = uxQueueSpacesAvailable( xQueue );\r
- \r
+\r
/* Check the number of spaces being reported as being available\r
is as expected, and force an assert if not. */\r
if( uxReturn != ( uxQueueLength - x ) )\r
}\r
\r
uxReturn = uxQueueSpacesAvailable( xQueue );\r
- \r
+\r
if( uxReturn != 0 )\r
{\r
configASSERT( xQueue == NULL );\r