/********************************************************************* * 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.30 * * * ********************************************************************** -------------------------- END-OF-HEADER ----------------------------- File : SEGGER_SYSVIEW_Config_uCOSII.c Purpose : Sample setup configuration of SystemView with Micrium uC/OS-II. Revision: $Rev: 9599 $ */ #include "SEGGER_SYSVIEW.h" #include "os.h" #include "cpu_core.h" #include "bsp_sys.h" #if (defined(OS_TRACE_EN) && (OS_TRACE_EN > 0u)) extern const SEGGER_SYSVIEW_OS_API SYSVIEW_X_OS_TraceAPI; CPU_ERR local_err; /********************************************************************* * * Defines, configurable * ********************************************************************** */ // The application name to be displayed in SystemViewer #define SYSVIEW_APP_NAME "Renesas RX Demo" // The target device name #define SYSVIEW_DEVICE_NAME "Renesas RX Device" // Frequency of the timestamp. Must match SEGGER_SYSVIEW_GET_TIMESTAMP in SEGGER_SYSVIEW_Conf.h #define SYSVIEW_TIMESTAMP_FREQ (CPU_TS_TmrFreqGet(&local_err)) // System Frequency. SystemcoreClock is used in most CMSIS compatible projects. #define SYSVIEW_CPU_FREQ (BSP_SysPerClkFreqGet()) // The lowest RAM address used for IDs (pointers) #define SYSVIEW_RAM_BASE (0) U32 SEGGER_SYSVIEW_X_GetTimestamp(void) { return (CPU_TS_Get32()); } U32 SEGGER_SYSVIEW_X_GetInterruptId(void) { U32 IntId; __asm volatile ("mvfc PSW, %0 \t\n" // Load current PSW "and #0x0F000000, %0 \t\n" // Clear all except IPL ([27:24]) "shlr #24, %0 \t\n" // Shift IPL to [3:0] : "=r" (IntId) // Output result : // Input : // Clobbered list ); return IntId; } /********************************************************************* * * _cbSendSystemDesc() * * Function description * Sends SystemView description strings. */ static void _cbSendSystemDesc(void) { SEGGER_SYSVIEW_SendSysDesc("N="SYSVIEW_APP_NAME",D="SYSVIEW_DEVICE_NAME",O=uCOS-II"); SEGGER_SYSVIEW_SendSysDesc("I#12=CMT0 Tmr IRQ (Tick)"); // SYSVIEW_SendResourceList(); } /********************************************************************* * * Global functions * ********************************************************************** */ void SEGGER_SYSVIEW_Conf(void) { SEGGER_SYSVIEW_Init(SYSVIEW_TIMESTAMP_FREQ, SYSVIEW_CPU_FREQ, &SYSVIEW_X_OS_TraceAPI, _cbSendSystemDesc); SEGGER_SYSVIEW_SetRAMBase(SYSVIEW_RAM_BASE); } #endif /*************************** End of file ****************************/