SEGGER_SYSVIEW_Config_FreeRTOS.c 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /*********************************************************************
  2. * SEGGER Microcontroller GmbH *
  3. * The Embedded Experts *
  4. **********************************************************************
  5. * *
  6. * (c) 1995 - 2021 SEGGER Microcontroller GmbH *
  7. * *
  8. * www.segger.com Support: support@segger.com *
  9. * *
  10. **********************************************************************
  11. * *
  12. * SEGGER SystemView * Real-time application analysis *
  13. * *
  14. **********************************************************************
  15. * *
  16. * All rights reserved. *
  17. * *
  18. * SEGGER strongly recommends to not make any changes *
  19. * to or modify the source code of this software in order to stay *
  20. * compatible with the SystemView and RTT protocol, and J-Link. *
  21. * *
  22. * Redistribution and use in source and binary forms, with or *
  23. * without modification, are permitted provided that the following *
  24. * condition is met: *
  25. * *
  26. * o Redistributions of source code must retain the above copyright *
  27. * notice, this condition and the following disclaimer. *
  28. * *
  29. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND *
  30. * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, *
  31. * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF *
  32. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
  33. * DISCLAIMED. IN NO EVENT SHALL SEGGER Microcontroller BE LIABLE FOR *
  34. * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR *
  35. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT *
  36. * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; *
  37. * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
  38. * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
  39. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE *
  40. * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH *
  41. * DAMAGE. *
  42. * *
  43. **********************************************************************
  44. * *
  45. * SystemView version: 3.32 *
  46. * *
  47. **********************************************************************
  48. -------------------------- END-OF-HEADER -----------------------------
  49. File : SEGGER_SYSVIEW_Config_FreeRTOS.c
  50. Purpose : Sample setup configuration of SystemView with FreeRTOS.
  51. Revision: $Rev: 7745 $
  52. */
  53. #include "FreeRTOS.h"
  54. #include "SEGGER_SYSVIEW.h"
  55. extern const SEGGER_SYSVIEW_OS_API SYSVIEW_X_OS_TraceAPI;
  56. /*********************************************************************
  57. *
  58. * Defines, configurable
  59. *
  60. **********************************************************************
  61. */
  62. // The application name to be displayed in SystemViewer
  63. #define SYSVIEW_APP_NAME "FreeRTOS Demo Application"
  64. // The target device name
  65. #define SYSVIEW_DEVICE_NAME "Cortex-M4"
  66. // Frequency of the timestamp. Must match SEGGER_SYSVIEW_GET_TIMESTAMP in SEGGER_SYSVIEW_Conf.h
  67. #define SYSVIEW_TIMESTAMP_FREQ (configCPU_CLOCK_HZ)
  68. // System Frequency. SystemcoreClock is used in most CMSIS compatible projects.
  69. #define SYSVIEW_CPU_FREQ configCPU_CLOCK_HZ
  70. // The lowest RAM address used for IDs (pointers)
  71. #define SYSVIEW_RAM_BASE (0x10000000)
  72. /*********************************************************************
  73. *
  74. * _cbSendSystemDesc()
  75. *
  76. * Function description
  77. * Sends SystemView description strings.
  78. */
  79. static void _cbSendSystemDesc(void) {
  80. SEGGER_SYSVIEW_SendSysDesc("N="SYSVIEW_APP_NAME",D="SYSVIEW_DEVICE_NAME",O=FreeRTOS");
  81. SEGGER_SYSVIEW_SendSysDesc("I#15=SysTick");
  82. }
  83. /*********************************************************************
  84. *
  85. * Global functions
  86. *
  87. **********************************************************************
  88. */
  89. void SEGGER_SYSVIEW_Conf(void) {
  90. SEGGER_SYSVIEW_Init(SYSVIEW_TIMESTAMP_FREQ, SYSVIEW_CPU_FREQ,
  91. &SYSVIEW_X_OS_TraceAPI, _cbSendSystemDesc);
  92. SEGGER_SYSVIEW_SetRAMBase(SYSVIEW_RAM_BASE);
  93. }
  94. /*************************** End of file ****************************/