• freertos manual

    freertos manual

    Download Link: ➡ freertos manual



    File Name: freertos manual.pdf
    Size: 3801 KB
    Type: PDF, ePub, eBook
    Category: Book
    Uploaded: 10 May 2019, 17:39 PM
    Rating: 4.6/5 from 667 votes.


    Last checked: 17 Minutes ago!









    ⬆ LINK ⬆




















    In order to read or download freertos manual ebook, you need to create a FREE account.

    eBook includes PDF, ePub and Kindle version



    ✔ Register a free 1 month Trial Account.
    ✔ Download as many books as you like (Personal use)
    ✔ Cancel the membership at any time if not satisfied.
    ✔ Join Over 80000 Happy Readers


    Book Descriptions:

    freertos manual

    With Tracealyzer you see what is really going on in your system!This way, you can visualize specific aspects of importance for your system and the problem at hand.Tracealyzer v4.2.0 officially supports Microsoft Windows and Linux hosts. In the latter case, please refer to the Running on Linux section below.Tracealyzer supports several third-party solutions provided by RTOS vendors, and Percepio also provides the Percepio Trace Recorder library that supports several RTOSes and soon also bare-metal setups. Read more under the Creating and Loading Traces section.For detailed information, see RunningOnLinux.txt in the Tracealyzer application directory.There are several ways of accessing and arranging these views.Move the mouse cursor to the desired docking target and release the mouse button.You may store and restore the layout using the options in the Layout menu:Remember Layout - Enable this option to let Tracealyzer remember the previously used layout and restoring it when starting Tracealyzer. Layout Locked - If this option is enabled, the views can't be rearranged. Can be useful to prevent accidental changes once you are happy with your layout. Save New Layout - Sets a name for the current layout, so it can be restored later. This allows for having multiple layouts for different kinds of analysis. Manage Layout - Allows for renaming or removing a saved layout. Layouts - Allows for restoring a previously saved layout. Tool Windows Native Ticks - The timestamp from the trace format in its native frequency. Event Index - This uses the order of events in Tracealyzer event list instead of time. Wall Time - The full date and time, formatted using.NETs DateTime and TimeSpan objects. This mode is only available when there is some form of time reference. Time Offset Mode This is usually relative to system startup or the point where tracing was enabled.

    • freertos manual, freertos manual pdf download, freertos manual download, freertos manual book, freertos, freertos reference manual, freertos user manual, freertos reference manual v10, freertos user manual pdf, stm32 freertos manual, freertos manual, freertos manual, freertos manual, freertos manual pdf, lwip manual freertos, freertos reference manual pdf, freertos user manual.

    The RTOS kernel can be used for creating applications that perform multiple tasks simultaneously. These tasks are executed by threads that operate in a quasi-parallel fashion. For example, an RTOS enables flexible scheduling of system resources like CPU and memory, and offers methods to communicate between threads. For the latest version please see the Mbed OS documentation. Last commit 04 Jul 2017 by mbed official The function main is a special thread function that is started at system initialization and has the initial priority osPriorityNormal. Only one thread at a time can be in this state.Once the RUNNING thread has terminated or is WAITING the next READY thread with the highest priority becomes the RUNNING thread.These threads typically consume no system resources.During this time, the RTOS scheduler will run other threads in the READY state. This is for example used to protect access to a shared resource, for example a shared memory image. On the contrary, ARM microlib (used on the M0 mbed) does not provide default stdio mutexes making the above example a necessity. For example, with a Semaphore the access to a group of identical peripherals can be managed. The number of available resources is specified as parameter of the osSemaphoreCreate function. Each thread has assigned signal flags. A message can be a integer or pointer value that is send to a thread or interrupt service routine. A mail is a memory block that is send to a thread or interrupt service routine. A timer function is called when a time period expires whereby both on-shot and periodic timers are possible. A timer can be started, restarted, or stopped. Callback functions run under control of this thread and may use CMSIS-RTOS API calls. The only two warnings are: This data structure contains both an error code and a pointer to the actual data. More than 30 views offers amazing insight into the real-time behavior, speeding up debugging, validation and performance optimization.

    This setting is saved and reused in between Tracealyzer sessions.Look for a ST-LINK or SEGGER J-Link label next to a USB connection on your board.The plugin supports any debug probe that is supported by your Eclipse IDE.Note that the plugin does not include Tracealyzer itself, it is a separate download and runs as a standalone application.Just follow the below steps (but don't type in the quotation marks). Open the XSCT Console, found in the Xilinx menu.A larger range is fine, as long as the trace data is fully included. Open the resulting file (trace.bin) in Tracealyzer. The plugin can be downloaded here and supports any debug probe that is supported by MPLAB. To learn more about this plugin, read this blog post.Follow these steps:The trace is now saved every time that breakpoint is hit. That is a special hook that is called every time the execution is halted. Note that this can slow down single-stepping if the buffer is large.This shows you the memory contents. Hex mode seems to be default.Streaming trace using STM32 ST-LINK Streaming is not yet directly supported on ST-LINK, but it is quite easy to reprogram an onboard ST-LINK debug interfaces, found on many ST development boards, with J-Link firmware. This effectively transforms the ST-LINK interface into a J-Link interface.See this blog post for instructions. Note: This does not work for stand-alone ST-LINK units. Open the resulting file in Tracealyzer.TracealyzerIntel Hex (.hex), supporting IAR Embedded Workbench and Atmel MemoryLogger. MCH (.mch), supporting Microchip MPLAB 8. The recorder data is stored in a single dataThis setting is saved and reused in between Tracealyzer settings.This way, you can record as long as you have disk space on your PC.This assumes the following:This excludes the Idle task, so 100% load means that the Idle task is not executing at all.To trace ISRs, you need to call vTraceStoreISRBegin() and vTraceStoreISREnd() in your ISRs. See Recorder API for further details.

    Relative to user defined point - If you right-click a point in any view that has a timeline, you can specify that time as relative time 0. Creating and Loading Traces Introduction The recorder library are called by the RTOS kernel in order to store important events, such as context-switches and RTOS API calls. These calls are made using code instrumentation, already available in supported RTOSes.You may also need to configure the recorder library to match your processor and target connection.Note that Tracealyzer supports several leading RTOSes, but the User Manual only includes those covered by your current license.The settings can also be accessed from the File menu.If using an RTOS suppoted by Percepio's own recorder, the Recording Settings looks like this:Eventually the RAM will fill up, causing reduced performance due to page swapping.This way, you can record traces of unlimited duration, as long as you have disk space.Thereby, all Tracealyzer features are now enabled.The recorder integrates with the FreeRTOS kernel and records a trace of RTOS events and your own User Events.Tracealyzer can open RAM dump files created by any means, as long as the trace data structure ( RecorderDataPtr ) is fully included.This is suitable for capturing the events before a point in the code, where the recorder is stopped or the system is simply halted.So before saving the snapshot, you need to either stop the recorder ( vTraceStop() ) or halt the system, e.g., using a breakpoint.The settings are found in the header file trcSnapshotConfig.h, together with detailed documentation.User events, which are generated by the application, can however be stored in a separate User Event Buffer ( UB ). This allows for a longer history of less frequent but important user events, since they are not overwritten by kernel events.The J-Link integration also supports streaming. The ST-LINK support is currently limited to snapshot mode.The trace is then opened in Tracealyzer within a few seconds.

    However, the J-Link probes use JTAG by default and will revert to JTAG if power-cycled.It is sufficient that the debug session has been launched and that the target is halted in main.You will now capture every event after vTraceEnable.Normally this works automatically, but in some cases it is necessary to configure this manually.This is not a mistake. Each development tool using the J-Link drivers spawns a separate driver instance, with a separate Control Panel.This is normal and supported by SEGGER.The J-Link driver should find it directly after vTraceEnable has been called, and then start receiving data.Moreover, it seems the SEGGER J-Link driver only allows for specifying the RTT address in the primary driver instance, i.e. the first one started.So, if you have started a debug session in your IDE before connecting with Tracealyzer, it seems as the secondary J-Link driver just ignores the RTT address specified by Tracealyzer.ITM provides hardware buffering, allowing for high data rates.The worst case blocking time corresponds to the time needed to transmit the full 10 bytes ITM buffer over SWO.If you are using a different MCU, you need to modify the stream port accordingly.The performance of USB (even USB 2.0) is many times more than required for RTOS trace streaming.This may not be necessary, depending on the internal buffers in the USB stack.They allow for streaming over a classic UART-based serial connection. This however requires a fast UART and an appropriate stream port.The main file is trcStreamingPort.h.Should return 0 on success. If streaming e.g. to a device file system (without a PC connection to Tracealyzer) this should be defined as 0. Should return 0 on success.The data is not sent until a page becomes full. You may want to tweak the settings for trace control task (periodicity and priority) and also the buffer layout (bytes per page and number of pages). These settings are found in trcStreamingConfig.h.The latter is for Windows only.

    If the trace has not been saved, you'll be prompted to do so.The stream ports may also contain some.c files, that also needs to be included in the build.This is the default setup. This requires a fast interface where the data transfer doesn't generate any new trace events (e.g., by RTOS calls) as this would cause infinite recursion.Check the provided stream ports and this blog post for a quick introduction.Should return 0 on success. If streaming e.g. to a device file system (without a PC connection to Tracealyzer) this should be defined as 0. Should return 0 on success.It also works on many ARM Cortex-R and ARM Cortex-A processors, see this application note from SEGGER.It relies on RAM buffers in the target system, which the J-Link reads in the background without disturbing the execution.Default 5000 bytes. Default 32 bytes.If this should occur, the number of dropped events is displayed in Tracealyzer while receiving the trace. Moreover, Tracealyzer also highlights the intervals with incomplete data using a light red background color.Default is 4 MHz, but can be increased a lot depending on your J-Link model.And if you set the J-Link Speed higher than the maximum supported speed, the J-Link driver will instead use the highest speed supported.Also make sure the firmware of your J-Link debug probe is updated correctly, if the J-Link drivers would propose this.This is the default setting of J-Link debug probes.This is necessary in order for SEGGER RTT to connect automatically.Default is 1 and must match the setting in trcStreamingPort.h. Default is 1 and must match the setting in trcStreamingPort.h.This way, Tracealyzer won't send a start command when the recording session begins, just wait for the data.In that case, double-check the below steps. They are frequently updated, especially for new devices. Therefore, make sure to install the latest J-Link drivers as the last step, after Tracealyzer has been installed. We strongly recommend allowing that.

    It is very fast since the actual string formatting is done on the host side, when theThe yellow User EventUser Event Channels are createdFor example, assuming -42 as data argument, two examples are:In streaming this isIf exceeded, the recorderThis can be used to integrate with existing logging solutions. See vTracePrintF documentation for further details.Parameter object: pointer to the kernel object that shall be named (e.g., a queue). Parameter name: the name to display in Tracealyzer.Returns a traceHandle used by vTraceStoreISRBegin.This informs the viewer to split the current fragment at this point and beginIf the kernel call is not blocking, the viewer instead splits the currentIf you combine this with linker directives, you can place the recorder data in a specific memory location.Moreover, it is ignored if you don't use custom allocation mode.The return value is NULL if no errors have been registered.In streaming mode, this however requires User Events to be enabled (see trcConfig.h ).Then check the call stack in your debugger to see what recorder operation that resulted in the error.Allows for overriding the defaultFilterGroup15 ).By default, all kernel object are assigned to FilterGroup0, but this can be changed using vTraceSetFilterGroup.This can be used to reduce the trace data rate, i.e., if your streaming interface isAnd by grouping related objects into filter groups, you can exclude whole subsystems from the trace simply by changing the filter mask. The parameter filterGroup should be one of the 16 predefined filter groups IDs, named FilterGroup0. FilterGroup15, corresponding to each bit in the filter mask.To avoid filtering out the Idle task by accident,See also uiTraceGetTraceBufferSize.See also xTraceGetTraceBuffer.The recorder will not be started if an error has beenReturns 0 if the recorder start was prevented due to a previous internal error. In that case, check xTraceGetLastError to get the error message.

    Any error message is also presented when opening a trace file.The recorder will not be started if an error has beenThis is not needed in the normal initialization, only if you want a clean restart of the tracing while the system is running.This is the only hardware dependency of the recorder library.Fortunately, developing a hardware timer port yourself is quite easy.You typically use the same interrupt timer that drives the kernel tick.This since the standard critical sectionsThe unused stack space is reported in words, i.e. just like the stack size parameter for xTaskCreate.Due to the potentially long runtimes, you should ensure that TzCtrl runs on lower priority than any time-critical tasks in your system. The diagram in the middle shows the CPU load of the target system, i.e., the percentage of processor time spent in application tasks (i.e. not idle) in relation to the total processing time.If you encounter that, please refer to the Troubleshooting section corresponding to your RTOS.This can remain active also when recording very long traces, as its memory usage is constant and independent of the recording length.This will highlight the point in the graphs and select a section centered on this point. Since loading a very long trace can easily eat up all available memory, you should make sure to not load too long sections. The memory estimate shows the estimated memory usage of loading the current selection, helping you avoid running out of RAM. The gray part (on the left) shows the amount of memory used by your operating system and other applications. The blue part (in the middle) shows how much memory Tracealyzer is currently using. The right-most part is green if the current selection is estimated to fit in memory, yellow if the selection is estimated to be a close fit, or red if estimated to be too large to load. Note A yellow or red area does not necessarily mean that the trace can't be loaded.

    Some code is specific for the snapshot or streaming modes, but we recommend including all these source files in your build.Check the Recorder Integration section for a step-by-step guide of how to integrate the recorder in your system.Needs to be included from FreeRTOSConfig.h, as described in the integration guide.Contains several predefined hardware ports, including ARM Cortex-M, PIC32, Renesas RX etc.See trcStreamingPort.h for relevant settings.Defined by trcStreamingPort.h.The example provided is for STM32, with USB drivers generated by STM32Cube. Defined by trcStreamingPort.h.To use streaming mode, some additional steps are needed.On Windows, this is found in \Percepio\Tracealyzer 4\FreeRTOS\TraceRecorder.The files are stripped of any unused code by the preprocessor, based on the recorder configuration.If you set this to 0, the trace recorder is completely disabled and excluded from the build.The main settings are found in trcConfig.h. May fail if there is not enough heap space. If combined with linker directives, you can place the recorder data in a fixed memory location of your choice.Some stream ports also rely on this task to transmit the data from the internal buffer to the stream interface (most except for the J-Link port).This may need to be increased if there are missed events. (Not used by the J-Link stream port, see below). This can be tunedThis is by default 4000 bytes. The usage of this buffer can be reduced in several ways described in the Recorder API e.g. by excluding certain objects or by only including task-switches. This controls the size of the symbol table, allowing efficient storage of names, format strings, etc.It is therefore advised to start with relatively large values.Tracealyzer can however report the resource usage from a trace session, allowing you to tune these settings and thereby optimize the RAM usage.

    They call prvTraceError or prvTraceWarning if an internal error isThis attempts to save the error message in the trace and then stops the recorder.This returns NULL if no error messages are available.If your application was close to a stack overflow before, this might push it over the edge.Note that some RTOSes include stack overflow detection, although not always 100% reliable.See the Troubleshooting J-Link RTT streaming section above.Put a breakpoint in prvSetRecorderEnabled() in trcStreamingRecorder.c and check if it's reached.Put a breakpoint in the start of this task to verify this. Note that TzCtrl normally is started automatically from vTraceEnable.If not, there may be lost events or blocking in the recorder, depending on your recorder settings. If blocking mode is used, this may affect the timing of your system, but ensures that data is not lost.If using J-Link streaming, you find the buffer size setting in trcStreamingPort.h, otherwise in trcStreamingConfig.h.Especially if you don't have enough RAM for a larger buffer.When the scheduler is started the first task switch never calls upon the proper trace macro. This is fixed as of FreeRTOS v10.1.0. If an upgrade isn't possible for you, you can easily patch the kernel yourself. It is a very minor fix in vTaskStartScheduler() in tasks.c:The API is found in trcRecorder.h.Then select Start Recording in Tracealyzer so it begins waiting for data, and finally resume the target system execution.Intentionally blocking! Thus, this option requires that the stream port has two-way communication and that the stream port is fully operational before the RTOS kernel has started.To see the context of the error,Note that prvTraceError has two alternative implementations, one for snapshot mode and another for streaming.Mainly intended for snapshot mode or if streaming to device storage or a USB drive, without host control.

    This is just an estimate, and if there is enough virtual memory available the trace will load anyway, but the performance of your computer is likely to be affected. User Events Introduction This by defining a Custom Interval based on the user events.The X axis indicates the start time of the interval, and the Y axis shows the duration.Clicking a plotted instance will show and highlight it in the trace view. You can filter actors by clicking on an actor in the legend to the right.For each time interval, a bar is drawn for each actor beginning or resuming execution at least once in that interval.This includes minimum, average and maximum values for properties like task executions times and response times.The report can be generated for a selected interval, or for the whole trace.This option is also available when right-clicking on a selected interval in other views.If there are Actors not included in the trace (ISRs without trace calls, or excluded tasks), the reported Execution Time may include the time spent in such Actors.A separation of 0 means that the Instances follow in direct sequence.This value indicates the number of interruptions, e.g., ISRs, preemptions by higher priority tasks, blocking on mutexes etc.The report has three sections, an introduction, a table with descriptive statistics (min, average, max values).When clicked, the Finder dialog is opened with the filter set to find matching Instances.It will show the current stack trace state at any given time.This can be changed in the View menu.For example, you might use the CPU Load Graph view to identify a peak where there is a lot of activity, then selectEllipses are used for directional communication and synchronization objects, while hexagons are used for bi-directional objects like Mutexes and similar.Actors Only: In this mode, only those actors are shown which have communication dependencies to other tasks. Dependencies on bi-directional objects (e.g. Mutexes) are not shown.

    This shows only actors and objects that affect or are affected by the selected actor or object via directed communication (undirected communication such as through mutexes are not followed even though the objects will be displayed). The difference is that the former does not hide communication between those nodes even if it's unrelated to the selected node. For example, if you have the communication chainsFor each time interval, a bar is drawn for each actor beginning or resuming execution at least once in that interval.By default, it shows all actors except the idle task. The analysis works by dividing the trace into a number of intervals, the default is 100 intervals.For each interval, all actors executing in that interval will be drawn as rectangles stacked on top of each other.There you can select which actors you wish to include in the view. If you wish a more detailed graph, you can increase the number of intervals by selecting a higher resolution.You can also use the Zoom or right click menu to show the selection or current view in the trace view or in all open views.A gray outlined rectangle shows the interval of the current trace view. This rectangle may be very narrow and appear as a line if the trace view is small. Event Intensity The number of slices can be changed via the Resolution or Time Resolution menus.The view also supports exporting the trace as text file.Type any text and click Apply, and only entries containing that text will be displayed. To revert to displaying all entries, delete the search string and click Apply again.Both text boxes supports multiple patterns by placing one pattern on each line.Here you can select which types of events you want to include as well as which individual channels you want to include for user events.This lets you find an event or log message by string contents.Otherwise the Find dialog will open.This lets you find an event by timestamp.

    This can be very powerful when comparing traces, as you can exclude irrelevant events and also the timestamps, e.g., if you wish to compare traces with small differences in timing.Depending on the nature of the channels in the set, the value may be higher than 100%.In this case, the total should always be 100%.The number of slices can be changed via the Resolution or Time Resolution menus.This way, you can see if messages to a task are delayed.The color of a message indicates the actor that sent the message.Clicking an event will display details about it in the panel to the right, which also features navigation buttons. Double-clicking an event will highlight it in the trace view. This can be used to find any memory leaks.It can be used to identify situations where the system has trouble processing all input within a reasonable time. You can filter what actors to visualize by clicking on them in the legend field. If you click on a marker in the graph you can see information about that event in the information panel. Double-clicking will focus the main view on that event. Priority Changes The Y-axis shows the new priority level.Clicking a data point (a service call) will highlight it in the trace view.Note If accessed from the View menu of the main window, this view will plot all calls on any object.See Intervals and State Machines view for further information on how to define state machines.Tracealyzer also has pre-defined awareness of some states, such as task scheduling state. In the Intervals and State Machines view, select Add Predefined to see the available data sets.Trace View By actor we mean an execution context - a task or ISR.The same color is used to represent the actor in all Tracealyzer views.See Events for information on the sections.The different Fields are separated by thick lines. The field names are shown in the header, i.e. in the top part of the trace view, when using the vertical orientation.Intervals field: Displays intervals and states.

    Such fields are named after the displayed data set. Metrics field: Shows metrics embedded next to all other trace fields. Events field: Shows event labels for e.g. kernel API calls and user events. The field will show all events from fields to its left, making it easy to see different events at the same time. The image on the left shows with this option enabled, the one on the right with it disabled.Applying actor selection will work together with current filter; if an actor is not in the current filter it will not be shown in the Scheduling Field either.This can be changed by checking Reverse Draw Order.Note! Each field will remember the setting for hiding, as long as Percepio Tracealyzer is set to remember layout.The same dialog can be opened by clicking Select Metrics.Each preset will set up the fields needed to show the type of information required. The presets are:By double-clicking them you navigate theYou can also drag the view by holding down the mouse wheel or middle mouse button. You can select an interval by holding in the left mouse button. By right-clicking on the selection, you open a context menu with various options for the selection interval, such as Zoom In. The first event will still be selected, making it possible to measure to different events and see the result.When using another view to navigate the trace, you can click or double click to focus the trace view on this location. All graphical views also support selecting a time interval (by pressing the left mouse button and dragging) and showing this interval in the trace view. You can also zoom with your mouse wheel when holding down the Ctrl key. The scroll-to-zoom behavior is always active when Scroll Lock is enabled. If your mouse features back and forward buttons, you can use these to quickly zoom in and out. User Events Signal Plot If a user event have multiple data arguments, only the first is plotted.You can change what user event channels that are displayed in the Filter.

    Details can be provided on request.This shows if the recorder library has reported a configuration problem, or other issues that may occur. Bookmark Organizer They allow for searching for just about anything in Tracealyzer, including events, actors, views, and even help pages.It performs fast searches but only shows a limited amount of hits.When something is selected the default behavior is to close the Quick Finder.You may add several filters if you wish to restrict the search further, using and or or.It will however not search through the whole text of the page, but do a quick match on keywords, similar to how views are matched. To perform free text searches in the whole User Manual, simply open it (default shortcut is F1) and use the built in find.Instance Details Besides the details, these views are also available:The current selection is highlighted with light blue background, and if different the selection of the main window as well with a teal background.Besides the details, these views are also available:The current selection is highlighted with light blue background, and if different the selection of the main window as well with a teal background.It can also be set to filter for specific From or To states, either with Or logic (match either) or And logic (match both).You can right-click these entries for the following options:Create Inverted - Creates a new inverted data set. If the original data set is intervals from Event A to Event B, the inverted data set is the intervals from Event B to the next Event A. Compute Overlap - Creates a new data set that is the intersection of two data sets Predefined There are two ways:All messages on this user event channel are assumed to be state transitions.Begin with specifying a name for the interval, and then provide two rules for the beginning and end of the interval. The first interval will begin at the first event matching Interval Start, and finish at the first following event matching Interval End.


  • Commentaires

    Aucun commentaire pour le moment

    Suivre le flux RSS des commentaires


    Ajouter un commentaire

    Nom / Pseudo :

    E-mail (facultatif) :

    Site Web (facultatif) :

    Commentaire :