segger: update to 3.40

Update to 3.40 of SystemView Target sources.

Signed-off-by: Sigvart Hovland <sigvart.hovland@nordicsemi.no>
This commit is contained in:
Sigvart Hovland 2022-12-21 14:34:46 +01:00 committed by Carles Cufí
parent 4bfaf28a11
commit 5792675a24
16 changed files with 678 additions and 239 deletions

View File

@ -42,7 +42,7 @@
* *
**********************************************************************
* *
* SystemView version: 3.30 *
* SystemView version: 3.40 *
* *
**********************************************************************
----------------------------------------------------------------------

View File

@ -42,7 +42,7 @@
* *
**********************************************************************
* *
* SystemView version: 3.30 *
* SystemView version: 3.40 *
* *
**********************************************************************
---------------------------END-OF-HEADER------------------------------
@ -50,7 +50,7 @@ File : SEGGER_RTT_Conf.h
Purpose : Implementation of SEGGER real-time transfer (RTT) which
allows real-time communication on targets which support
debugger memory accesses while the CPU is running.
Revision: $Rev: 21386 $
Revision: $Rev: 24316 $
*/
@ -96,6 +96,8 @@ Revision: $Rev: 21386 $
#if defined(CONFIG_SEGGER_RTT_SECTION_DTCM)
#define SEGGER_RTT_SECTION ".dtcm_data"
#elif defined(CONFIG_SEGGER_RTT_SECTION_CUSTOM)
#define SEGGER_RTT_SECTION CONFIG_SEGGER_RTT_SECTION_CUSTOM_NAME
#endif
/*********************************************************************
@ -113,7 +115,9 @@ Revision: $Rev: 21386 $
#if defined(CONFIG_SEGGER_RTT_MEMCPY_USE_BYTELOOP)
#define SEGGER_RTT_MEMCPY_USE_BYTELOOP 1 // 1: Use a simple byte-loop
#else
#ifndef SEGGER_RTT_MEMCPY_USE_BYTELOOP
#define SEGGER_RTT_MEMCPY_USE_BYTELOOP 0 // 0: Use memcpy/SEGGER_RTT_MEMCPY
#endif
#endif
//
// Example definition of SEGGER_RTT_MEMCPY to external memcpy with GCC toolchains and Cortex-A targets
@ -146,22 +150,22 @@ Revision: $Rev: 21386 $
* Rowley CrossStudio and GCC
*/
#if ((defined(__SES_ARM) || defined(__SES_RISCV) || defined(__CROSSWORKS_ARM) || defined(__GNUC__) || defined(__clang__)) && !defined (__CC_ARM) && !defined(WIN32))
#if defined(__ZEPHYR__) && defined (CONFIG_SEGGER_RTT_CUSTOM_LOCKING)
#ifdef CONFIG_MULTITHREADING
extern void zephyr_rtt_mutex_lock(void);
extern void zephyr_rtt_mutex_unlock(void);
#define SEGGER_RTT_LOCK() zephyr_rtt_mutex_lock()
#define SEGGER_RTT_UNLOCK() zephyr_rtt_mutex_unlock()
#else
extern unsigned int zephyr_rtt_irq_lock(void);
extern void zephyr_rtt_irq_unlock(unsigned int key);
#define SEGGER_RTT_LOCK() { \
unsigned int key = zephyr_rtt_irq_lock()
#define SEGGER_RTT_UNLOCK() zephyr_rtt_irq_unlock(key); \
}
#endif
#define RTT_USE_ASM 0
#elif (defined(__ARM_ARCH_6M__) || defined(__ARM_ARCH_8M_BASE__))
#if defined(__ZEPHYR__) && defined (CONFIG_SEGGER_RTT_CUSTOM_LOCKING)
#ifdef CONFIG_MULTITHREADING
extern void zephyr_rtt_mutex_lock(void);
extern void zephyr_rtt_mutex_unlock(void);
#define SEGGER_RTT_LOCK() zephyr_rtt_mutex_lock()
#define SEGGER_RTT_UNLOCK() zephyr_rtt_mutex_unlock()
#else
extern unsigned int zephyr_rtt_irq_lock(void);
extern void zephyr_rtt_irq_unlock(unsigned int key);
#define SEGGER_RTT_LOCK() { \
unsigned int key = zephyr_rtt_irq_lock()
#define SEGGER_RTT_UNLOCK() zephyr_rtt_irq_unlock(key); \
}
#endif
#define RTT_USE_ASM 0
#elif (defined(__ARM_ARCH_6M__) || defined(__ARM_ARCH_8M_BASE__))
#define SEGGER_RTT_LOCK() { \
unsigned int _SEGGER_RTT__LockState; \
__asm volatile ("mrs %0, primask \n\t" \
@ -199,7 +203,7 @@ Revision: $Rev: 21386 $
); \
}
#elif defined(__ARM_ARCH_7A__)
#elif (defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7R__))
#define SEGGER_RTT_LOCK() { \
unsigned int _SEGGER_RTT__LockState; \
__asm volatile ("mrs r1, CPSR \n\t" \

View File

@ -0,0 +1,85 @@
/*********************************************************************
* SEGGER Microcontroller GmbH *
* The Embedded Experts *
**********************************************************************
* *
* (c) 1995 - 2021 SEGGER Microcontroller GmbH *
* *
* www.segger.com Support: support@segger.com *
* *
**********************************************************************
* *
* SEGGER SystemView * Real-time application analysis *
* *
**********************************************************************
* *
* All rights reserved. *
* *
* SEGGER strongly recommends to not make any changes *
* to or modify the source code of this software in order to stay *
* compatible with the SystemView and RTT protocol, and J-Link. *
* *
* Redistribution and use in source and binary forms, with or *
* without modification, are permitted provided that the following *
* condition is met: *
* *
* o Redistributions of source code must retain the above copyright *
* notice, this condition and the following disclaimer. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND *
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, *
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF *
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
* DISCLAIMED. IN NO EVENT SHALL SEGGER Microcontroller BE LIABLE FOR *
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR *
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT *
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; *
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE *
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH *
* DAMAGE. *
* *
**********************************************************************
* *
* SystemView version: 3.40 *
* *
**********************************************************************
-------------------------- END-OF-HEADER -----------------------------
File : SEGGER_SYSVIEW_Conf.h
Purpose : SEGGER SystemView configuration file.
Set defines which deviate from the defaults (see SEGGER_SYSVIEW_ConfDefaults.h) here.
Revision: $Rev: 21292 $
Additional information:
Required defines which must be set are:
SEGGER_SYSVIEW_GET_TIMESTAMP
SEGGER_SYSVIEW_GET_INTERRUPT_ID
For known compilers and cores, these might be set to good defaults
in SEGGER_SYSVIEW_ConfDefaults.h.
SystemView needs a (nestable) locking mechanism.
If not defined, the RTT locking mechanism is used,
which then needs to be properly configured.
*/
#ifndef SEGGER_SYSVIEW_CONF_H
#define SEGGER_SYSVIEW_CONF_H
/*********************************************************************
*
* Defines, configurable
*
**********************************************************************
*/
/*********************************************************************
* TODO: Add your defines here. *
**********************************************************************
*/
#endif // SEGGER_SYSVIEW_CONF_H
/*************************** End of file ****************************/

View File

@ -97,7 +97,6 @@ Purpose : Implementation of debug monitor for J-Link monitor mode debug on Corte
**********************************************************************
*/
/*********************************************************************
*
* JLINK_MONITOR_OnExit()
@ -127,8 +126,8 @@ void JLINK_MONITOR_OnExit(void) {
* Notes
* (1) Must not keep the CPU busy for more than 100 ms
*/
void JLINK_MONITOR_OnEnter(void) {
//
// Add custom code here
//
// BSP_SetLED(0);
@ -145,8 +144,12 @@ void JLINK_MONITOR_OnEnter(void) {
* Notes
* (1) Must not keep the CPU busy for more than 100 ms
*/
void JLINK_MONITOR_OnPoll(void) {
//
// Add custom code here
//
// BSP_ToggleLED(0);
// _Delay(500000);
}
/****** End Of File *************************************************/

View File

@ -42,13 +42,13 @@
* *
**********************************************************************
* *
* SystemView version: 3.30 *
* SystemView version: 3.40 *
* *
**********************************************************************
----------------------------------------------------------------------
File : SEGGER.h
Purpose : Global types etc & general purpose utility functions
Revision: $Rev: 18102 $
Revision: $Rev: 18102 $
---------------------------END-OF-HEADER------------------------------
*/

View File

@ -42,7 +42,7 @@
* *
**********************************************************************
* *
* SystemView version: 3.30 *
* SystemView version: 3.40 *
* *
**********************************************************************
---------------------------END-OF-HEADER------------------------------
@ -50,7 +50,7 @@ File : SEGGER_RTT.c
Purpose : Implementation of SEGGER real-time transfer (RTT) which
allows real-time communication on targets which support
debugger memory accesses while the CPU is running.
Revision: $Rev: 22333 $
Revision: $Rev: 28168 $
Additional information:
Type "int" is assumed to be 32-bits in size
@ -192,7 +192,7 @@ Additional information:
#endif
#if SEGGER_RTT_ALIGNMENT || SEGGER_RTT_BUFFER_ALIGNMENT
#if (defined __GNUC__)
#if ((defined __GNUC__) || (defined __clang__))
#define SEGGER_RTT_ALIGN(Var, Alignment) Var __attribute__ ((aligned (Alignment)))
#elif (defined __ICCARM__) || (defined __ICCRX__)
#define PRAGMA(A) _Pragma(#A)
@ -208,7 +208,7 @@ Additional information:
#endif
#if defined(SEGGER_RTT_SECTION) || defined (SEGGER_RTT_BUFFER_SECTION)
#if (defined __GNUC__)
#if ((defined __GNUC__) || (defined __clang__))
#define SEGGER_RTT_PUT_SECTION(Var, Section) __attribute__ ((section (Section))) Var
#elif (defined __ICCARM__) || (defined __ICCRX__)
#define SEGGER_RTT_PUT_SECTION(Var, Section) RTT_PRAGMA(location=Section) \
@ -266,9 +266,26 @@ static unsigned char _aTerminalId[16] = { '0', '1', '2', '3', '4', '5', '6', '7'
//
// RTT Control Block and allocate buffers for channel 0
//
SEGGER_RTT_PUT_CB_SECTION(SEGGER_RTT_CB_ALIGN(SEGGER_RTT_CB _SEGGER_RTT));
SEGGER_RTT_PUT_BUFFER_SECTION(SEGGER_RTT_BUFFER_ALIGN(static char _acUpBuffer [SEGGER_RTT__ROUND_UP_2_CACHE_LINE_SIZE(BUFFER_SIZE_UP)]));
SEGGER_RTT_PUT_BUFFER_SECTION(SEGGER_RTT_BUFFER_ALIGN(static char _acDownBuffer[SEGGER_RTT__ROUND_UP_2_CACHE_LINE_SIZE(BUFFER_SIZE_DOWN)]));
#if SEGGER_RTT_CPU_CACHE_LINE_SIZE
#if ((defined __GNUC__) || (defined __clang__))
SEGGER_RTT_CB _SEGGER_RTT __attribute__ ((aligned (SEGGER_RTT_CPU_CACHE_LINE_SIZE)));
static char _acUpBuffer [SEGGER_RTT__ROUND_UP_2_CACHE_LINE_SIZE(BUFFER_SIZE_UP)] __attribute__ ((aligned (SEGGER_RTT_CPU_CACHE_LINE_SIZE)));
static char _acDownBuffer[SEGGER_RTT__ROUND_UP_2_CACHE_LINE_SIZE(BUFFER_SIZE_DOWN)] __attribute__ ((aligned (SEGGER_RTT_CPU_CACHE_LINE_SIZE)));
#elif (defined __ICCARM__)
#pragma data_alignment=SEGGER_RTT_CPU_CACHE_LINE_SIZE
SEGGER_RTT_CB _SEGGER_RTT;
#pragma data_alignment=SEGGER_RTT_CPU_CACHE_LINE_SIZE
static char _acUpBuffer [SEGGER_RTT__ROUND_UP_2_CACHE_LINE_SIZE(BUFFER_SIZE_UP)];
#pragma data_alignment=SEGGER_RTT_CPU_CACHE_LINE_SIZE
static char _acDownBuffer[SEGGER_RTT__ROUND_UP_2_CACHE_LINE_SIZE(BUFFER_SIZE_DOWN)];
#else
#error "Don't know how to place _SEGGER_RTT, _acUpBuffer, _acDownBuffer cache-line aligned"
#endif
#else
SEGGER_RTT_PUT_CB_SECTION(SEGGER_RTT_CB_ALIGN(SEGGER_RTT_CB _SEGGER_RTT));
SEGGER_RTT_PUT_BUFFER_SECTION(SEGGER_RTT_BUFFER_ALIGN(static char _acUpBuffer [BUFFER_SIZE_UP]));
SEGGER_RTT_PUT_BUFFER_SECTION(SEGGER_RTT_BUFFER_ALIGN(static char _acDownBuffer[BUFFER_SIZE_DOWN]));
#endif
static unsigned char _ActiveTerminal;
@ -300,10 +317,13 @@ static unsigned char _ActiveTerminal;
static void _DoInit(void) {
volatile SEGGER_RTT_CB* p; // Volatile to make sure that compiler cannot change the order of accesses to the control block
static const char _aInitStr[] = "\0\0\0\0\0\0TTR REGGES"; // Init complete ID string to make sure that things also work if RTT is linked to a no-init memory area
unsigned i;
//
// Initialize control block
//
p = (volatile SEGGER_RTT_CB*)((char*)&_SEGGER_RTT + SEGGER_RTT_UNCACHED_OFF); // Access control block uncached so that nothing in the cache ever becomes dirty and all changes are visible in HW directly
memset((SEGGER_RTT_CB*)p, 0, sizeof(_SEGGER_RTT)); // Make sure that the RTT CB is always zero initialized.
p->MaxNumUpBuffers = SEGGER_RTT_MAX_NUM_UP_BUFFERS;
p->MaxNumDownBuffers = SEGGER_RTT_MAX_NUM_DOWN_BUFFERS;
//
@ -325,16 +345,15 @@ static void _DoInit(void) {
p->aDown[0].WrOff = 0u;
p->aDown[0].Flags = SEGGER_RTT_MODE_DEFAULT;
//
// Finish initialization of the control block.
// Copy Id string in three steps to make sure "SEGGER RTT" is not found
// in initializer memory (usually flash) by J-Link
//
STRCPY((char*)&p->acID[7], "RTT");
RTT__DMB(); // Force order of memory accessed inside core for cores that allow to change the order
STRCPY((char*)&p->acID[0], "SEGGER");
RTT__DMB(); // Force order of memory accessed inside core for cores that allow to change the order
p->acID[6] = ' ';
RTT__DMB(); // Force order of memory accessed inside core for cores that allow to change the order
// Finish initialization of the control block.
// Copy Id string backwards to make sure that "SEGGER RTT" is not found in initializer memory (usually flash),
// as this would cause J-Link to "find" the control block at a wrong address.
//
RTT__DMB(); // Force order of memory accesses for cores that may perform out-of-order memory accesses
for (i = 0; i < sizeof(_aInitStr) - 1; ++i) {
p->acID[i] = _aInitStr[sizeof(_aInitStr) - 2 - i]; // Skip terminating \0 at the end of the array
}
RTT__DMB(); // Force order of memory accesses for cores that may perform out-of-order memory accesses
}
/*********************************************************************
@ -938,20 +957,18 @@ unsigned SEGGER_RTT_WriteSkipNoLock(unsigned BufferIndex, const void* pBuffer, u
pRing = (SEGGER_RTT_BUFFER_UP*)((char*)&_SEGGER_RTT.aUp[BufferIndex] + SEGGER_RTT_UNCACHED_OFF); // Access uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
RdOff = pRing->RdOff;
WrOff = pRing->WrOff;
pDst = (pRing->pBuffer + WrOff) + SEGGER_RTT_UNCACHED_OFF;
if (RdOff <= WrOff) { // Case 1), 2) or 3)
Avail = pRing->SizeOfBuffer - WrOff - 1u; // Space until wrap-around (assume 1 byte not usable for case that RdOff == 0)
if (Avail >= NumBytes) { // Case 1)?
CopyStraight:
pDst = (pRing->pBuffer + WrOff) + SEGGER_RTT_UNCACHED_OFF;
memcpy((void*)pDst, pData, NumBytes);
RTT__DMB(); // Force data write to be complete before writing the <WrOff>, in case CPU is allowed to change the order of memory accesses
pRing->WrOff = WrOff + NumBytes;
return 1;
memcpy((void*)pDst, pData, NumBytes);
RTT__DMB(); // Force data write to be complete before writing the <WrOff>, in case CPU is allowed to change the order of memory accesses
pRing->WrOff = WrOff + NumBytes;
return 1;
}
Avail += RdOff; // Space incl. wrap-around
if (Avail >= NumBytes) { // Case 2? => If not, we have case 3) (does not fit)
Rem = pRing->SizeOfBuffer - WrOff; // Space until end of buffer
pDst = (pRing->pBuffer + WrOff) + SEGGER_RTT_UNCACHED_OFF;
memcpy((void*)pDst, pData, Rem); // Copy 1st chunk
NumBytes -= Rem;
//
@ -971,7 +988,10 @@ CopyStraight:
} else { // Potential case 4)
Avail = RdOff - WrOff - 1u;
if (Avail >= NumBytes) { // Case 4)? => If not, we have case 5) (does not fit)
goto CopyStraight;
memcpy((void*)pDst, pData, NumBytes);
RTT__DMB(); // Force data write to be complete before writing the <WrOff>, in case CPU is allowed to change the order of memory accesses
pRing->WrOff = WrOff + NumBytes;
return 1;
}
}
return 0; // No space in buffer
@ -1541,6 +1561,7 @@ unsigned SEGGER_RTT_HasDataUp(unsigned BufferIndex) {
* pBuffer Pointer to a buffer to be used.
* BufferSize Size of the buffer.
* Flags Operating modes. Define behavior if buffer is full (not enough space for entire message).
* Flags[31:24] are used for validity check and must be zero. Flags[23:2] are reserved for future use. Flags[1:0] = RTT operating mode.
*
* Return value
* >= 0 - O.K. Buffer Index
@ -1589,6 +1610,7 @@ int SEGGER_RTT_AllocDownBuffer(const char* sName, void* pBuffer, unsigned Buffer
* pBuffer Pointer to a buffer to be used.
* BufferSize Size of the buffer.
* Flags Operating modes. Define behavior if buffer is full (not enough space for entire message).
* Flags[31:24] are used for validity check and must be zero. Flags[23:2] are reserved for future use. Flags[1:0] = RTT operating mode.
*
* Return value
* >= 0 - O.K. Buffer Index
@ -1638,6 +1660,7 @@ int SEGGER_RTT_AllocUpBuffer(const char* sName, void* pBuffer, unsigned BufferSi
* pBuffer Pointer to a buffer to be used.
* BufferSize Size of the buffer.
* Flags Operating modes. Define behavior if buffer is full (not enough space for entire message).
* Flags[31:24] are used for validity check and must be zero. Flags[23:2] are reserved for future use. Flags[1:0] = RTT operating mode.
*
* Return value
* >= 0 - O.K.
@ -1689,6 +1712,7 @@ int SEGGER_RTT_ConfigUpBuffer(unsigned BufferIndex, const char* sName, void* pBu
* pBuffer Pointer to a buffer to be used.
* BufferSize Size of the buffer.
* Flags Operating modes. Define behavior if buffer is full (not enough space for entire message).
* Flags[31:24] are used for validity check and must be zero. Flags[23:2] are reserved for future use. Flags[1:0] = RTT operating mode.
*
* Return value
* >= 0 O.K.
@ -1807,6 +1831,7 @@ int SEGGER_RTT_SetNameDownBuffer(unsigned BufferIndex, const char* sName) {
* Parameters
* BufferIndex Index of the buffer.
* Flags Flags to set for the buffer.
* Flags[31:24] are used for validity check and must be zero. Flags[23:2] are reserved for future use. Flags[1:0] = RTT operating mode.
*
* Return value
* >= 0 O.K.
@ -1842,6 +1867,7 @@ int SEGGER_RTT_SetFlagsUpBuffer(unsigned BufferIndex, unsigned Flags) {
* Parameters
* BufferIndex Index of the buffer to renamed.
* Flags Flags to set for the buffer.
* Flags[31:24] are used for validity check and must be zero. Flags[23:2] are reserved for future use. Flags[1:0] = RTT operating mode.
*
* Return value
* >= 0 O.K.

View File

@ -42,7 +42,7 @@
* *
**********************************************************************
* *
* SystemView version: 3.30 *
* SystemView version: 3.40 *
* *
**********************************************************************
---------------------------END-OF-HEADER------------------------------
@ -50,14 +50,14 @@ File : SEGGER_RTT.h
Purpose : Implementation of SEGGER real-time transfer which allows
real-time communication on targets which support debugger
memory accesses while the CPU is running.
Revision: $Rev: 20869 $
Revision: $Rev: 25842 $
----------------------------------------------------------------------
*/
#ifndef SEGGER_RTT_H
#define SEGGER_RTT_H
#include "SEGGER_RTT_Conf.h"
#include "SEGGER_RTT_Conf.h"
/*********************************************************************
*
@ -65,30 +65,103 @@ Revision: $Rev: 20869 $
*
**********************************************************************
*/
#ifndef RTT_USE_ASM
#if (defined __SES_ARM) // SEGGER Embedded Studio
//
// Some cores support out-of-order memory accesses (reordering of memory accesses in the core)
// For such cores, we need to define a memory barrier to guarantee the order of certain accesses to the RTT ring buffers.
// Needed for:
// Cortex-M7 (ARMv7-M)
// Cortex-M23 (ARM-v8M)
// Cortex-M33 (ARM-v8M)
// Cortex-A/R (ARM-v7A/R)
//
// We do not explicitly check for "Embedded Studio" as the compiler in use determines what we support.
// You can use an external toolchain like IAR inside ES. So there is no point in checking for "Embedded Studio"
//
#if (defined __CROSSWORKS_ARM) // Rowley Crossworks
#define _CC_HAS_RTT_ASM_SUPPORT 1
#elif (defined __CROSSWORKS_ARM) // Rowley Crossworks
#define _CC_HAS_RTT_ASM_SUPPORT 1
#elif (defined __ARMCC_VERSION) // ARM compiler
#if (__ARMCC_VERSION >= 6000000) // ARM compiler V6.0 and later is clang based
#if (defined __ARM_ARCH_7M__) // Cortex-M3
#define _CORE_HAS_RTT_ASM_SUPPORT 1
#elif (defined __ARM_ARCH_7EM__) // Cortex-M4/M7
#define _CORE_HAS_RTT_ASM_SUPPORT 1
#define _CORE_NEEDS_DMB 1
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
#elif (defined __ARM_ARCH_8M_BASE__) // Cortex-M23
#define _CORE_HAS_RTT_ASM_SUPPORT 0
#define _CORE_NEEDS_DMB 1
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
#elif (defined __ARM_ARCH_8M_MAIN__) // Cortex-M33
#define _CORE_HAS_RTT_ASM_SUPPORT 1
#define _CORE_NEEDS_DMB 1
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
#else
#define _CORE_HAS_RTT_ASM_SUPPORT 0
#endif
#elif (defined __ARMCC_VERSION)
//
// ARM compiler
// ARM compiler V6.0 and later is clang based.
// Our ASM part is compatible to clang.
//
#if (__ARMCC_VERSION >= 6000000)
#define _CC_HAS_RTT_ASM_SUPPORT 1
#else
#else
#define _CC_HAS_RTT_ASM_SUPPORT 0
#endif
#elif (defined __GNUC__) // GCC
#endif
#if (defined __ARM_ARCH_6M__) // Cortex-M0 / M1
#define _CORE_HAS_RTT_ASM_SUPPORT 0 // No ASM support for this architecture
#elif (defined __ARM_ARCH_7M__) // Cortex-M3
#define _CORE_HAS_RTT_ASM_SUPPORT 1
#elif (defined __ARM_ARCH_7EM__) // Cortex-M4/M7
#define _CORE_HAS_RTT_ASM_SUPPORT 1
#define _CORE_NEEDS_DMB 1
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
#elif (defined __ARM_ARCH_8M_BASE__) // Cortex-M23
#define _CORE_HAS_RTT_ASM_SUPPORT 0
#define _CORE_NEEDS_DMB 1
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
#elif (defined __ARM_ARCH_8M_MAIN__) // Cortex-M33
#define _CORE_HAS_RTT_ASM_SUPPORT 1
#define _CORE_NEEDS_DMB 1
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
#elif ((defined __ARM_ARCH_7A__) || (defined __ARM_ARCH_7R__)) // Cortex-A/R 32-bit ARMv7-A/R
#define _CORE_NEEDS_DMB 1
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
#else
#define _CORE_HAS_RTT_ASM_SUPPORT 0
#endif
#elif ((defined __GNUC__) || (defined __clang__))
//
// GCC / Clang
//
#define _CC_HAS_RTT_ASM_SUPPORT 1
#elif (defined __clang__) // Clang compiler
#define _CC_HAS_RTT_ASM_SUPPORT 1
#elif ((defined __IASMARM__) || (defined __ICCARM__)) // IAR assembler/compiler
#define _CC_HAS_RTT_ASM_SUPPORT 1
#else
#define _CC_HAS_RTT_ASM_SUPPORT 0
#endif
#if ((defined __IASMARM__) || (defined __ICCARM__)) // IAR assembler/compiler
//
// IAR assembler / compiler
//
// ARM 7/9: __ARM_ARCH_5__ / __ARM_ARCH_5E__ / __ARM_ARCH_5T__ / __ARM_ARCH_5T__ / __ARM_ARCH_5TE__
#if (defined __ARM_ARCH_7M__) // Cortex-M3
#define _CORE_HAS_RTT_ASM_SUPPORT 1
#elif (defined __ARM_ARCH_7EM__) // Cortex-M4/M7
#define _CORE_HAS_RTT_ASM_SUPPORT 1
#define _CORE_NEEDS_DMB 1 // Only Cortex-M7 needs a DMB but we cannot distinguish M4 and M7 here...
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
#elif (defined __ARM_ARCH_8M_BASE__) // Cortex-M23
#define _CORE_HAS_RTT_ASM_SUPPORT 0
#define _CORE_NEEDS_DMB 1
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
#elif (defined __ARM_ARCH_8M_MAIN__) // Cortex-M33
#define _CORE_HAS_RTT_ASM_SUPPORT 1
#define _CORE_NEEDS_DMB 1
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
#elif ((defined __ARM_ARCH_7A__) || (defined __ARM_ARCH_7R__)) // Cortex-A/R 32-bit ARMv7-A/R
#define _CORE_NEEDS_DMB 1
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
#else
#define _CORE_HAS_RTT_ASM_SUPPORT 0
#endif
#elif ((defined __IASMARM__) || (defined __ICCARM__))
//
// IAR assembler/compiler
//
#define _CC_HAS_RTT_ASM_SUPPORT 1
#if (__VER__ < 6300000)
#define VOLATILE
#else
@ -99,48 +172,54 @@ Revision: $Rev: 20869 $
#define _CORE_HAS_RTT_ASM_SUPPORT 1
#endif
#endif
#if (defined __ARM7EM__) // Needed for old versions that do not know the define yet
#if (defined __ARM7EM__)
#if (__CORE__ == __ARM7EM__) // Cortex-M4/M7
#define _CORE_HAS_RTT_ASM_SUPPORT 1
#define _CORE_NEEDS_DMB 1
#define RTT__DMB() asm VOLATILE ("DMB");
#endif
#endif
#if (defined __ARM8M_BASELINE__) // Needed for old versions that do not know the define yet
#if (defined __ARM8M_BASELINE__)
#if (__CORE__ == __ARM8M_BASELINE__) // Cortex-M23
#define _CORE_HAS_RTT_ASM_SUPPORT 0
#define _CORE_NEEDS_DMB 1
#define RTT__DMB() asm VOLATILE ("DMB");
#endif
#endif
#if (defined __ARM8M_MAINLINE__) // Needed for old versions that do not know the define yet
#if (defined __ARM8M_MAINLINE__)
#if (__CORE__ == __ARM8M_MAINLINE__) // Cortex-M33
#define _CORE_HAS_RTT_ASM_SUPPORT 1
#define _CORE_NEEDS_DMB 1
#define RTT__DMB() asm VOLATILE ("DMB");
#endif
#endif
#if (defined __ARM8EM_MAINLINE__)
#if (__CORE__ == __ARM8EM_MAINLINE__) // Cortex-???
#define _CORE_HAS_RTT_ASM_SUPPORT 1
#define _CORE_NEEDS_DMB 1
#define RTT__DMB() asm VOLATILE ("DMB");
#endif
#endif
#if (defined __ARM7A__)
#if (__CORE__ == __ARM7A__) // Cortex-A 32-bit ARMv7-A
#define _CORE_NEEDS_DMB 1
#define RTT__DMB() asm VOLATILE ("DMB");
#endif
#endif
#if (defined __ARM7R__)
#if (__CORE__ == __ARM7R__) // Cortex-R 32-bit ARMv7-R
#define _CORE_NEEDS_DMB 1
#define RTT__DMB() asm VOLATILE ("DMB");
#endif
#endif
// TBD: __ARM8A__ => Cortex-A 64-bit ARMv8-A
// TBD: __ARM8R__ => Cortex-R 64-bit ARMv8-R
#else
//
// GCC / Clang
// Other compilers
//
#if (defined __ARM_ARCH_7M__) // Cortex-M3
#define _CORE_HAS_RTT_ASM_SUPPORT 1
#elif (defined __ARM_ARCH_7EM__) // Cortex-M4/M7
#define _CORE_HAS_RTT_ASM_SUPPORT 1
#define _CORE_NEEDS_DMB 1
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
#elif (defined __ARM_ARCH_8M_BASE__) // Cortex-M23
#define _CORE_HAS_RTT_ASM_SUPPORT 0
#define _CORE_NEEDS_DMB 1
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
#elif (defined __ARM_ARCH_8M_MAIN__) // Cortex-M33
#define _CORE_HAS_RTT_ASM_SUPPORT 1
#define _CORE_NEEDS_DMB 1
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
#else
#define _CORE_HAS_RTT_ASM_SUPPORT 0
#endif
#define _CC_HAS_RTT_ASM_SUPPORT 0
#define _CORE_HAS_RTT_ASM_SUPPORT 0
#endif
//
// If IDE and core support the ASM version, enable ASM version by default
@ -155,11 +234,6 @@ Revision: $Rev: 20869 $
#endif
#endif
//
// We need to know if a DMB is needed to make sure that on Cortex-M7 etc.
// the order of accesses to the ring buffers is guaranteed
// Needed for: Cortex-M7, Cortex-M23, Cortex-M33
//
#ifndef _CORE_NEEDS_DMB
#define _CORE_NEEDS_DMB 0
#endif
@ -232,8 +306,8 @@ typedef struct {
unsigned SizeOfBuffer; // Buffer size in bytes. Note that one byte is lost, as this implementation does not fill up the buffer in order to avoid the problem of being unable to distinguish between full and empty.
unsigned WrOff; // Position of next item to be written by either target.
volatile unsigned RdOff; // Position of next item to be read by host. Must be volatile since it may be modified by host.
unsigned Flags; // Contains configuration flags
} SEGGER_RTT_BUFFER_UP;
unsigned Flags; // Contains configuration flags. Flags[31:24] are used for validity check and must be zero. Flags[23:2] are reserved for future use. Flags[1:0] = RTT operating mode.
} SEGGER_RTT_BUFFER_UP;
//
// Description for a circular buffer (also called "ring buffer")
@ -245,8 +319,8 @@ typedef struct {
unsigned SizeOfBuffer; // Buffer size in bytes. Note that one byte is lost, as this implementation does not fill up the buffer in order to avoid the problem of being unable to distinguish between full and empty.
volatile unsigned WrOff; // Position of next item to be written by host. Must be volatile since it may be modified by host.
unsigned RdOff; // Position of next item to be read by target (down-buffer).
unsigned Flags; // Contains configuration flags
} SEGGER_RTT_BUFFER_DOWN;
unsigned Flags; // Contains configuration flags. Flags[31:24] are used for validity check and must be zero. Flags[23:2] are reserved for future use. Flags[1:0] = RTT operating mode.
} SEGGER_RTT_BUFFER_DOWN;
//
// RTT control block which describes the number of buffers available

View File

@ -42,7 +42,7 @@
* *
**********************************************************************
* *
* SystemView version: 3.30 *
* SystemView version: 3.40 *
* *
**********************************************************************
---------------------------END-OF-HEADER------------------------------

View File

@ -42,25 +42,25 @@
* *
**********************************************************************
* *
* SystemView version: 3.30 *
* SystemView version: 3.40 *
* *
**********************************************************************
-------------------------- END-OF-HEADER -----------------------------
File : SEGGER_SYSVIEW.c
Purpose : System visualization API implementation.
Revision: $Rev: 22278 $
Revision: $Rev: 28341 $
Additional information:
Packet format:
Packets with IDs 0..23 are standard packets with known structure.
For efficiency, they do *NOT* contain a length field.
<ID><Data><TimeStampDelta>
Packets with IDs 24..31 are standard packets with extendible
structure and contain a length field.
<ID><Lenght><Data><TimeStampDelta>
Packet ID 31 is used for SystemView extended events.
<ID><Lenght><ID_EX><Data><TimeStampDelta>
@ -190,6 +190,17 @@ Additional information:
#define MAKE_DELTA_32BIT(Delta)
#endif
#if SEGGER_SYSVIEW_SUPPORT_LONG_ID
#define _MAX_ID_BYTES 5u
#else
#define _MAX_ID_BYTES 2u
#endif
#if SEGGER_SYSVIEW_SUPPORT_LONG_DATA
#define _MAX_DATA_BYTES 5u
#else
#define _MAX_DATA_BYTES 2u
#endif
/*********************************************************************
*
@ -345,53 +356,6 @@ static const U8 _abSync[10] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
#endif
#endif
#ifdef SEGGER_SYSVIEW_SECTION
#if (defined __GNUC__)
__attribute__ ((section (SEGGER_SYSVIEW_SECTION))) static char _UpBuffer [SEGGER_SYSVIEW_RTT_BUFFER_SIZE];
#if (SEGGER_SYSVIEW_POST_MORTEM_MODE != 1)
__attribute__ ((section (SEGGER_SYSVIEW_SECTION))) static char _DownBuffer[8]; // Small, fixed-size buffer, for back-channel comms
#endif
#elif (defined __ICCARM__) || (defined __ICCRX__)
#pragma location=SEGGER_SYSVIEW_SECTION
static char _UpBuffer [SEGGER_SYSVIEW_RTT_BUFFER_SIZE];
#pragma location=SEGGER_SYSVIEW_SECTION
static char _DownBuffer[8]; // Small, fixed-size buffer, for back-channel comms
#elif (defined __CC_ARM)
__attribute__ ((section (SEGGER_SYSVIEW_SECTION), zero_init)) static char _UpBuffer [SEGGER_SYSVIEW_RTT_BUFFER_SIZE];
#if (SEGGER_SYSVIEW_POST_MORTEM_MODE != 1)
__attribute__ ((section (SEGGER_SYSVIEW_SECTION), zero_init)) static char _DownBuffer[8]; // Small, fixed-size buffer, for back-channel comms
#endif
#else
static char _UpBuffer [SEGGER_SYSVIEW_RTT_BUFFER_SIZE];
#if (SEGGER_SYSVIEW_POST_MORTEM_MODE != 1)
static char _DownBuffer[8]; // Small, fixed-size buffer, for back-channel comms
#endif
#endif
#else
#if SEGGER_SYSVIEW_CPU_CACHE_LINE_SIZE
#if (defined __GNUC__)
static char _UpBuffer [SEGGER_SYSVIEW_RTT_BUFFER_SIZE] __attribute__ ((aligned (SEGGER_SYSVIEW_CPU_CACHE_LINE_SIZE)));
#if (SEGGER_SYSVIEW_POST_MORTEM_MODE != 1)
static char _DownBuffer[8] __attribute__ ((aligned (SEGGER_SYSVIEW_CPU_CACHE_LINE_SIZE))); // Small, fixed-size buffer, for back-channel comms
#endif
#elif (defined(__ICCARM__))
#pragma data_alignment=SEGGER_RTT_CPU_CACHE_LINE_SIZE
static char _UpBuffer [SEGGER_SYSVIEW_RTT_BUFFER_SIZE];
#if (SEGGER_SYSVIEW_POST_MORTEM_MODE != 1)
#pragma data_alignment=SEGGER_RTT_CPU_CACHE_LINE_SIZE
static char _DownBuffer[8]; // Small, fixed-size buffer, for back-channel comms
#endif
#else
#error "Don't know how to place _SEGGER_RTT, _acUpBuffer, _acDownBuffer cache-line aligned"
#endif
#else
static char _UpBuffer [SEGGER_SYSVIEW_RTT_BUFFER_SIZE];
#if (SEGGER_SYSVIEW_POST_MORTEM_MODE != 1)
static char _DownBuffer[8]; // Small, fixed-size buffer, for back-channel comms
#endif
#endif
#endif
static SEGGER_SYSVIEW_GLOBALS _SYSVIEW_Globals;
static SEGGER_SYSVIEW_MODULE* _pFirstModule;
@ -459,12 +423,23 @@ static U8 _aPacket[SEGGER_SYSVIEW_MAX_PACKET_SIZE];
* Make sure NumBytes + 1 bytes are free for the payload.
*/
static U8* _EncodeData(U8* pPayload, const char* pSrc, unsigned int NumBytes) {
unsigned int n;
unsigned int n;
const U8* p;
//
n = 0;
*pPayload++ = NumBytes;
p = (const U8*)pSrc;
//
// Write Len
//
if (NumBytes < 255) {
*pPayload++ = (U8)NumBytes;
} else {
*pPayload++ = 255;
*pPayload++ = (NumBytes & 255);
*pPayload++ = ((NumBytes >> 8) & 255);
}
while (n < NumBytes) {
*pPayload++ = *pSrc++;
*pPayload++ = *p++;
n++;
}
return pPayload;
@ -511,7 +486,7 @@ static U8 *_EncodeStr(U8 *pPayload, const char *pText, unsigned int Limit) {
// Write Len
//
if (Len < 255) {
*pPayload++ = Len;
*pPayload++ = (U8)Len;
} else {
*pPayload++ = 255;
*pPayload++ = (Len & 255);
@ -547,7 +522,7 @@ static U8 *_EncodeStr(U8 *pPayload, const char *pText, unsigned int Limit) {
* computed and filled in by the sending function.
*/
static U8* _PreparePacket(U8* pPacket) {
return pPacket + 4;
return pPacket + _MAX_ID_BYTES + _MAX_DATA_BYTES;
}
/*********************************************************************
@ -565,7 +540,7 @@ static U8* _PreparePacket(U8* pPacket) {
#if (SEGGER_SYSVIEW_POST_MORTEM_MODE != 1)
static void _HandleIncomingPacket(void) {
U8 Cmd;
int Status;
unsigned int Status;
//
Status = SEGGER_RTT_ReadNoLock(CHANNEL_ID_DOWN, &Cmd, 1);
if (Status > 0) {
@ -650,7 +625,7 @@ static int _TrySendOverflowPacket(void) {
//
// Try to store packet in RTT buffer and update time stamp when this was successful
//
Status = SEGGER_RTT_WriteSkipNoLock(CHANNEL_ID_UP, aPacket, pPayload - aPacket);
Status = (int)SEGGER_RTT_WriteSkipNoLock(CHANNEL_ID_UP, aPacket, (unsigned int)(pPayload - aPacket));
SEGGER_SYSVIEW_ON_EVENT_RECORDED(pPayload - aPacket);
if (Status) {
_SYSVIEW_Globals.LastTxTimeStamp = TimeStamp;
@ -668,7 +643,7 @@ static int _TrySendOverflowPacket(void) {
* _SendSyncInfo()
*
* Function description
* Send SystemView sync packet and system information in
* Send SystemView sync packet and system information in
* post mortem mode.
*
* Additional information
@ -740,7 +715,7 @@ static void _SendPacket(U8* pStartPacket, U8* pEndPacket, unsigned int EventId)
U32 TimeStamp;
U32 Delta;
#if (SEGGER_SYSVIEW_POST_MORTEM_MODE != 1)
int Status;
unsigned int Status;
#endif
#if (SEGGER_SYSVIEW_USE_STATIC_BUFFER == 0)
@ -785,21 +760,85 @@ Send:
// otherwise prepend packet length and eventId.
//
if (EventId < 24) {
*--pStartPacket = EventId;
*--pStartPacket = (U8)EventId;
} else {
NumBytes = pEndPacket - pStartPacket;
if (NumBytes > 127) {
*--pStartPacket = (NumBytes >> 7);
*--pStartPacket = NumBytes | 0x80;
//
// Get data length and prepend it.
//
NumBytes = (unsigned int)(pEndPacket - pStartPacket);
#if SEGGER_SYSVIEW_SUPPORT_LONG_DATA
if (NumBytes < 127) {
*--pStartPacket = EventId;
} else {
*--pStartPacket = NumBytes;
//
// Backwards U32 encode EventId.
//
if (NumBytes < (1ul << 14)) { // Encodes in 2 bytes
*--pStartPacket = (U8)(NumBytes >> 7);
*--pStartPacket = (U8)(NumBytes | 0x80);
} else if (NumBytes < (1ul << 21)) { // Encodes in 3 bytes
*--pStartPacket = (U8)(NumBytes >> 14);
*--pStartPacket = (U8)((NumBytes >> 7) | 0x80);
*--pStartPacket = (U8)(NumBytes | 0x80);
} else if (NumBytes < (1ul << 28)) { // Encodes in 4 bytes
*--pStartPacket = (U8)(NumBytes >> 21);
*--pStartPacket = (U8)((NumBytes >> 14) | 0x80);
*--pStartPacket = (U8)((NumBytes >> 7) | 0x80);
*--pStartPacket = (U8)(NumBytes | 0x80);
} else { // Encodes in 5 bytes
*--pStartPacket = (U8)(NumBytes >> 28);
*--pStartPacket = (U8)((NumBytes >> 21) | 0x80);
*--pStartPacket = (U8)((NumBytes >> 14) | 0x80);
*--pStartPacket = (U8)((NumBytes >> 7) | 0x80);
*--pStartPacket = (U8)(NumBytes | 0x80);
}
}
#else
if (NumBytes > 127) {
*--pStartPacket = (U8)(NumBytes >> 7);
*--pStartPacket = (U8)(NumBytes | 0x80);
} else {
*--pStartPacket = (U8)NumBytes;
}
#endif
//
// Prepend EventId.
//
#if SEGGER_SYSVIEW_SUPPORT_LONG_ID
if (EventId < 127) {
*--pStartPacket = (U8)EventId;
} else {
//
// Backwards U32 encode EventId.
//
if (EventId < (1u << 14)) { // Encodes in 2 bytes
*--pStartPacket = (U8)(EventId >> 7);
*--pStartPacket = (U8)(EventId | 0x80);
} else if (EventId < (1ul << 21)) { // Encodes in 3 bytes
*--pStartPacket = (U8)(EventId >> 14);
*--pStartPacket = (U8)((EventId >> 7) | 0x80);
*--pStartPacket = (U8)(EventId | 0x80);
} else if (EventId < (1ul << 28)) { // Encodes in 4 bytes
*--pStartPacket = (U8)(EventId >> 21);
*--pStartPacket = (U8)((EventId >> 14) | 0x80);
*--pStartPacket = (U8)((EventId >> 7) | 0x80);
*--pStartPacket = (U8)(EventId | 0x80);
} else { // Encodes in 5 bytes
*--pStartPacket = (U8)(EventId >> 28);
*--pStartPacket = (U8)((EventId >> 21) | 0x80);
*--pStartPacket = (U8)((EventId >> 14) | 0x80);
*--pStartPacket = (U8)((EventId >> 7) | 0x80);
*--pStartPacket = (U8)(EventId | 0x80);
}
}
#else
if (EventId > 127) {
*--pStartPacket = (EventId >> 7);
*--pStartPacket = EventId | 0x80;
*--pStartPacket = (U8)(EventId >> 7);
*--pStartPacket = (U8)(EventId | 0x80);
} else {
*--pStartPacket = EventId;
*--pStartPacket = (U8)EventId;
}
#endif
}
//
// Compute time stamp delta and append it to packet.
@ -819,7 +858,7 @@ Send:
//
// Try to store packet in RTT buffer and update time stamp when this was successful
//
Status = SEGGER_RTT_WriteSkipNoLock(CHANNEL_ID_UP, pStartPacket, pEndPacket - pStartPacket);
Status = SEGGER_RTT_WriteSkipNoLock(CHANNEL_ID_UP, pStartPacket, (unsigned int)(pEndPacket - pStartPacket));
SEGGER_SYSVIEW_ON_EVENT_RECORDED(pEndPacket - pStartPacket);
if (Status) {
_SYSVIEW_Globals.LastTxTimeStamp = TimeStamp;
@ -827,7 +866,7 @@ Send:
_SYSVIEW_Globals.EnableState++; // EnableState has been 1, will be 2. Always.
}
#endif
#if (SEGGER_SYSVIEW_POST_MORTEM_MODE == 1)
//
// Add sync and system information periodically if we are in post mortem mode
@ -886,9 +925,9 @@ static int _VPrintHost(const char* s, U32 Options, va_list* pParamList) {
U8* pPayloadStart;
#if SEGGER_SYSVIEW_PRINTF_IMPLICIT_FORMAT
U8 HasNonScalar;
HasNonScalar = 0;
#endif
#endif
//
// Count number of arguments by counting '%' characters in string.
// If enabled, check for non-scalar modifier flags to format string on the target.
@ -903,7 +942,7 @@ static int _VPrintHost(const char* s, U32 Options, va_list* pParamList) {
if (c == '%') {
c = *p;
#if SEGGER_SYSVIEW_PRINTF_IMPLICIT_FORMAT == 0
aParas[NumArguments++] = va_arg(*pParamList, int);
aParas[NumArguments++] = (U32)(va_arg(*pParamList, int));
if (NumArguments == SEGGER_SYSVIEW_MAX_ARGUMENTS) {
break;
}
@ -912,7 +951,7 @@ static int _VPrintHost(const char* s, U32 Options, va_list* pParamList) {
HasNonScalar = 1;
break;
} else {
aParas[NumArguments++] = va_arg(*pParamList, int);
aParas[NumArguments++] = (U32)(va_arg(*pParamList, int));
if (NumArguments == SEGGER_SYSVIEW_MAX_ARGUMENTS) {
break;
}
@ -964,14 +1003,14 @@ static void _StoreChar(SEGGER_SYSVIEW_PRINTF_DESC * p, char c) {
Cnt = p->Cnt;
if ((Cnt + 1u) <= SEGGER_SYSVIEW_MAX_STRING_LEN) {
*(p->pPayload++) = c;
*(p->pPayload++) = (U8)c;
p->Cnt = Cnt + 1u;
}
//
// Write part of string, when the buffer is full
//
if (p->Cnt == SEGGER_SYSVIEW_MAX_STRING_LEN) {
*(p->pPayloadStart) = p->Cnt;
*(p->pPayloadStart) = (U8)p->Cnt;
pPayload = p->pPayload;
Options = p->Options;
ENCODE_U32(pPayload, Options);
@ -988,7 +1027,7 @@ static void _StoreChar(SEGGER_SYSVIEW_PRINTF_DESC * p, char c) {
* _PrintUnsigned()
*
* Function description
* Print an unsigned integer with the given formatting into the
* Print an unsigned integer with the given formatting into the
* formatted string.
*
* Parameters
@ -1079,7 +1118,7 @@ static void _PrintUnsigned(SEGGER_SYSVIEW_PRINTF_DESC * pBufferDesc, unsigned in
* _PrintInt()
*
* Function description
* Print a signed integer with the given formatting into the
* Print a signed integer with the given formatting into the
* formatted string.
*
* Parameters
@ -1295,7 +1334,7 @@ static void _VPrintTarget(const char* sFormat, U32 Options, va_list* pParamList)
// Write remaining data, if any
//
if (BufferDesc.Cnt != 0u) {
*(BufferDesc.pPayloadStart) = BufferDesc.Cnt;
*(BufferDesc.pPayloadStart) = (U8)BufferDesc.Cnt;
ENCODE_U32(BufferDesc.pPayload, BufferDesc.Options);
ENCODE_U32(BufferDesc.pPayload, 0);
_SendPacket(BufferDesc.pPayloadStart, BufferDesc.pPayload, SYSVIEW_EVTID_PRINT_FORMATTED);
@ -1322,7 +1361,7 @@ static void _VPrintTarget(const char* sFormat, U32 Options, va_list* pParamList)
*
* Function description
* Initializes the SYSVIEW module.
* Must be called before the Systemview Application connects to
* Must be called before the SystemView Application connects to
* the system.
*
* Parameters
@ -1332,9 +1371,9 @@ static void _VPrintTarget(const char* sFormat, U32 Options, va_list* pParamList)
* pfSendSysDesc - Pointer to record system description callback function.
*
* Additional information
* This function initializes the RTT channel used to transport
* SEGGER SystemView packets.
* The channel is assigned the label "SysView" for client software
* This function initializes the RTT channel used to transport
* SEGGER SystemView packets.
* The channel is assigned the label "SysView" for client software
* to identify the SystemView channel.
*
* The channel is configured with the macro SEGGER_SYSVIEW_RTT_CHANNEL.
@ -1348,9 +1387,9 @@ void SEGGER_SYSVIEW_Init(U32 SysFreq, U32 CPUFreq, const SEGGER_SYSVIEW_OS_API *
#endif
#if (SEGGER_SYSVIEW_POST_MORTEM_MODE == 1)
#if SEGGER_SYSVIEW_RTT_CHANNEL > 0
SEGGER_RTT_ConfigUpBuffer(SEGGER_SYSVIEW_RTT_CHANNEL, "SysView", &_UpBuffer[0], sizeof(_UpBuffer), SEGGER_RTT_MODE_NO_BLOCK_SKIP);
SEGGER_RTT_ConfigUpBuffer(SEGGER_SYSVIEW_RTT_CHANNEL, "SysView", &_UpBuffer[0], sizeof(_UpBuffer), SEGGER_RTT_MODE_NO_BLOCK_SKIP);
#else
_SYSVIEW_Globals.UpChannel = SEGGER_RTT_AllocUpBuffer ("SysView", &_UpBuffer[0], sizeof(_UpBuffer), SEGGER_RTT_MODE_NO_BLOCK_SKIP);
_SYSVIEW_Globals.UpChannel = (U8)SEGGER_RTT_AllocUpBuffer ("SysView", &_UpBuffer[0], sizeof(_UpBuffer), SEGGER_RTT_MODE_NO_BLOCK_SKIP);
#endif
_SYSVIEW_Globals.RAMBaseAddress = SEGGER_SYSVIEW_ID_BASE;
_SYSVIEW_Globals.LastTxTimeStamp = SEGGER_SYSVIEW_GET_TIMESTAMP();
@ -1365,7 +1404,7 @@ void SEGGER_SYSVIEW_Init(U32 SysFreq, U32 CPUFreq, const SEGGER_SYSVIEW_OS_API *
SEGGER_RTT_ConfigUpBuffer (SEGGER_SYSVIEW_RTT_CHANNEL, "SysView", &_UpBuffer[0], sizeof(_UpBuffer), SEGGER_RTT_MODE_NO_BLOCK_SKIP);
SEGGER_RTT_ConfigDownBuffer (SEGGER_SYSVIEW_RTT_CHANNEL, "SysView", &_DownBuffer[0], sizeof(_DownBuffer), SEGGER_RTT_MODE_NO_BLOCK_SKIP);
#else
_SYSVIEW_Globals.UpChannel = SEGGER_RTT_AllocUpBuffer ("SysView", &_UpBuffer[0], sizeof(_UpBuffer), SEGGER_RTT_MODE_NO_BLOCK_SKIP);
_SYSVIEW_Globals.UpChannel = (U8)SEGGER_RTT_AllocUpBuffer ("SysView", &_UpBuffer[0], sizeof(_UpBuffer), SEGGER_RTT_MODE_NO_BLOCK_SKIP);
_SYSVIEW_Globals.DownChannel = _SYSVIEW_Globals.UpChannel;
SEGGER_RTT_ConfigDownBuffer (_SYSVIEW_Globals.DownChannel, "SysView", &_DownBuffer[0], sizeof(_DownBuffer), SEGGER_RTT_MODE_NO_BLOCK_SKIP);
#endif
@ -1820,7 +1859,7 @@ void SEGGER_SYSVIEW_Start(void) {
* Stop recording SystemView events.
*
* This function is triggered by the SystemView Application on disconnect.
* For single-shot or post-mortem mode recording, it can be called
* For single-shot or post-mortem mode recording, it can be called
* by the application.
*
* Additional information
@ -1926,12 +1965,12 @@ void SEGGER_SYSVIEW_SendTaskList(void) {
*
* Function description
* Send the system description string to the host.
* The system description is used by the Systemview Application
* The system description is used by the SystemView Application
* to identify the current application and handle events accordingly.
*
* The system description is usually called by the system description
* callback, to ensure it is only sent when the SystemView Application
* is connected.
* is connected.
*
* Parameters
* sSysDesc - Pointer to the 0-terminated system description string.
@ -2049,7 +2088,7 @@ void SEGGER_SYSVIEW_RecordExitISRToScheduler(void) {
*
* Function description
* Format and send a Timer entry event.
*
*
* Parameters
* TimerId - Id of the timer which starts.
*/
@ -2085,7 +2124,7 @@ void SEGGER_SYSVIEW_RecordExitTimer(void) {
*
* Function description
* Format and send an End API Call event without return value.
*
*
* Parameters
* EventID - Id of API function which ends.
*/
@ -2106,7 +2145,7 @@ void SEGGER_SYSVIEW_RecordEndCall(unsigned int EventID) {
*
* Function description
* Format and send an End API Call event with return value.
*
*
* Parameters
* EventID - Id of API function which ends.
* Para0 - Return value which will be returned by the API function.
@ -2166,10 +2205,10 @@ void SEGGER_SYSVIEW_OnTaskCreate(U32 TaskId) {
* SEGGER_SYSVIEW_OnTaskTerminate()
*
* Function description
* Record a Task termination event.
* The Task termination event corresponds to terminating a task in
* the OS. If the TaskId is the currently active task,
* SEGGER_SYSVIEW_OnTaskStopExec may be used, either.
* Record a Task termination event.
* The Task termination event corresponds to terminating a task in
* the OS. If the TaskId is the currently active task,
* SEGGER_SYSVIEW_OnTaskStopExec may be used, either.
*
* Parameters
* TaskId - Task ID of terminated task.
@ -2345,7 +2384,7 @@ void SEGGER_SYSVIEW_Mark(unsigned int MarkerId) {
*
* Marker names are usually set in the system description
* callback, to ensure it is only sent when the SystemView Application
* is connected.
* is connected.
*
* Parameters
* MarkerId - User defined ID for the marker.
@ -2373,7 +2412,7 @@ void SEGGER_SYSVIEW_NameMarker(unsigned int MarkerId, const char* sName) {
*
* Marker names are usually set in the system description
* callback, to ensure it is only sent when the SystemView Application
* is connected.
* is connected.
*
* Parameters
* ResourceId - Id of the resource to be named. i.e. its address.
@ -2391,6 +2430,179 @@ void SEGGER_SYSVIEW_NameResource(U32 ResourceId, const char* sName) {
RECORD_END();
}
/*********************************************************************
*
* SEGGER_SYSVIEW_HeapDefine()
*
* Function description
* Define heap.
*
* Parameters
* pHeap - Pointer to heap control structure.
* pBase - Pointer to managed heap memory.
* HeapSize - Size of managed heap memory in bytes.
* MetadataSize - Size of metadata associated with each heap allocation.
*
* Additional information
* SystemView can track allocations across multiple heaps.
*
* HeapSize must be a multiple of the natural alignment unit of the
* target. This size is subject to compression, controlled by the
* specific setting of SEGGER_SYSVIEW_ID_SHIFT.
*
* MetadataSize defines the size of the per-allocation metadata.
* For many heap implementations, the metadata size is a multiple of
* the word size of the machine and typically contains the size
* of the allocated block (used upon deallocation), optional
* pointers to the preceding and/or following blocks, and optionally
* a tag identifying the owner of the block. Note that MetadataSize
* is not compressed within the SystemView packet and is not
* required to be a multiple of 1<<SEGGER_SYSVIEW_ID_SHIFT.
*/
void SEGGER_SYSVIEW_HeapDefine(void* pHeap, void *pBase, unsigned int HeapSize, unsigned int MetadataSize) {
U8* pPayload;
U8* pPayloadStart;
RECORD_START(SEGGER_SYSVIEW_INFO_SIZE + 4 * SEGGER_SYSVIEW_QUANTA_U32);
//
pPayload = pPayloadStart;
ENCODE_U32(pPayload, SYSVIEW_EVTID_EX_HEAP_DEFINE);
ENCODE_U32(pPayload, SHRINK_ID((U32)pHeap));
ENCODE_U32(pPayload, SHRINK_ID((U32)pBase));
ENCODE_U32(pPayload, HeapSize >> SEGGER_SYSVIEW_ID_SHIFT);
ENCODE_U32(pPayload, MetadataSize);
_SendPacket(pPayloadStart, pPayload, SYSVIEW_EVTID_EX);
RECORD_END();
}
/*********************************************************************
*
* SEGGER_SYSVIEW_HeapAlloc()
*
* Function description
* Record a system-heap allocation event.
*
* Parameters
* pHeap - Pointer to heap where allocation was made.
* pUserData - Pointer to allocated user data.
* UserDataLen - Size of block allocated to hold user data, excluding any metadata.
*
* Additional information
* The user data must be correctly aligned for the architecture, which
* typically requires that the alignment is at least the alignment
* of a double or a long long. pUserData is, therefore, compressed by
* shrinking as IDs are compressed, controlled by the specific setting
* of SEGGER_SYSVIEW_ID_SHIFT.
*
* In the same way, UserDataLen must reflect the size of the allocated
* block, not the allocation size requested by the application. This
* size is also subject to compression, controlled by the specific setting
* of SEGGER_SYSVIEW_ID_SHIFT.
*
* As an example, assume the allocator is running on a Cortex-M device
* with SEGGER_SYSVIEW_ID_SHIFT set to 2 (the word alignment of the device).
* If a user requests an allocation of 5 bytes, a hypothetical heap
* allocator could allocate a block with size 32 bytes for this. The value
* of UserDataLen sent to SystemView for recording should be 32, not 5,
* and the 32 is compressed by shifting by two bits, the configured value
* of SEGGER_SYSVIEW_ID_SHIFT, and describes the number of bytes that are
* consumed from managed memory from which SystemView can calculate
* accurate heap metrics.
*/
void SEGGER_SYSVIEW_HeapAlloc(void *pHeap, void* pUserData, unsigned int UserDataLen) {
U8* pPayload;
U8* pPayloadStart;
RECORD_START(SEGGER_SYSVIEW_INFO_SIZE + 3 * SEGGER_SYSVIEW_QUANTA_U32);
//
pPayload = pPayloadStart;
ENCODE_U32(pPayload, SYSVIEW_EVTID_EX_HEAP_ALLOC);
ENCODE_U32(pPayload, SHRINK_ID((U32)pHeap));
ENCODE_U32(pPayload, SHRINK_ID((U32)pUserData));
ENCODE_U32(pPayload, UserDataLen >> SEGGER_SYSVIEW_ID_SHIFT);
_SendPacket(pPayloadStart, pPayload, SYSVIEW_EVTID_EX);
RECORD_END();
}
/*********************************************************************
*
* SEGGER_SYSVIEW_HeapAllocEx()
*
* Function description
* Record a per-heap allocation event.
*
* Parameters
* pHeap - Pointer to heap where allocation was made.
* pUserData - Pointer to allocated user data.
* UserDataLen - Size of block allocated to hold user data, excluding any metadata.
* Tag - Block tag, typically used to identify the owner of the block.
*
* Additional information
* The user data must be correctly aligned for the architecture, which
* typically requires that the alignment is at least the alignment
* of a double or a long long. pUserData is, therefore, compressed by
* shrinking as IDs are compressed, controlled by the specific setting
* of SEGGER_SYSVIEW_ID_SHIFT.
*
* In the same way, UserDataLen must reflect the size of the allocated
* block, not the allocation size requested by the application. This
* size is also subject to compression, controlled by the specific setting
* of SEGGER_SYSVIEW_ID_SHIFT.
*
* As an example, assume the allocator is running on a Cortex-M device
* with SEGGER_SYSVIEW_ID_SHIFT set to 2 (the word alignment of the device).
* If a user requests an allocation of 5 bytes, a hypothetical heap
* allocator could allocate a block with size 32 bytes for this. The value
* of UserDataLen sent to SystemView for recording should be 32, not 5,
* and the 32 is compressed by shifting by two bits, the configured value
* of SEGGER_SYSVIEW_ID_SHIFT, and describes the number of bytes that are
* consumed from managed memory from which SystemView can calculate
* accurate heap metrics.
*
* See also
* SEGGER_SYSVIEW_HeapAlloc().
*/
void SEGGER_SYSVIEW_HeapAllocEx(void *pHeap, void* pUserData, unsigned int UserDataLen, unsigned int Tag) {
U8* pPayload;
U8* pPayloadStart;
RECORD_START(SEGGER_SYSVIEW_INFO_SIZE + 5 * SEGGER_SYSVIEW_QUANTA_U32);
//
pPayload = pPayloadStart;
ENCODE_U32(pPayload, SYSVIEW_EVTID_EX_HEAP_ALLOC_EX);
ENCODE_U32(pPayload, SHRINK_ID((U32)pHeap));
ENCODE_U32(pPayload, SHRINK_ID((U32)pUserData));
ENCODE_U32(pPayload, UserDataLen >> SEGGER_SYSVIEW_ID_SHIFT);
ENCODE_U32(pPayload, Tag);
_SendPacket(pPayloadStart, pPayload, SYSVIEW_EVTID_EX);
RECORD_END();
}
/*********************************************************************
*
* SEGGER_SYSVIEW_HeapFree()
*
* Function description
* Record a heap deallocation event.
*
* Parameters
* pHeap - Pointer to heap where allocation was made.
* pUserData - Pointer to allocated user data.
*
* Additional information
* SystemViews track allocations and knows the size of the
* allocated data.
*/
void SEGGER_SYSVIEW_HeapFree(void* pHeap, void* pUserData) {
U8* pPayload;
U8* pPayloadStart;
RECORD_START(SEGGER_SYSVIEW_INFO_SIZE + 2 * SEGGER_SYSVIEW_QUANTA_U32);
//
pPayload = pPayloadStart;
ENCODE_U32(pPayload, SYSVIEW_EVTID_EX_HEAP_FREE);
ENCODE_U32(pPayload, SHRINK_ID((U32)pHeap));
ENCODE_U32(pPayload, SHRINK_ID((U32)pUserData));
_SendPacket(pPayloadStart, pPayload, SYSVIEW_EVTID_EX);
RECORD_END();
}
/*********************************************************************
*
* SEGGER_SYSVIEW_SendPacket()
@ -2795,7 +3007,7 @@ void SEGGER_SYSVIEW_PrintfHost(const char* s, ...) {
* SEGGER_SYSVIEW_WarnfHost()
*
* Function description
* Print a warnin string which is formatted on the host by
* Print a warning string which is formatted on the host by
* the SystemView Application.
*
* Parameters
@ -2830,7 +3042,7 @@ void SEGGER_SYSVIEW_WarnfHost(const char* s, ...) {
* SEGGER_SYSVIEW_ErrorfHost()
*
* Function description
* Print an error string which is formatted on the host by
* Print an error string which is formatted on the host by
* the SystemView Application.
*
* Parameters
@ -2865,7 +3077,7 @@ void SEGGER_SYSVIEW_ErrorfHost(const char* s, ...) {
* SEGGER_SYSVIEW_PrintfTargetEx()
*
* Function description
* Print a string which is formatted on the target before sent to
* Print a string which is formatted on the target before sent to
* the host with Additional information.
*
* Parameters
@ -2885,7 +3097,7 @@ void SEGGER_SYSVIEW_PrintfTargetEx(const char* s, U32 Options, ...) {
* SEGGER_SYSVIEW_PrintfTarget()
*
* Function description
* Print a string which is formatted on the target before sent to
* Print a string which is formatted on the target before sent to
* the host.
*
* Parameters

View File

@ -42,13 +42,13 @@
* *
**********************************************************************
* *
* SystemView version: 3.30 *
* SystemView version: 3.40 *
* *
**********************************************************************
-------------------------- END-OF-HEADER -----------------------------
File : SEGGER_SYSVIEW.h
Purpose : System visualization API.
Revision: $Rev: 21292 $
Revision: $Rev: 28237 $
*/
#ifndef SEGGER_SYSVIEW_H
@ -77,7 +77,7 @@ extern "C" {
*/
#define SEGGER_SYSVIEW_MAJOR 3
#define SEGGER_SYSVIEW_MINOR 10
#define SEGGER_SYSVIEW_MINOR 32
#define SEGGER_SYSVIEW_REV 0
#define SEGGER_SYSVIEW_VERSION ((SEGGER_SYSVIEW_MAJOR * 10000) + (SEGGER_SYSVIEW_MINOR * 100) + SEGGER_SYSVIEW_REV)
@ -130,6 +130,10 @@ extern "C" {
//
#define SYSVIEW_EVTID_EX_MARK 0
#define SYSVIEW_EVTID_EX_NAME_MARKER 1
#define SYSVIEW_EVTID_EX_HEAP_DEFINE 2
#define SYSVIEW_EVTID_EX_HEAP_ALLOC 3
#define SYSVIEW_EVTID_EX_HEAP_ALLOC_EX 4
#define SYSVIEW_EVTID_EX_HEAP_FREE 5
//
// Event masks to disable/enable events
//
@ -292,8 +296,13 @@ void SEGGER_SYSVIEW_MarkStop (unsigned int MarkerId);
void SEGGER_SYSVIEW_Mark (unsigned int MarkerId);
void SEGGER_SYSVIEW_NameMarker (unsigned int MarkerId, const char* sName);
void SEGGER_SYSVIEW_NameResource (U32 ResourceId, const char* sName);
void SEGGER_SYSVIEW_HeapDefine (void* pHeap, void* pBase, unsigned int HeapSize, unsigned int MetadataSize);
void SEGGER_SYSVIEW_HeapAlloc (void* pHeap, void* pUserData, unsigned int UserDataLen);
void SEGGER_SYSVIEW_HeapAllocEx (void* pHeap, void* pUserData, unsigned int UserDataLen, unsigned int Tag);
void SEGGER_SYSVIEW_HeapFree (void* pHeap, void* pUserData);
void SEGGER_SYSVIEW_NameResource (U32 ResourceId, const char* sName);
int SEGGER_SYSVIEW_SendPacket (U8* pPacket, U8* pPayloadEnd, unsigned int EventId);
/*********************************************************************

View File

@ -42,14 +42,14 @@
* *
**********************************************************************
* *
* SystemView version: 3.30 *
* SystemView version: 3.40 *
* *
**********************************************************************
-------------------------- END-OF-HEADER -----------------------------
File : SEGGER_SYSVIEW_ConfDefaults.h
Purpose : Defines defaults for configurable defines used in
SEGGER SystemView.
Revision: $Rev: 21319 $
Revision: $Rev: 26230 $
*/
#ifndef SEGGER_SYSVIEW_CONFDEFAULTS_H
@ -171,7 +171,7 @@ extern "C" {
* Default
* Call user-supplied function SEGGER_SYSVIEW_X_GetInterruptId().
* Notes
* For some known compilers and cores, a ready-to-use, core-specific
* For some known compilers and cores, a ready-to-use, core-specific
* default is set.
* ARMv7M: Read ICSR[8:0] (active vector)
* ARMv6M: Read ICSR[5:0] (active vector)
@ -203,7 +203,7 @@ extern "C" {
* Default
* Call user-supplied function SEGGER_SYSVIEW_X_GetTimestamp().
* Notes
* For some known compilers and cores, a ready-to-use, core-specific
* For some known compilers and cores, a ready-to-use, core-specific
* default is set.
* ARMv7M: Read Cortex-M Cycle Count register.
*
@ -277,7 +277,7 @@ extern "C" {
* Default
* undefined: Do not place into a specific section.
* Notes
* If SEGGER_RTT_SECTION is defined, the default changes to use
* If SEGGER_RTT_SECTION is defined, the default changes to use
* this section for the SystemView RTT Buffer, too.
*/
#if !(defined SEGGER_SYSVIEW_SECTION) && (defined SEGGER_RTT_SECTION)
@ -309,11 +309,11 @@ extern "C" {
* Default
* 0
* Notes
* Value is usually subtracted from mailboxes, semaphores, tasks,
* Value is usually subtracted from mailboxes, semaphores, tasks,
* .... addresses, to compress event parameters.
* Should be the lowest RAM address of the system.
*/
#ifndef SEGGER_SYSVIEW_ID_BASE
#ifndef SEGGER_SYSVIEW_ID_BASE
#define SEGGER_SYSVIEW_ID_BASE 0
#endif
@ -363,13 +363,39 @@ extern "C" {
#define SEGGER_SYSVIEW_MAX_STRING_LEN 128
#endif
/*********************************************************************
*
* Define: SEGGER_SYSVIEW_SUPPORT_LONG_ID
*
* Description
* It set, support enconding Evend Ids longer than 14 bit.
* Default
* 1
*/
#ifndef SEGGER_SYSVIEW_SUPPORT_LONG_ID
#define SEGGER_SYSVIEW_SUPPORT_LONG_ID 1
#endif
/*********************************************************************
*
* Define: SEGGER_SYSVIEW_SUPPORT_LONG_DATA
*
* Description
* It set, support enconding event data longer than 14 bit.
* Default
* 0
*/
#ifndef SEGGER_SYSVIEW_SUPPORT_LONG_DATA
#define SEGGER_SYSVIEW_SUPPORT_LONG_DATA 0
#endif
/*********************************************************************
*
* Define: SEGGER_SYSVIEW_PRINTF_IMPLICIT_FORMAT
*
* Description
* If enabled, on SEGGER_SYSVIEW_PrintHost, check the format string
* and if it includes unsupported formatters, use formatting on the
* If enabled, on SEGGER_SYSVIEW_PrintHost, check the format string
* and if it includes unsupported formatters, use formatting on the
* target instead.
* Default
* 0: Disabled.
@ -435,11 +461,11 @@ extern "C" {
* Default
* 1: Enabled.
* Notes
* If enabled, the static memory use by SystemView is increased by
* the maximum packet size. SystemView is locked on entry of a
* If enabled, the static memory use by SystemView is increased by
* the maximum packet size. SystemView is locked on entry of a
* recording function.
* If disabled, the stack usage by SystemView recording functions
* might be increased by up to the maximum packet size. SystemView
* If disabled, the stack usage by SystemView recording functions
* might be increased by up to the maximum packet size. SystemView
* is locked when writing the packet to the RTT buffer.
*/
#ifndef SEGGER_SYSVIEW_USE_STATIC_BUFFER
@ -455,7 +481,7 @@ extern "C" {
* Default
* Automatically calculated.
* Notes
* The maximum packet size is mainly defined by the maximum string
* The maximum packet size is mainly defined by the maximum string
* length and the maximum number of arguments.
*/
#ifndef SEGGER_SYSVIEW_MAX_PACKET_SIZE
@ -467,12 +493,12 @@ extern "C" {
* Define: SEGGER_SYSVIEW_POST_MORTEM_MODE
*
* Description
* If enabled, SystemView records for post-mortem analysis instead
* If enabled, SystemView records for post-mortem analysis instead
* of real-time analysis.
* Default
* 0: Disabled.
* Notes
* For more information refer to
* For more information refer to
* https://www.segger.com/products/development-tools/systemview/technology/post-mortem-mode
*/
#ifndef SEGGER_SYSVIEW_POST_MORTEM_MODE
@ -484,14 +510,14 @@ extern "C" {
* Define: SEGGER_SYSVIEW_SYNC_PERIOD_SHIFT
*
* Description
* Configure how frequently syncronization is sent in post-mortem
* Configure how frequently syncronization is sent in post-mortem
* mode.
* Default
* 8: (1 << 8) = Every 256 Events.
* Notes
* In post-mortem mode, at least one sync has to be in the RTT buffer.
* Recommended sync frequency: Buffer Size / 16
* For more information refer to
* For more information refer to
* https://www.segger.com/products/development-tools/systemview/technology/post-mortem-mode
*/
#ifndef SEGGER_SYSVIEW_SYNC_PERIOD_SHIFT
@ -523,8 +549,8 @@ extern "C" {
* Default
* Use RTT Locking mechanism (defined by SEGGER_RTT_LOCK()).
* Notes
* If SystemView recording is not locked, recording events from
* interrupts and tasks may lead to unpredictable, undefined, event
* If SystemView recording is not locked, recording events from
* interrupts and tasks may lead to unpredictable, undefined, event
* data.
*/
#ifndef SEGGER_SYSVIEW_LOCK

View File

@ -42,7 +42,7 @@
* *
**********************************************************************
* *
* SystemView version: 3.30 *
* SystemView version: 3.40 *
* *
**********************************************************************
-------------------------- END-OF-HEADER -----------------------------

View File

@ -42,7 +42,7 @@
* *
**********************************************************************
* *
* SystemView version: 3.30 *
* SystemView version: 3.40 *
* *
**********************************************************************
---------------------------END-OF-HEADER------------------------------
@ -50,7 +50,7 @@ File : SEGGER_RTT_Syscalls_GCC.c
Purpose : Low-level functions for using printf() via RTT in GCC.
To use RTT for printf output, include this file in your
application.
Revision: $Rev: 20755 $
Revision: $Rev: 24316 $
----------------------------------------------------------------------
*/
#if (defined __GNUC__) && !(defined __SES_ARM) && !(defined __CROSSWORKS_ARM) && !(defined __ARMCC_VERSION) && !(defined __CC_ARM)

View File

@ -42,7 +42,7 @@
* *
**********************************************************************
* *
* SystemView version: 3.30 *
* SystemView version: 3.40 *
* *
**********************************************************************
---------------------------END-OF-HEADER------------------------------
@ -50,7 +50,7 @@ File : SEGGER_RTT_Syscalls_IAR.c
Purpose : Low-level functions for using printf() via RTT in IAR.
To use RTT for printf output, include this file in your
application and set the Library Configuration to Normal.
Revision: $Rev: 17697 $
Revision: $Rev: 24316 $
----------------------------------------------------------------------
*/
#ifdef __IAR_SYSTEMS_ICC__

View File

@ -42,14 +42,14 @@
* *
**********************************************************************
* *
* SystemView version: 3.30 *
* SystemView version: 3.40 *
* *
**********************************************************************
---------------------------END-OF-HEADER------------------------------
File : RTT_Syscalls_KEIL.c
Purpose : Retargeting module for KEIL MDK-CM3.
Low-level functions for using printf() via RTT
Revision: $Rev: 20754 $
Revision: $Rev: 24316 $
Notes : (1) https://wiki.segger.com/Keil_MDK-ARM#RTT_in_uVision
----------------------------------------------------------------------
*/

View File

@ -42,7 +42,7 @@
* *
**********************************************************************
* *
* SystemView version: 3.30 *
* SystemView version: 3.40 *
* *
**********************************************************************
---------------------------END-OF-HEADER------------------------------
@ -51,7 +51,7 @@ Purpose : Reimplementation of printf, puts and __getchar using RTT
in SEGGER Embedded Studio.
To use RTT for printf output, include this file in your
application.
Revision: $Rev: 18539 $
Revision: $Rev: 24316 $
----------------------------------------------------------------------
*/
#if (defined __SES_ARM) || (defined __SES_RISCV) || (defined __CROSSWORKS_ARM)