init commit
This commit is contained in:
346
Utilities/trace/adv_trace/Release_Notes.html
Normal file
346
Utilities/trace/adv_trace/Release_Notes.html
Normal file
@@ -0,0 +1,346 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="generator" content="pandoc" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
|
||||
<title>Release Notes for STM32 advanced tracer</title>
|
||||
<style>
|
||||
code{white-space: pre-wrap;}
|
||||
span.smallcaps{font-variant: small-caps;}
|
||||
span.underline{text-decoration: underline;}
|
||||
div.column{display: inline-block; vertical-align: top; width: 50%;}
|
||||
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
|
||||
ul.task-list{list-style: none;}
|
||||
.display.math{display: block; text-align: center; margin: 0.5rem auto;}
|
||||
</style>
|
||||
<link rel="stylesheet" href="_htmresc/mini-st.css" />
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-lg-4">
|
||||
<div class="card fluid">
|
||||
<div class="sectione dark">
|
||||
<center>
|
||||
<h1 id="release-notes-for-stm32-adv_trace"><small>Release Notes for</small> STM32 adv_trace</h1>
|
||||
<p>Copyright © 2019 STMicroelectronics<br />
|
||||
</p>
|
||||
<a href="https://www.st.com" class="logo"><img src="./_htmresc/st_logo.png" alt="ST logo" /></a>
|
||||
</center>
|
||||
</div>
|
||||
</div>
|
||||
<h1 id="license">License</h1>
|
||||
<p>This software component is licensed by ST under BSD 3-Clause license, the “License”; You may not use this file except in compliance with the License. You may obtain a copy of the License at:</p>
|
||||
<p><a href="https://opensource.org/licenses/BSD-3-Clause">https://opensource.org/licenses/BSD-3-Clause</a></p>
|
||||
<h1 id="purpose">Purpose</h1>
|
||||
<p>The source code delivered is an utility to help the application debug by providing a trace service.</p>
|
||||
</div>
|
||||
<section id="update-history" class="col-sm-12 col-lg-8">
|
||||
<h1>Update History</h1>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section9" checked aria-hidden="true"> <label for="collapse-section9" aria-hidden="true">V1.3.0 / 09-November-2021</label>
|
||||
<div>
|
||||
<h2 id="main-changes">Main Changes</h2>
|
||||
<h2 id="contents">Contents</h2>
|
||||
<table>
|
||||
<caption>Fixed bugs list<br />
|
||||
</caption>
|
||||
<thead>
|
||||
<tr class="header">
|
||||
<th>Headline</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td>Ticket 115234 - [Licensing] Update the way to declare licenses in Cube and X-CUBE components</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h2 id="known-limitations">known limitations</h2>
|
||||
<h2 id="development-toolchains-and-compilers">Development Toolchains and Compilers</h2>
|
||||
<ul>
|
||||
<li>IAR Embedded Workbench for ARM (EWARM) toolchain V8.20.2</li>
|
||||
<li>RealView Microcontroller Development Kit (MDK-ARM) toolchain V5.25</li>
|
||||
<li>System Workbench STM32 (SW4STM32) toolchain V2.7.2</li>
|
||||
</ul>
|
||||
<h2 id="supported-devices-and-boards">Supported Devices and boards</h2>
|
||||
<h2 id="backward-compatibility">backward compatibility</h2>
|
||||
<h2 id="dependencies">Dependencies</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section8" aria-hidden="true"> <label for="collapse-section8" aria-hidden="true">V1.2.0 / 10-May-2021</label>
|
||||
<div>
|
||||
<h2 id="main-changes-1">Main Changes</h2>
|
||||
<h3 id="release-v1.2.0">release v1.2.0</h3>
|
||||
<h2 id="contents-1">Contents</h2>
|
||||
<table>
|
||||
<caption>Fixed bugs list<br />
|
||||
</caption>
|
||||
<thead>
|
||||
<tr class="header">
|
||||
<th>Headline</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td>Ticket 106337 - CodeSpell issues detected on adv_traceproject</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h2 id="known-limitations-1">known limitations</h2>
|
||||
<h2 id="development-toolchains-and-compilers-1">Development Toolchains and Compilers</h2>
|
||||
<ul>
|
||||
<li>IAR Embedded Workbench for ARM (EWARM) toolchain V8.20.2</li>
|
||||
<li>RealView Microcontroller Development Kit (MDK-ARM) toolchain V5.25</li>
|
||||
<li>System Workbench STM32 (SW4STM32) toolchain V2.7.2</li>
|
||||
</ul>
|
||||
<h2 id="supported-devices-and-boards-1">Supported Devices and boards</h2>
|
||||
<h2 id="backward-compatibility-1">backward compatibility</h2>
|
||||
<h2 id="dependencies-1">Dependencies</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section7" aria-hidden="true"> <label for="collapse-section7" aria-hidden="true">V1.1.0 / 04-Februar-2021</label>
|
||||
<div>
|
||||
<h2 id="main-changes-2">Main Changes</h2>
|
||||
<h3 id="release-v1.1.0">release v1.1.0</h3>
|
||||
<h2 id="contents-2">Contents</h2>
|
||||
<table>
|
||||
<caption>Fixed bugs list<br />
|
||||
</caption>
|
||||
<thead>
|
||||
<tr class="header">
|
||||
<th>Headline</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td>Ticket 99822 - add API to poll when if buffer is empty ( uint8_t UTIL_ADV_TRACE_IsBufferEmpty(void))</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td>Code review - Improve overrun feature</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h2 id="known-limitations-2">known limitations</h2>
|
||||
<h2 id="development-toolchains-and-compilers-2">Development Toolchains and Compilers</h2>
|
||||
<ul>
|
||||
<li>IAR Embedded Workbench for ARM (EWARM) toolchain V8.20.2</li>
|
||||
<li>RealView Microcontroller Development Kit (MDK-ARM) toolchain V5.25</li>
|
||||
<li>System Workbench STM32 (SW4STM32) toolchain V2.7.2</li>
|
||||
</ul>
|
||||
<h2 id="supported-devices-and-boards-2">Supported Devices and boards</h2>
|
||||
<h2 id="backward-compatibility-2">backward compatibility</h2>
|
||||
<h2 id="dependencies-2">Dependencies</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section6" aria-hidden="true"> <label for="collapse-section6" aria-hidden="true">V1.0.5 / 19-October-2020</label>
|
||||
<div>
|
||||
<h2 id="main-changes-3">Main Changes</h2>
|
||||
<h3 id="release-v1.0.5">release v1.0.5</h3>
|
||||
<h2 id="contents-3">Contents</h2>
|
||||
<table>
|
||||
<caption>Fixed bugs list<br />
|
||||
</caption>
|
||||
<thead>
|
||||
<tr class="header">
|
||||
<th>Headline</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td>Ticket 94664 - stm32_adv_trace_if_template.c be updated</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h2 id="known-limitations-3">known limitations</h2>
|
||||
<h2 id="development-toolchains-and-compilers-3">Development Toolchains and Compilers</h2>
|
||||
<ul>
|
||||
<li>IAR Embedded Workbench for ARM (EWARM) toolchain V8.20.2</li>
|
||||
<li>RealView Microcontroller Development Kit (MDK-ARM) toolchain V5.25</li>
|
||||
<li>System Workbench STM32 (SW4STM32) toolchain V2.7.2</li>
|
||||
</ul>
|
||||
<h2 id="supported-devices-and-boards-3">Supported Devices and boards</h2>
|
||||
<h2 id="backward-compatibility-3">backward compatibility</h2>
|
||||
<h2 id="dependencies-3">Dependencies</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section5" aria-hidden="true"> <label for="collapse-section5" aria-hidden="true">V1.0.4 / 10-September-2020</label>
|
||||
<div>
|
||||
<h2 id="main-changes-4">Main Changes</h2>
|
||||
<h3 id="release-v1.0.4">release v1.0.4</h3>
|
||||
<h2 id="contents-4">Contents</h2>
|
||||
<table>
|
||||
<caption>Fixed bugs list<br />
|
||||
</caption>
|
||||
<thead>
|
||||
<tr class="header">
|
||||
<th>Headline</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td>Ticket 86948 - CodeSpell : Correct some english words typo</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h2 id="known-limitations-4">known limitations</h2>
|
||||
<h2 id="development-toolchains-and-compilers-4">Development Toolchains and Compilers</h2>
|
||||
<ul>
|
||||
<li>IAR Embedded Workbench for ARM (EWARM) toolchain V8.20.2</li>
|
||||
<li>RealView Microcontroller Development Kit (MDK-ARM) toolchain V5.25</li>
|
||||
<li>System Workbench STM32 (SW4STM32) toolchain V2.7.2</li>
|
||||
</ul>
|
||||
<h2 id="supported-devices-and-boards-4">Supported Devices and boards</h2>
|
||||
<h2 id="backward-compatibility-4">backward compatibility</h2>
|
||||
<h2 id="dependencies-4">Dependencies</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section4" aria-hidden="true"> <label for="collapse-section4" aria-hidden="true">V1.0.3 / 3-September-2020</label>
|
||||
<div>
|
||||
<h2 id="main-changes-5">Main Changes</h2>
|
||||
<h3 id="release-v1.0.3">release v1.0.3</h3>
|
||||
<h2 id="contents-5">Contents</h2>
|
||||
<table>
|
||||
<caption>Fixed bugs list<br />
|
||||
</caption>
|
||||
<thead>
|
||||
<tr class="header">
|
||||
<th>Headline</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td>Ticket 89624 - Utilities Releases Notes Improvements - Link on openorg BSD-3-Clause.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h2 id="known-limitations-5">known limitations</h2>
|
||||
<h2 id="development-toolchains-and-compilers-5">Development Toolchains and Compilers</h2>
|
||||
<ul>
|
||||
<li>IAR Embedded Workbench for ARM (EWARM) toolchain V8.20.2</li>
|
||||
<li>RealView Microcontroller Development Kit (MDK-ARM) toolchain V5.25</li>
|
||||
<li>System Workbench STM32 (SW4STM32) toolchain V2.7.2</li>
|
||||
</ul>
|
||||
<h2 id="supported-devices-and-boards-5">Supported Devices and boards</h2>
|
||||
<h2 id="backward-compatibility-5">backward compatibility</h2>
|
||||
<h2 id="dependencies-5">Dependencies</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section3" aria-hidden="true"> <label for="collapse-section3" aria-hidden="true">V1.0.2 / 19-June-2020</label>
|
||||
<div>
|
||||
<h2 id="main-changes-6">Main Changes</h2>
|
||||
<h3 id="release-v1.0.2">release v1.0.2</h3>
|
||||
<h2 id="contents-6">Contents</h2>
|
||||
<table>
|
||||
<caption>Fixed bugs list<br />
|
||||
</caption>
|
||||
<thead>
|
||||
<tr class="header">
|
||||
<th>Headline</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td>Ticket 83642 - add possibility to sprintf directly to queue in unchunk mode.</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td>Ticket 86948 - CodeSpell : Correct some english words typo.</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td>Ticket 88566 - for security reasons, need to place the TraceBuffer.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h2 id="known-limitations-6">known limitations</h2>
|
||||
<h2 id="development-toolchains-and-compilers-6">Development Toolchains and Compilers</h2>
|
||||
<ul>
|
||||
<li>IAR Embedded Workbench for ARM (EWARM) toolchain V8.20.2</li>
|
||||
<li>RealView Microcontroller Development Kit (MDK-ARM) toolchain V5.25</li>
|
||||
<li>System Workbench STM32 (SW4STM32) toolchain V2.7.2</li>
|
||||
</ul>
|
||||
<h2 id="supported-devices-and-boards-6">Supported Devices and boards</h2>
|
||||
<h2 id="backward-compatibility-6">backward compatibility</h2>
|
||||
<h2 id="dependencies-6">Dependencies</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section2" aria-hidden="true"> <label for="collapse-section2" aria-hidden="true">V1.0.1 / 12-Decembre-2019</label>
|
||||
<div>
|
||||
<h2 id="main-changes-7">Main Changes</h2>
|
||||
<h3 id="release-v1.0.1">release v1.0.1</h3>
|
||||
<h2 id="contents-7">Contents</h2>
|
||||
<table>
|
||||
<caption>Fixed bugs list<br />
|
||||
</caption>
|
||||
<thead>
|
||||
<tr class="header">
|
||||
<th>Headline</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td>Release note update.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h2 id="known-limitations-7">known limitations</h2>
|
||||
<h2 id="development-toolchains-and-compilers-7">Development Toolchains and Compilers</h2>
|
||||
<ul>
|
||||
<li>IAR Embedded Workbench for ARM (EWARM) toolchain V8.20.2</li>
|
||||
<li>RealView Microcontroller Development Kit (MDK-ARM) toolchain V5.25</li>
|
||||
<li>System Workbench STM32 (SW4STM32) toolchain V2.7.2</li>
|
||||
</ul>
|
||||
<h2 id="supported-devices-and-boards-7">Supported Devices and boards</h2>
|
||||
<h2 id="backward-compatibility-7">backward compatibility</h2>
|
||||
<h2 id="dependencies-7">Dependencies</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section1" aria-hidden="true"> <label for="collapse-section1" aria-hidden="true">V1.0.0 / 16-October-2019</label>
|
||||
<div>
|
||||
<h2 id="main-changes-8">Main Changes</h2>
|
||||
<h3 id="first-release">first release</h3>
|
||||
<h2 id="contents-8">Contents</h2>
|
||||
<table>
|
||||
<caption>Fixed bugs list<br />
|
||||
</caption>
|
||||
<thead>
|
||||
<tr class="header">
|
||||
<th>Headline</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td>first version.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h2 id="known-limitations-8">known limitations</h2>
|
||||
<h2 id="development-toolchains-and-compilers-8">Development Toolchains and Compilers</h2>
|
||||
<ul>
|
||||
<li>IAR Embedded Workbench for ARM (EWARM) toolchain V8.20.2</li>
|
||||
<li>RealView Microcontroller Development Kit (MDK-ARM) toolchain V5.25</li>
|
||||
<li>System Workbench STM32 (SW4STM32) toolchain V2.7.2</li>
|
||||
</ul>
|
||||
<h2 id="supported-devices-and-boards-8">Supported Devices and boards</h2>
|
||||
<h2 id="backward-compatibility-8">backward compatibility</h2>
|
||||
<h2 id="dependencies-8">Dependencies</h2>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<footer class="sticky">
|
||||
<p>For complete documentation on STM32,visit: [<a href="http://www.st.com">www.st.com/stm32</a>]</p>
|
||||
This release note uses up to date web standards and, for this reason, should not be opened with Internet Explorer but preferably with popular browsers such as Google Chrome, Mozilla Firefox, Opera or Microsoft Edge.
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
1700
Utilities/trace/adv_trace/_htmresc/mini-st.css
Normal file
1700
Utilities/trace/adv_trace/_htmresc/mini-st.css
Normal file
File diff suppressed because it is too large
Load Diff
BIN
Utilities/trace/adv_trace/_htmresc/st_logo.png
Normal file
BIN
Utilities/trace/adv_trace/_htmresc/st_logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
828
Utilities/trace/adv_trace/stm32_adv_trace.c
Normal file
828
Utilities/trace/adv_trace/stm32_adv_trace.c
Normal file
@@ -0,0 +1,828 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file stm32_adv_trace.c
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains the advanced trace utility functions.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2019 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software is licensed under terms that can be found in the LICENSE file
|
||||
* in the root directory of this software component.
|
||||
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm32_adv_trace.h"
|
||||
#include "stdarg.h"
|
||||
#include "stdio.h"
|
||||
|
||||
/** @addtogroup ADV_TRACE
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Private defines -----------------------------------------------------------*/
|
||||
|
||||
/** @defgroup ADV_TRACE_Private_defines ADV_TRACE Privates defines
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief memory address of the trace buffer location.
|
||||
* This define can be used, to change the buffer location.
|
||||
*
|
||||
*/
|
||||
#if !defined(UTIL_ADV_TRACE_MEMLOCATION)
|
||||
#define UTIL_ADV_TRACE_MEMLOCATION
|
||||
#endif
|
||||
|
||||
#if defined(UTIL_ADV_TRACE_OVERRUN)
|
||||
/**
|
||||
* @brief List the overrun status.
|
||||
* list of the overrun status used to handle the overrun trace evacuation.
|
||||
*
|
||||
* @note only valid if UTIL_ADV_TRACE_OVERRUN has been enabled inside utilities conf
|
||||
*/
|
||||
typedef enum {
|
||||
TRACE_OVERRUN_NONE = 0, /*!<overrun status none. */
|
||||
TRACE_OVERRUN_INDICATION, /*!<overrun status an indication shall be sent. */
|
||||
TRACE_OVERRUN_TRANSFERT, /*!<overrun status data transfer ongoing. */
|
||||
TRACE_OVERRUN_EXECUTED, /*!<overrun status data transfer complete. */
|
||||
} TRACE_OVERRUN_STATUS;
|
||||
#endif
|
||||
|
||||
#if defined(UTIL_ADV_TRACE_UNCHUNK_MODE)
|
||||
/**
|
||||
* @brief List the unchunk status.
|
||||
* list of the unchunk status used to handle the unchunk case.
|
||||
*
|
||||
* @note only valid if UTIL_ADV_TRACE_UNCHUNK_MODE has been enabled inside utilities conf
|
||||
*/
|
||||
typedef enum {
|
||||
TRACE_UNCHUNK_NONE = 0, /*!<unchunk status none. */
|
||||
TRACE_UNCHUNK_DETECTED, /*!<unchunk status an unchunk has been detected. */
|
||||
TRACE_UNCHUNK_TRANSFER /*!<unchunk status an unchunk transfer is ongoing. */
|
||||
} TRACE_UNCHUNK_STATUS;
|
||||
#endif
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief advanced macro to override to enable debug mode
|
||||
*/
|
||||
#ifndef UTIL_ADV_TRACE_DEBUG
|
||||
#define UTIL_ADV_TRACE_DEBUG(...)
|
||||
#endif
|
||||
/* Private macros ------------------------------------------------------------*/
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
|
||||
/** @defgroup ADV_TRACE_private_typedef ADV_TRACE private typedef
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief ADV_TRACE_Context.
|
||||
* this structure contains all the data to handle the trace context.
|
||||
*
|
||||
* @note some part of the context are depend with the selected switch inside the configuration file
|
||||
* UTIL_ADV_TRACE_UNCHUNK_MODE, UTIL_ADV_TRACE_OVERRUN, UTIL_ADV_TRACE_CONDITIONNAL
|
||||
*/
|
||||
typedef struct {
|
||||
#if defined(UTIL_ADV_TRACE_UNCHUNK_MODE)
|
||||
uint16_t unchunk_enabled; /*!<unchunk enable. */
|
||||
TRACE_UNCHUNK_STATUS unchunk_status; /*!<unchunk transfer status. */
|
||||
#endif
|
||||
#if defined(UTIL_ADV_TRACE_OVERRUN)
|
||||
TRACE_OVERRUN_STATUS OverRunStatus; /*!<overrun status. */
|
||||
cb_overrun *overrun_func; /*!<overrun function */
|
||||
#endif
|
||||
#if defined(UTIL_ADV_TRACE_CONDITIONNAL)
|
||||
cb_timestamp *timestamp_func; /*!<ptr of function used to insert time stamp. */
|
||||
uint8_t CurrentVerboseLevel; /*!<verbose level used. */
|
||||
uint32_t RegionMask; /*!<mask of the enabled region. */
|
||||
#endif
|
||||
uint16_t TraceRdPtr; /*!<read pointer the trace system. */
|
||||
uint16_t TraceWrPtr; /*!<write pointer the trace system. */
|
||||
uint16_t TraceSentSize; /*!<size of the latest transfer. */
|
||||
uint16_t TraceLock; /*!<lock counter of the trace system. */
|
||||
} ADV_TRACE_Context;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Private variables ---------------------------------------------------------*/
|
||||
/** @defgroup ADV_TRACE_private_variable ADV_TRACE private variable
|
||||
* private variable of the advanced trace system.
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief trace context
|
||||
* this variable contains all the internal data of the advanced trace system.
|
||||
*/
|
||||
static ADV_TRACE_Context ADV_TRACE_Ctx;
|
||||
static UTIL_ADV_TRACE_MEMLOCATION uint8_t ADV_TRACE_Buffer[UTIL_ADV_TRACE_FIFO_SIZE];
|
||||
|
||||
#if defined(UTIL_ADV_TRACE_CONDITIONNAL) && defined(UTIL_ADV_TRACE_UNCHUNK_MODE)
|
||||
/**
|
||||
* @brief temporary buffer used by UTIL_ADV_TRACE_COND_FSend
|
||||
* a temporary buffers variable used to evaluate a formatted string size.
|
||||
*/
|
||||
static uint8_t sztmp[UTIL_ADV_TRACE_TMP_BUF_SIZE];
|
||||
#endif
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Private function prototypes -----------------------------------------------*/
|
||||
/** @defgroup ADV_TRACE_private_function ADV_TRACE private function
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
static void TRACE_TxCpltCallback(void *Ptr);
|
||||
static int16_t TRACE_AllocateBufer(uint16_t Size, uint16_t *Pos);
|
||||
static UTIL_ADV_TRACE_Status_t TRACE_Send(void);
|
||||
|
||||
static void TRACE_Lock(void);
|
||||
static void TRACE_UnLock(void);
|
||||
static uint32_t TRACE_IsLocked(void);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Functions Definition ------------------------------------------------------*/
|
||||
|
||||
/** @addtogroup ADV_TRACE_exported_function
|
||||
* @{
|
||||
*/
|
||||
UTIL_ADV_TRACE_Status_t UTIL_ADV_TRACE_Init(void)
|
||||
{
|
||||
/* initialize the Ptr for Read/Write */
|
||||
(void)UTIL_ADV_TRACE_MEMSET8(&ADV_TRACE_Ctx, 0x0, sizeof(ADV_TRACE_Context));
|
||||
(void)UTIL_ADV_TRACE_MEMSET8(&ADV_TRACE_Buffer, 0x0, sizeof(ADV_TRACE_Buffer));
|
||||
|
||||
#if defined(UTIL_ADV_TRACE_UNCHUNK_MODE)
|
||||
UTIL_ADV_TRACE_DEBUG("\nUNCHUNK_MODE\n");
|
||||
#endif
|
||||
/* Allocate Lock resource */
|
||||
UTIL_ADV_TRACE_INIT_CRITICAL_SECTION();
|
||||
|
||||
/* Initialize the Low Level interface */
|
||||
return UTIL_TraceDriver.Init(TRACE_TxCpltCallback);
|
||||
}
|
||||
|
||||
UTIL_ADV_TRACE_Status_t UTIL_ADV_TRACE_DeInit(void)
|
||||
{
|
||||
/* Un-initialize the Low Level interface */
|
||||
return UTIL_TraceDriver.DeInit();
|
||||
}
|
||||
|
||||
uint8_t UTIL_ADV_TRACE_IsBufferEmpty(void)
|
||||
{
|
||||
/* check of the buffer is empty */
|
||||
if(ADV_TRACE_Ctx.TraceWrPtr == ADV_TRACE_Ctx.TraceRdPtr)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
UTIL_ADV_TRACE_Status_t UTIL_ADV_TRACE_StartRxProcess(void (*UserCallback)(uint8_t *PData, uint16_t Size, uint8_t Error))
|
||||
{
|
||||
/* start the RX process */
|
||||
return UTIL_TraceDriver.StartRx(UserCallback);
|
||||
}
|
||||
|
||||
#if defined(UTIL_ADV_TRACE_CONDITIONNAL)
|
||||
UTIL_ADV_TRACE_Status_t UTIL_ADV_TRACE_COND_FSend(uint32_t VerboseLevel, uint32_t Region, uint32_t TimeStampState, const char *strFormat, ...)
|
||||
{
|
||||
va_list vaArgs;
|
||||
#if defined(UTIL_ADV_TRACE_UNCHUNK_MODE)
|
||||
uint8_t buf[UTIL_ADV_TRACE_TMP_MAX_TIMESTMAP_SIZE];
|
||||
uint16_t timestamp_size = 0u;
|
||||
uint16_t writepos;
|
||||
uint16_t idx;
|
||||
#else
|
||||
uint8_t buf[UTIL_ADV_TRACE_TMP_BUF_SIZE+UTIL_ADV_TRACE_TMP_MAX_TIMESTMAP_SIZE];
|
||||
#endif
|
||||
uint16_t buff_size = 0u;
|
||||
|
||||
/* check verbose level */
|
||||
if(!(ADV_TRACE_Ctx.CurrentVerboseLevel >= VerboseLevel))
|
||||
{
|
||||
return UTIL_ADV_TRACE_GIVEUP;
|
||||
}
|
||||
|
||||
if((Region & ADV_TRACE_Ctx.RegionMask) != Region)
|
||||
{
|
||||
return UTIL_ADV_TRACE_REGIONMASKED;
|
||||
}
|
||||
|
||||
#if defined(UTIL_ADV_TRACE_UNCHUNK_MODE)
|
||||
if((ADV_TRACE_Ctx.timestamp_func != NULL) && (TimeStampState != 0u))
|
||||
{
|
||||
ADV_TRACE_Ctx.timestamp_func(buf,×tamp_size);
|
||||
}
|
||||
|
||||
va_start( vaArgs, strFormat);
|
||||
buff_size =(uint16_t)UTIL_ADV_TRACE_VSNPRINTF((char *)sztmp,UTIL_ADV_TRACE_TMP_BUF_SIZE, strFormat, vaArgs);
|
||||
|
||||
TRACE_Lock();
|
||||
|
||||
/* if allocation is ok, write data into the buffer */
|
||||
if (TRACE_AllocateBufer((buff_size+timestamp_size),&writepos) != -1)
|
||||
{
|
||||
#if defined(UTIL_ADV_TRACE_OVERRUN)
|
||||
UTIL_ADV_TRACE_ENTER_CRITICAL_SECTION();
|
||||
if(ADV_TRACE_Ctx.OverRunStatus == TRACE_OVERRUN_EXECUTED)
|
||||
{
|
||||
/* clear the over run */
|
||||
ADV_TRACE_Ctx.OverRunStatus = TRACE_OVERRUN_NONE;
|
||||
}
|
||||
UTIL_ADV_TRACE_EXIT_CRITICAL_SECTION();
|
||||
#endif
|
||||
|
||||
/* copy the timestamp */
|
||||
for (idx = 0u; idx < timestamp_size; idx++)
|
||||
{
|
||||
ADV_TRACE_Buffer[writepos] = buf[idx];
|
||||
writepos = writepos + 1u;
|
||||
}
|
||||
|
||||
/* copy the data */
|
||||
(void)UTIL_ADV_TRACE_VSNPRINTF((char *)(&ADV_TRACE_Buffer[writepos]), UTIL_ADV_TRACE_TMP_BUF_SIZE, strFormat, vaArgs);
|
||||
va_end(vaArgs);
|
||||
|
||||
TRACE_UnLock();
|
||||
|
||||
return TRACE_Send();
|
||||
}
|
||||
|
||||
va_end(vaArgs);
|
||||
TRACE_UnLock();
|
||||
#if defined(UTIL_ADV_TRACE_OVERRUN)
|
||||
UTIL_ADV_TRACE_ENTER_CRITICAL_SECTION();
|
||||
if((ADV_TRACE_Ctx.OverRunStatus == TRACE_OVERRUN_NONE ) && (NULL != ADV_TRACE_Ctx.overrun_func))
|
||||
{
|
||||
UTIL_ADV_TRACE_DEBUG("UTIL_ADV_TRACE_Send:TRACE_OVERRUN_INDICATION");
|
||||
ADV_TRACE_Ctx.OverRunStatus = TRACE_OVERRUN_INDICATION;
|
||||
}
|
||||
UTIL_ADV_TRACE_EXIT_CRITICAL_SECTION();
|
||||
#endif
|
||||
|
||||
return UTIL_ADV_TRACE_MEM_FULL;
|
||||
|
||||
#else
|
||||
if((ADV_TRACE_Ctx.timestamp_func != NULL) && (TimeStampState != 0u))
|
||||
{
|
||||
ADV_TRACE_Ctx.timestamp_func(buf,&buff_size);
|
||||
}
|
||||
|
||||
va_start(vaArgs, strFormat);
|
||||
buff_size += (uint16_t) UTIL_ADV_TRACE_VSNPRINTF((char* )(buf + buff_size), UTIL_ADV_TRACE_TMP_BUF_SIZE, strFormat, vaArgs);
|
||||
va_end(vaArgs);
|
||||
|
||||
return UTIL_ADV_TRACE_Send(buf, buff_size);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
UTIL_ADV_TRACE_Status_t UTIL_ADV_TRACE_FSend(const char *strFormat, ...)
|
||||
{
|
||||
uint8_t buf[UTIL_ADV_TRACE_TMP_BUF_SIZE];
|
||||
va_list vaArgs;
|
||||
|
||||
va_start(vaArgs, strFormat);
|
||||
uint16_t bufSize = (uint16_t) UTIL_ADV_TRACE_VSNPRINTF((char* )buf, UTIL_ADV_TRACE_TMP_BUF_SIZE, strFormat, vaArgs);
|
||||
va_end(vaArgs);
|
||||
|
||||
return UTIL_ADV_TRACE_Send(buf, bufSize);
|
||||
}
|
||||
|
||||
#if defined(UTIL_ADV_TRACE_CONDITIONNAL)
|
||||
UTIL_ADV_TRACE_Status_t UTIL_ADV_TRACE_COND_ZCSend_Allocation(uint32_t VerboseLevel, uint32_t Region, uint32_t TimeStampState, uint16_t length, uint8_t **pData, uint16_t *FifoSize, uint16_t *WritePos)
|
||||
{
|
||||
UTIL_ADV_TRACE_Status_t ret = UTIL_ADV_TRACE_OK;
|
||||
uint16_t writepos;
|
||||
uint8_t timestamp_ptr[UTIL_ADV_TRACE_TMP_MAX_TIMESTMAP_SIZE];
|
||||
uint16_t timestamp_size = 0u;
|
||||
|
||||
/* check verbose level */
|
||||
if(!(ADV_TRACE_Ctx.CurrentVerboseLevel >= VerboseLevel))
|
||||
{
|
||||
return UTIL_ADV_TRACE_GIVEUP;
|
||||
}
|
||||
|
||||
if((Region & ADV_TRACE_Ctx.RegionMask) != Region)
|
||||
{
|
||||
return UTIL_ADV_TRACE_REGIONMASKED;
|
||||
}
|
||||
|
||||
if((ADV_TRACE_Ctx.timestamp_func != NULL) && (TimeStampState != 0u))
|
||||
{
|
||||
ADV_TRACE_Ctx.timestamp_func(timestamp_ptr, ×tamp_size);
|
||||
}
|
||||
|
||||
TRACE_Lock();
|
||||
|
||||
/* if allocation is ok, write data into the buffer */
|
||||
if (TRACE_AllocateBufer(length+timestamp_size, &writepos) != -1)
|
||||
{
|
||||
/* fill time stamp information */
|
||||
for (uint16_t index = 0u; index < timestamp_size; index++)
|
||||
{
|
||||
ADV_TRACE_Buffer[writepos] = timestamp_ptr[index];
|
||||
writepos = (uint16_t) ((writepos + 1u) % UTIL_ADV_TRACE_FIFO_SIZE);
|
||||
}
|
||||
|
||||
/*user fill */
|
||||
*pData = ADV_TRACE_Buffer;
|
||||
*FifoSize = (uint16_t) UTIL_ADV_TRACE_FIFO_SIZE;
|
||||
*WritePos = writepos;
|
||||
}
|
||||
else
|
||||
{
|
||||
TRACE_UnLock();
|
||||
ret = UTIL_ADV_TRACE_MEM_FULL;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
UTIL_ADV_TRACE_Status_t UTIL_ADV_TRACE_COND_ZCSend_Finalize(void)
|
||||
{
|
||||
return UTIL_ADV_TRACE_ZCSend_Finalize();
|
||||
}
|
||||
#endif
|
||||
|
||||
UTIL_ADV_TRACE_Status_t UTIL_ADV_TRACE_ZCSend_Allocation(uint16_t Length, uint8_t **pData, uint16_t *FifoSize, uint16_t *WritePos)
|
||||
{
|
||||
UTIL_ADV_TRACE_Status_t ret = UTIL_ADV_TRACE_OK;
|
||||
uint16_t writepos;
|
||||
|
||||
TRACE_Lock();
|
||||
|
||||
/* if allocation is ok, write data into the buffer */
|
||||
if (TRACE_AllocateBufer(Length,&writepos) != -1)
|
||||
{
|
||||
/*user fill */
|
||||
*pData = ADV_TRACE_Buffer;
|
||||
*FifoSize = UTIL_ADV_TRACE_FIFO_SIZE;
|
||||
*WritePos = (uint16_t)writepos;
|
||||
}
|
||||
else
|
||||
{
|
||||
TRACE_UnLock();
|
||||
ret = UTIL_ADV_TRACE_MEM_FULL;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
UTIL_ADV_TRACE_Status_t UTIL_ADV_TRACE_ZCSend_Finalize(void)
|
||||
{
|
||||
TRACE_UnLock();
|
||||
return TRACE_Send();
|
||||
}
|
||||
|
||||
#if defined(UTIL_ADV_TRACE_CONDITIONNAL)
|
||||
UTIL_ADV_TRACE_Status_t UTIL_ADV_TRACE_COND_Send(uint32_t VerboseLevel, uint32_t Region, uint32_t TimeStampState, const uint8_t *pData, uint16_t Length)
|
||||
{
|
||||
UTIL_ADV_TRACE_Status_t ret;
|
||||
uint16_t writepos;
|
||||
uint32_t idx;
|
||||
uint8_t timestamp_ptr[UTIL_ADV_TRACE_TMP_MAX_TIMESTMAP_SIZE];
|
||||
uint16_t timestamp_size = 0u;
|
||||
|
||||
/* check verbose level */
|
||||
if(!(ADV_TRACE_Ctx.CurrentVerboseLevel >= VerboseLevel))
|
||||
{
|
||||
return UTIL_ADV_TRACE_GIVEUP;
|
||||
}
|
||||
|
||||
if((Region & ADV_TRACE_Ctx.RegionMask) != Region)
|
||||
{
|
||||
return UTIL_ADV_TRACE_REGIONMASKED;
|
||||
}
|
||||
|
||||
if((ADV_TRACE_Ctx.timestamp_func != NULL) && (TimeStampState != 0u))
|
||||
{
|
||||
ADV_TRACE_Ctx.timestamp_func(timestamp_ptr, ×tamp_size);
|
||||
}
|
||||
|
||||
TRACE_Lock();
|
||||
|
||||
/* if allocation is ok, write data into the buffer */
|
||||
if (TRACE_AllocateBufer(Length + timestamp_size, &writepos) != -1)
|
||||
{
|
||||
/* fill time stamp information */
|
||||
for (idx = 0; idx < timestamp_size; idx++)
|
||||
{
|
||||
ADV_TRACE_Buffer[writepos] = timestamp_ptr[idx];
|
||||
writepos = (uint16_t) ((writepos + 1u) % UTIL_ADV_TRACE_FIFO_SIZE);
|
||||
}
|
||||
|
||||
for (idx = 0u; idx < Length; idx++)
|
||||
{
|
||||
ADV_TRACE_Buffer[writepos] = pData[idx];
|
||||
writepos = (uint16_t) ((writepos + 1u) % UTIL_ADV_TRACE_FIFO_SIZE);
|
||||
}
|
||||
|
||||
TRACE_UnLock();
|
||||
ret = TRACE_Send();
|
||||
}
|
||||
else
|
||||
{
|
||||
TRACE_UnLock();
|
||||
ret = UTIL_ADV_TRACE_MEM_FULL;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
UTIL_ADV_TRACE_Status_t UTIL_ADV_TRACE_Send(const uint8_t *pData, uint16_t Length)
|
||||
{
|
||||
UTIL_ADV_TRACE_Status_t ret;
|
||||
uint16_t writepos;
|
||||
uint32_t idx;
|
||||
|
||||
TRACE_Lock();
|
||||
|
||||
/* if allocation is ok, write data into the buffer */
|
||||
if (TRACE_AllocateBufer(Length,&writepos) != -1)
|
||||
{
|
||||
/* initialize the Ptr for Read/Write */
|
||||
for (idx = 0u; idx < Length; idx++)
|
||||
{
|
||||
ADV_TRACE_Buffer[writepos] = pData[idx];
|
||||
writepos = (uint16_t) ((writepos + 1u) % UTIL_ADV_TRACE_FIFO_SIZE);
|
||||
}
|
||||
TRACE_UnLock();
|
||||
|
||||
ret = TRACE_Send();
|
||||
}
|
||||
else
|
||||
{
|
||||
TRACE_UnLock();
|
||||
ret = UTIL_ADV_TRACE_MEM_FULL;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if defined(UTIL_ADV_TRACE_OVERRUN)
|
||||
void UTIL_ADV_TRACE_RegisterOverRunFunction(cb_overrun *cb)
|
||||
{
|
||||
ADV_TRACE_Ctx.overrun_func = *cb;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(UTIL_ADV_TRACE_CONDITIONNAL)
|
||||
void UTIL_ADV_TRACE_RegisterTimeStampFunction(cb_timestamp *cb)
|
||||
{
|
||||
ADV_TRACE_Ctx.timestamp_func = *cb;
|
||||
}
|
||||
|
||||
void UTIL_ADV_TRACE_SetVerboseLevel(uint8_t Level)
|
||||
{
|
||||
ADV_TRACE_Ctx.CurrentVerboseLevel = Level;
|
||||
}
|
||||
|
||||
uint8_t UTIL_ADV_TRACE_GetVerboseLevel(void)
|
||||
{
|
||||
return ADV_TRACE_Ctx.CurrentVerboseLevel;
|
||||
}
|
||||
|
||||
void UTIL_ADV_TRACE_SetRegion(uint32_t Region)
|
||||
{
|
||||
ADV_TRACE_Ctx.RegionMask |= Region;
|
||||
}
|
||||
|
||||
uint32_t UTIL_ADV_TRACE_GetRegion(void)
|
||||
{
|
||||
return ADV_TRACE_Ctx.RegionMask;
|
||||
}
|
||||
|
||||
void UTIL_ADV_TRACE_ResetRegion(uint32_t Region)
|
||||
{
|
||||
ADV_TRACE_Ctx.RegionMask &= ~Region;
|
||||
}
|
||||
#endif
|
||||
|
||||
__WEAK void UTIL_ADV_TRACE_PreSendHook(void)
|
||||
{
|
||||
}
|
||||
|
||||
__WEAK void UTIL_ADV_TRACE_PostSendHook(void)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup ADV_TRACE_private_function
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief send the data of the trace to low layer
|
||||
* @retval Status based on @ref UTIL_ADV_TRACE_Status_t
|
||||
*/
|
||||
static UTIL_ADV_TRACE_Status_t TRACE_Send(void)
|
||||
{
|
||||
UTIL_ADV_TRACE_Status_t ret = UTIL_ADV_TRACE_OK;
|
||||
uint8_t *ptr = NULL;
|
||||
|
||||
UTIL_ADV_TRACE_ENTER_CRITICAL_SECTION();
|
||||
|
||||
if(TRACE_IsLocked() == 0u)
|
||||
{
|
||||
TRACE_Lock();
|
||||
|
||||
if(ADV_TRACE_Ctx.TraceRdPtr != ADV_TRACE_Ctx.TraceWrPtr)
|
||||
{
|
||||
#ifdef UTIL_ADV_TRACE_UNCHUNK_MODE
|
||||
if(TRACE_UNCHUNK_DETECTED == ADV_TRACE_Ctx.unchunk_status)
|
||||
{
|
||||
ADV_TRACE_Ctx.TraceSentSize = (uint16_t) (ADV_TRACE_Ctx.unchunk_enabled - ADV_TRACE_Ctx.TraceRdPtr);
|
||||
ADV_TRACE_Ctx.unchunk_status = TRACE_UNCHUNK_TRANSFER;
|
||||
ADV_TRACE_Ctx.unchunk_enabled = 0;
|
||||
|
||||
UTIL_ADV_TRACE_DEBUG("\nTRACE_TxCpltCallback::unchunk start(%d,%d)\n", ADV_TRACE_Ctx.unchunk_enabled, ADV_TRACE_Ctx.TraceRdPtr);
|
||||
|
||||
if(0u == ADV_TRACE_Ctx.TraceSentSize)
|
||||
{
|
||||
ADV_TRACE_Ctx.unchunk_status = TRACE_UNCHUNK_NONE;
|
||||
ADV_TRACE_Ctx.TraceRdPtr = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if(TRACE_UNCHUNK_NONE == ADV_TRACE_Ctx.unchunk_status)
|
||||
{
|
||||
#endif
|
||||
if(ADV_TRACE_Ctx.TraceWrPtr > ADV_TRACE_Ctx.TraceRdPtr)
|
||||
{
|
||||
ADV_TRACE_Ctx.TraceSentSize = ADV_TRACE_Ctx.TraceWrPtr - ADV_TRACE_Ctx.TraceRdPtr;
|
||||
}
|
||||
else /* TraceRdPtr > TraceWrPtr */
|
||||
{
|
||||
ADV_TRACE_Ctx.TraceSentSize = UTIL_ADV_TRACE_FIFO_SIZE - ADV_TRACE_Ctx.TraceRdPtr;
|
||||
|
||||
}
|
||||
#ifdef UTIL_ADV_TRACE_UNCHUNK_MODE
|
||||
}
|
||||
#endif
|
||||
ptr = &ADV_TRACE_Buffer[ADV_TRACE_Ctx.TraceRdPtr];
|
||||
|
||||
UTIL_ADV_TRACE_EXIT_CRITICAL_SECTION();
|
||||
UTIL_ADV_TRACE_PreSendHook();
|
||||
|
||||
UTIL_ADV_TRACE_DEBUG("\n--TRACE_Send(%d-%d)--\n", ADV_TRACE_Ctx.TraceRdPtr, ADV_TRACE_Ctx.TraceSentSize);
|
||||
ret = UTIL_TraceDriver.Send(ptr, ADV_TRACE_Ctx.TraceSentSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
TRACE_UnLock();
|
||||
UTIL_ADV_TRACE_EXIT_CRITICAL_SECTION();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
UTIL_ADV_TRACE_EXIT_CRITICAL_SECTION();
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Tx callback called by the low layer level to inform a transfer complete
|
||||
* @param Ptr pointer not used only for HAL compatibility
|
||||
* @retval none
|
||||
*/
|
||||
static void TRACE_TxCpltCallback(void *Ptr)
|
||||
{
|
||||
uint8_t *ptr = NULL;
|
||||
UTIL_ADV_TRACE_ENTER_CRITICAL_SECTION();
|
||||
|
||||
#if defined(UTIL_ADV_TRACE_OVERRUN)
|
||||
if(ADV_TRACE_Ctx.OverRunStatus == TRACE_OVERRUN_TRANSFERT)
|
||||
{
|
||||
ADV_TRACE_Ctx.OverRunStatus = TRACE_OVERRUN_EXECUTED;
|
||||
UTIL_ADV_TRACE_DEBUG("\n--TRACE_Send overrun complete--\n");
|
||||
ADV_TRACE_Ctx.TraceSentSize = 0u;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(UTIL_ADV_TRACE_UNCHUNK_MODE)
|
||||
if(TRACE_UNCHUNK_TRANSFER == ADV_TRACE_Ctx.unchunk_status)
|
||||
{
|
||||
ADV_TRACE_Ctx.unchunk_status = TRACE_UNCHUNK_NONE;
|
||||
ADV_TRACE_Ctx.TraceRdPtr = 0;
|
||||
UTIL_ADV_TRACE_DEBUG("\nTRACE_TxCpltCallback::unchunk complete\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
ADV_TRACE_Ctx.TraceRdPtr = (ADV_TRACE_Ctx.TraceRdPtr + ADV_TRACE_Ctx.TraceSentSize) % UTIL_ADV_TRACE_FIFO_SIZE;
|
||||
}
|
||||
#else
|
||||
ADV_TRACE_Ctx.TraceRdPtr = (ADV_TRACE_Ctx.TraceRdPtr + ADV_TRACE_Ctx.TraceSentSize) % UTIL_ADV_TRACE_FIFO_SIZE;
|
||||
#endif
|
||||
|
||||
#if defined(UTIL_ADV_TRACE_OVERRUN)
|
||||
if(ADV_TRACE_Ctx.OverRunStatus == TRACE_OVERRUN_INDICATION)
|
||||
{
|
||||
uint8_t *ptr = NULL;
|
||||
ADV_TRACE_Ctx.OverRunStatus = TRACE_OVERRUN_TRANSFERT;
|
||||
UTIL_ADV_TRACE_EXIT_CRITICAL_SECTION();
|
||||
ADV_TRACE_Ctx.overrun_func(&ptr, &ADV_TRACE_Ctx.TraceSentSize);
|
||||
UTIL_ADV_TRACE_DEBUG("\n--Driver_Send overrun(%d)--\n", ADV_TRACE_Ctx.TraceSentSize);
|
||||
UTIL_TraceDriver.Send(ptr, ADV_TRACE_Ctx.TraceSentSize);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if((ADV_TRACE_Ctx.TraceRdPtr != ADV_TRACE_Ctx.TraceWrPtr) && (1u == ADV_TRACE_Ctx.TraceLock))
|
||||
{
|
||||
#ifdef UTIL_ADV_TRACE_UNCHUNK_MODE
|
||||
if(TRACE_UNCHUNK_DETECTED == ADV_TRACE_Ctx.unchunk_status)
|
||||
{
|
||||
ADV_TRACE_Ctx.TraceSentSize = ADV_TRACE_Ctx.unchunk_enabled - ADV_TRACE_Ctx.TraceRdPtr;
|
||||
ADV_TRACE_Ctx.unchunk_status = TRACE_UNCHUNK_TRANSFER;
|
||||
ADV_TRACE_Ctx.unchunk_enabled = 0;
|
||||
|
||||
UTIL_ADV_TRACE_DEBUG("\nTRACE_TxCpltCallback::unchunk start(%d,%d)\n", ADV_TRACE_Ctx.unchunk_enabled, ADV_TRACE_Ctx.TraceRdPtr);
|
||||
|
||||
if(0u == ADV_TRACE_Ctx.TraceSentSize)
|
||||
{
|
||||
/* this case occurs when an ongoing write aligned the Rd position with chunk position */
|
||||
/* in that case the unchunk is forgot */
|
||||
ADV_TRACE_Ctx.unchunk_status = TRACE_UNCHUNK_NONE;
|
||||
ADV_TRACE_Ctx.TraceRdPtr = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if(TRACE_UNCHUNK_NONE == ADV_TRACE_Ctx.unchunk_status)
|
||||
{
|
||||
#endif
|
||||
if(ADV_TRACE_Ctx.TraceWrPtr > ADV_TRACE_Ctx.TraceRdPtr)
|
||||
{
|
||||
ADV_TRACE_Ctx.TraceSentSize = ADV_TRACE_Ctx.TraceWrPtr - ADV_TRACE_Ctx.TraceRdPtr;
|
||||
}
|
||||
else /* TraceRdPtr > TraceWrPtr */
|
||||
{
|
||||
ADV_TRACE_Ctx.TraceSentSize = UTIL_ADV_TRACE_FIFO_SIZE - ADV_TRACE_Ctx.TraceRdPtr;
|
||||
}
|
||||
#ifdef UTIL_ADV_TRACE_UNCHUNK_MODE
|
||||
}
|
||||
#endif
|
||||
ptr = &ADV_TRACE_Buffer[ADV_TRACE_Ctx.TraceRdPtr];
|
||||
UTIL_ADV_TRACE_EXIT_CRITICAL_SECTION();
|
||||
UTIL_ADV_TRACE_DEBUG("\n--TRACE_Send(%d-%d)--\n", ADV_TRACE_Ctx.TraceRdPtr, ADV_TRACE_Ctx.TraceSentSize);
|
||||
UTIL_TraceDriver.Send(ptr, ADV_TRACE_Ctx.TraceSentSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
UTIL_ADV_TRACE_EXIT_CRITICAL_SECTION();
|
||||
UTIL_ADV_TRACE_PostSendHook();
|
||||
TRACE_UnLock();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief allocate space inside the buffer to push data
|
||||
* @param Size to allocate within fifo
|
||||
* @param Pos position within the fifo
|
||||
* @retval write position inside the buffer is -1 no space available.
|
||||
*/
|
||||
static int16_t TRACE_AllocateBufer(uint16_t Size, uint16_t *Pos)
|
||||
{
|
||||
uint16_t freesize;
|
||||
int16_t ret = -1;
|
||||
|
||||
UTIL_ADV_TRACE_ENTER_CRITICAL_SECTION();
|
||||
|
||||
if(ADV_TRACE_Ctx.TraceWrPtr == ADV_TRACE_Ctx.TraceRdPtr)
|
||||
{
|
||||
#ifdef UTIL_ADV_TRACE_UNCHUNK_MODE
|
||||
freesize = (uint16_t)(UTIL_ADV_TRACE_FIFO_SIZE - ADV_TRACE_Ctx.TraceWrPtr);
|
||||
if((Size >= freesize) && (ADV_TRACE_Ctx.TraceRdPtr > Size))
|
||||
{
|
||||
ADV_TRACE_Ctx.unchunk_status = TRACE_UNCHUNK_DETECTED;
|
||||
ADV_TRACE_Ctx.unchunk_enabled = ADV_TRACE_Ctx.TraceWrPtr;
|
||||
freesize = ADV_TRACE_Ctx.TraceRdPtr;
|
||||
ADV_TRACE_Ctx.TraceWrPtr = 0;
|
||||
}
|
||||
#else
|
||||
/* need to add buffer full management*/
|
||||
freesize = (int16_t)UTIL_ADV_TRACE_FIFO_SIZE;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef UTIL_ADV_TRACE_UNCHUNK_MODE
|
||||
if (ADV_TRACE_Ctx.TraceWrPtr > ADV_TRACE_Ctx.TraceRdPtr)
|
||||
{
|
||||
freesize = (uint16_t)(UTIL_ADV_TRACE_FIFO_SIZE - ADV_TRACE_Ctx.TraceWrPtr);
|
||||
if((Size >= freesize) && (ADV_TRACE_Ctx.TraceRdPtr > Size))
|
||||
{
|
||||
ADV_TRACE_Ctx.unchunk_status = TRACE_UNCHUNK_DETECTED;
|
||||
ADV_TRACE_Ctx.unchunk_enabled = ADV_TRACE_Ctx.TraceWrPtr;
|
||||
freesize = ADV_TRACE_Ctx.TraceRdPtr;
|
||||
ADV_TRACE_Ctx.TraceWrPtr = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
freesize = (uint16_t)(ADV_TRACE_Ctx.TraceRdPtr - ADV_TRACE_Ctx.TraceWrPtr);
|
||||
}
|
||||
#else
|
||||
if (ADV_TRACE_Ctx.TraceWrPtr > ADV_TRACE_Ctx.TraceRdPtr)
|
||||
{
|
||||
freesize = UTIL_ADV_TRACE_FIFO_SIZE - ADV_TRACE_Ctx.TraceWrPtr + ADV_TRACE_Ctx.TraceRdPtr;
|
||||
}
|
||||
else
|
||||
{
|
||||
freesize = ADV_TRACE_Ctx.TraceRdPtr - ADV_TRACE_Ctx.TraceWrPtr;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if(freesize > Size)
|
||||
{
|
||||
*Pos = ADV_TRACE_Ctx.TraceWrPtr;
|
||||
ADV_TRACE_Ctx.TraceWrPtr = (ADV_TRACE_Ctx.TraceWrPtr + Size) % UTIL_ADV_TRACE_FIFO_SIZE;
|
||||
ret = 0;
|
||||
#if defined(UTIL_ADV_TRACE_OVERRUN)
|
||||
if(ADV_TRACE_Ctx.OverRunStatus == TRACE_OVERRUN_EXECUTED)
|
||||
{
|
||||
/* clear the over run */
|
||||
ADV_TRACE_Ctx.OverRunStatus = TRACE_OVERRUN_NONE;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef UTIL_ADV_TRACE_UNCHUNK_MODE
|
||||
UTIL_ADV_TRACE_DEBUG("\n--TRACE_AllocateBufer(%d-%d-%d::%d-%d)--\n", freesize - Size, Size, ADV_TRACE_Ctx.unchunk_enabled, ADV_TRACE_Ctx.TraceRdPtr, ADV_TRACE_Ctx.TraceWrPtr);
|
||||
#else
|
||||
UTIL_ADV_TRACE_DEBUG("\n--TRACE_AllocateBufer(%d-%d::%d-%d)--\n",freesize - Size, Size, ADV_TRACE_Ctx.TraceRdPtr, ADV_TRACE_Ctx.TraceWrPtr);
|
||||
#endif
|
||||
}
|
||||
#if defined(UTIL_ADV_TRACE_OVERRUN)
|
||||
else
|
||||
{
|
||||
if((ADV_TRACE_Ctx.OverRunStatus == TRACE_OVERRUN_NONE) && (NULL != ADV_TRACE_Ctx.overrun_func))
|
||||
{
|
||||
UTIL_ADV_TRACE_DEBUG(":TRACE_OVERRUN_INDICATION");
|
||||
ADV_TRACE_Ctx.OverRunStatus = TRACE_OVERRUN_INDICATION;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
UTIL_ADV_TRACE_EXIT_CRITICAL_SECTION();
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Lock the trace buffer.
|
||||
* @retval None.
|
||||
*/
|
||||
static void TRACE_Lock(void)
|
||||
{
|
||||
UTIL_ADV_TRACE_ENTER_CRITICAL_SECTION();
|
||||
ADV_TRACE_Ctx.TraceLock++;
|
||||
UTIL_ADV_TRACE_EXIT_CRITICAL_SECTION();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief UnLock the trace buffer.
|
||||
* @retval None.
|
||||
*/
|
||||
static void TRACE_UnLock(void)
|
||||
{
|
||||
UTIL_ADV_TRACE_ENTER_CRITICAL_SECTION();
|
||||
ADV_TRACE_Ctx.TraceLock--;
|
||||
UTIL_ADV_TRACE_EXIT_CRITICAL_SECTION();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief UnLock the trace buffer.
|
||||
* @retval None.
|
||||
*/
|
||||
static uint32_t TRACE_IsLocked(void)
|
||||
{
|
||||
return (ADV_TRACE_Ctx.TraceLock == 0u? 0u: 1u);
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
273
Utilities/trace/adv_trace/stm32_adv_trace.h
Normal file
273
Utilities/trace/adv_trace/stm32_adv_trace.h
Normal file
@@ -0,0 +1,273 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file stm32_adv_trace.h
|
||||
* @author MCD Application Team
|
||||
* @brief Header for stm32_adv_trace.c
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2019 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software is licensed under terms that can be found in the LICENSE file
|
||||
* in the root directory of this software component.
|
||||
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __ADV_TRACE_H
|
||||
#define __ADV_TRACE_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stdint.h"
|
||||
#include "utilities_conf.h"
|
||||
|
||||
/** @defgroup ADV_TRACE advanced tracer
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/** @defgroup ADV_TRACE_exported_TypeDef ADV_TRACE exported Typedef
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief prototype of the time stamp function.
|
||||
*/
|
||||
typedef void cb_timestamp(uint8_t *pData, uint16_t *Size);
|
||||
|
||||
/**
|
||||
* @brief prototype of the overrun function.
|
||||
*/
|
||||
typedef void cb_overrun(uint8_t **pData, uint16_t *size);
|
||||
/**
|
||||
* @brief List the Advanced trace function status.
|
||||
* list of the returned status value, any negative value is corresponding to an error.
|
||||
*/
|
||||
typedef enum{
|
||||
UTIL_ADV_TRACE_OK = 0, /*!< Operation terminated successfully.*/
|
||||
UTIL_ADV_TRACE_INVALID_PARAM = -1, /*!< Invalid Parameter. */
|
||||
UTIL_ADV_TRACE_HW_ERROR = -2, /*!< Hardware Error. */
|
||||
UTIL_ADV_TRACE_MEM_FULL = -3, /*!< Memory fifo full. */
|
||||
UTIL_ADV_TRACE_UNKNOWN_ERROR = -4, /*!< Unknown Error. */
|
||||
#if defined(UTIL_ADV_TRACE_CONDITIONNAL)
|
||||
UTIL_ADV_TRACE_GIVEUP = -5, /*!< trace give up */
|
||||
UTIL_ADV_TRACE_REGIONMASKED = -6 /*!< trace region masked */
|
||||
#endif
|
||||
} UTIL_ADV_TRACE_Status_t;
|
||||
|
||||
/**
|
||||
* @brief Advanced trace driver definition
|
||||
*/
|
||||
typedef struct {
|
||||
UTIL_ADV_TRACE_Status_t (* Init)(void (*cb)(void *ptr)); /*!< Media initialization. */
|
||||
UTIL_ADV_TRACE_Status_t (* DeInit)(void); /*!< Media Un-initialization. */
|
||||
UTIL_ADV_TRACE_Status_t (* StartRx)(void (*cb)(uint8_t *pdata, uint16_t size, uint8_t error)); /*!< Media to start RX process. */
|
||||
UTIL_ADV_TRACE_Status_t (* Send)(uint8_t *pdata, uint16_t size); /*!< Media to send data. */
|
||||
}UTIL_ADV_TRACE_Driver_s;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* External variables --------------------------------------------------------*/
|
||||
/** @defgroup ADV_TRACE_exported_variables ADV_TRACE exported variables
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @brief This structure is the linked with the IF layer implementation.
|
||||
*/
|
||||
extern const UTIL_ADV_TRACE_Driver_s UTIL_TraceDriver;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
/* Exported macros -----------------------------------------------------------*/
|
||||
/* Exported functions ------------------------------------------------------- */
|
||||
/** @defgroup ADV_TRACE_exported_function ADV_TRACE exported function
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief TraceInit Initializes Logging feature
|
||||
* @retval Status based on @ref UTIL_ADV_TRACE_Status_t
|
||||
*/
|
||||
UTIL_ADV_TRACE_Status_t UTIL_ADV_TRACE_Init(void);
|
||||
|
||||
/**
|
||||
* @brief TraceDeInit module DeInitializes.
|
||||
* @retval Status based on @ref UTIL_ADV_TRACE_Status_t
|
||||
*/
|
||||
UTIL_ADV_TRACE_Status_t UTIL_ADV_TRACE_DeInit(void);
|
||||
|
||||
/**
|
||||
* @brief this function check if the buffer is empty.
|
||||
* @retval 1 if the buffer is empty else 0
|
||||
*/
|
||||
uint8_t UTIL_ADV_TRACE_IsBufferEmpty(void);
|
||||
|
||||
/**
|
||||
* @brief start the RX process.
|
||||
* @param UserCallback ptr function used to get the RX data
|
||||
* @retval Status based on @ref UTIL_ADV_TRACE_Status_t
|
||||
*/
|
||||
UTIL_ADV_TRACE_Status_t UTIL_ADV_TRACE_StartRxProcess(void (*UserCallback)(uint8_t *PData, uint16_t Size, uint8_t Error));
|
||||
|
||||
/**
|
||||
* @brief TraceSend decode the strFormat and post it to the circular queue for printing
|
||||
* @param strFormat Trace message and format
|
||||
* @retval Status based on @ref UTIL_ADV_TRACE_Status_t
|
||||
*/
|
||||
UTIL_ADV_TRACE_Status_t UTIL_ADV_TRACE_FSend(const char *strFormat, ...);
|
||||
|
||||
/**
|
||||
* @brief post data to the circular queue
|
||||
* @param *pdata pointer to Data
|
||||
* @param length length of data buffer to be sent
|
||||
* @retval Status based on @ref UTIL_ADV_TRACE_Status_t
|
||||
*/
|
||||
UTIL_ADV_TRACE_Status_t UTIL_ADV_TRACE_Send(const uint8_t *pdata, uint16_t length);
|
||||
|
||||
/**
|
||||
* @brief ZCSend_Allocation allocate the memory and return information to write the data
|
||||
* @param Length trase size
|
||||
* @param pData pointer on the fifo
|
||||
* @param FifoSize size of the fifo
|
||||
* @param WritePos write position of the fifo
|
||||
* @retval Status based on @ref UTIL_ADV_TRACE_Status_t
|
||||
*/
|
||||
UTIL_ADV_TRACE_Status_t UTIL_ADV_TRACE_ZCSend_Allocation(uint16_t Length, uint8_t **pData, uint16_t *FifoSize, uint16_t *WritePos);
|
||||
|
||||
/**
|
||||
* @brief ZCSend finalize the data transfer
|
||||
* @retval Status based on @ref UTIL_ADV_TRACE_Status_t
|
||||
*/
|
||||
UTIL_ADV_TRACE_Status_t UTIL_ADV_TRACE_ZCSend_Finalize(void);
|
||||
/**
|
||||
* @brief Trace send started hook
|
||||
* @retval None
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Trace send pre hook function
|
||||
*/
|
||||
void UTIL_ADV_TRACE_PreSendHook(void);
|
||||
|
||||
/**
|
||||
* @brief Trace send post hook function
|
||||
*/
|
||||
void UTIL_ADV_TRACE_PostSendHook(void);
|
||||
|
||||
#if defined(UTIL_ADV_TRACE_OVERRUN)
|
||||
/**
|
||||
* @brief Register a function used to add overrun info inside the trace
|
||||
* @param cb pointer of function to return overrun information
|
||||
*/
|
||||
void UTIL_ADV_TRACE_RegisterOverRunFunction(cb_overrun *cb);
|
||||
#endif
|
||||
|
||||
#if defined(UTIL_ADV_TRACE_CONDITIONNAL)
|
||||
|
||||
/**
|
||||
* @brief conditional FSend decode the strFormat and post it to the circular queue for printing
|
||||
* @param VerboseLevel verbose level of the trace
|
||||
* @param Region region of the trace
|
||||
* @param TimeStampState 0 no time stamp insertion, 1 time stamp inserted inside the trace data
|
||||
* @param strFormat formatted string
|
||||
* @retval Status based on @ref UTIL_ADV_TRACE_Status_t
|
||||
*/
|
||||
UTIL_ADV_TRACE_Status_t UTIL_ADV_TRACE_COND_FSend(uint32_t VerboseLevel, uint32_t Region,uint32_t TimeStampState, const char *strFormat, ...);
|
||||
|
||||
/**
|
||||
* @brief conditional ZCSend Write user formatted data directly in the FIFO (Z-Cpy)
|
||||
* @param VerboseLevel verbose level of the trace
|
||||
* @param Region region of the trace
|
||||
* @param TimeStampState 0 no time stamp insertion, 1 time stamp inserted inside the trace data
|
||||
* @param length data length
|
||||
* @param pData pointer on the fifo
|
||||
* @param FifoSize size of the fifo
|
||||
* @param WritePos write position of the fifo
|
||||
* @retval Status based on @ref UTIL_ADV_TRACE_Status_t
|
||||
*/
|
||||
UTIL_ADV_TRACE_Status_t UTIL_ADV_TRACE_COND_ZCSend_Allocation(uint32_t VerboseLevel, uint32_t Region, uint32_t TimeStampState, uint16_t length,uint8_t **pData, uint16_t *FifoSize, uint16_t *WritePos);
|
||||
|
||||
/**
|
||||
* @brief conditional ZCSend finalize the data transfer
|
||||
* @retval Status based on @ref UTIL_ADV_TRACE_Status_t
|
||||
*/
|
||||
UTIL_ADV_TRACE_Status_t UTIL_ADV_TRACE_COND_ZCSend_Finalize(void);
|
||||
|
||||
/**
|
||||
* @brief confitionnal Send post data to the circular queue
|
||||
* @param VerboseLevel verbose level of the trace
|
||||
* @param Region region of the trace
|
||||
* @param TimeStampState 0 no time stamp insertion, 1 time stamp inserted inside the trace data
|
||||
* @param *pdata pointer to Data
|
||||
* @param length length of data buffer ro be sent
|
||||
* @retval Status based on @ref UTIL_ADV_TRACE_Status_t
|
||||
*/
|
||||
UTIL_ADV_TRACE_Status_t UTIL_ADV_TRACE_COND_Send(uint32_t VerboseLevel, uint32_t Region, uint32_t TimeStampState, const uint8_t *pdata, uint16_t length);
|
||||
|
||||
/**
|
||||
* @brief Register a function used to add timestamp inside the trace
|
||||
* @param cb pointer of function to return timestamp information
|
||||
*/
|
||||
void UTIL_ADV_TRACE_RegisterTimeStampFunction(cb_timestamp *cb);
|
||||
|
||||
/**
|
||||
* @brief Set the verbose level
|
||||
* @param Level (0 to 255)
|
||||
* @retval None
|
||||
*/
|
||||
void UTIL_ADV_TRACE_SetVerboseLevel(uint8_t Level);
|
||||
|
||||
/**
|
||||
* @brief Get the verbose level
|
||||
* @retval verbose level
|
||||
*/
|
||||
uint8_t UTIL_ADV_TRACE_GetVerboseLevel(void);
|
||||
|
||||
/**
|
||||
* @brief add to the mask a bit field region.
|
||||
* @param Region bit field of region to enable
|
||||
* @retval None
|
||||
*/
|
||||
void UTIL_ADV_TRACE_SetRegion(uint32_t Region);
|
||||
|
||||
/**
|
||||
* @brief add to the mask a bit field region.
|
||||
* @retval None
|
||||
*/
|
||||
uint32_t UTIL_ADV_TRACE_GetRegion(void);
|
||||
|
||||
/**
|
||||
* @brief remove from the mask a bit field region.
|
||||
* @param Region Region bit field of region to disable
|
||||
* @retval None
|
||||
*/
|
||||
void UTIL_ADV_TRACE_ResetRegion(uint32_t Region);
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /*__ADV_TRACE_H */
|
||||
Reference in New Issue
Block a user