SEGGER_SYSVIEW_Conf.h 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. /*********************************************************************
  2. * SEGGER MICROCONTROLLER GmbH & Co. KG *
  3. * Solutions for real time microcontroller applications *
  4. **********************************************************************
  5. * *
  6. * (c) 2015 - 2016 SEGGER Microcontroller GmbH & Co. KG *
  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. * * This software may in its unmodified form be freely redistributed *
  19. * in source form. *
  20. * * The source code may be modified, provided the source code *
  21. * retains the above copyright notice, this list of conditions and *
  22. * the following disclaimer. *
  23. * * Modified versions of this software in source or linkable form *
  24. * may not be distributed without prior consent of SEGGER. *
  25. * *
  26. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS "AS IS" AND *
  27. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, *
  28. * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
  29. * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL *
  30. * SEGGER Microcontroller BE LIABLE FOR ANY DIRECT, INDIRECT, *
  31. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
  32. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS *
  33. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS *
  34. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, *
  35. * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
  36. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
  37. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
  38. * *
  39. **********************************************************************
  40. * *
  41. * SystemView version: V2.40 *
  42. * *
  43. **********************************************************************
  44. -------------------------- END-OF-HEADER -----------------------------
  45. File : SEGGER_SYSVIEW_Conf.h
  46. Purpose : SEGGER SystemView configuration.
  47. Revision: $Rev: 3734 $
  48. */
  49. #ifndef SEGGER_SYSVIEW_CONF_H
  50. #define SEGGER_SYSVIEW_CONF_H
  51. /*********************************************************************
  52. *
  53. * Defines, fixed
  54. *
  55. **********************************************************************
  56. */
  57. //
  58. // Constants for known core configuration
  59. //
  60. #define SEGGER_SYSVIEW_CORE_OTHER 0
  61. #define SEGGER_SYSVIEW_CORE_CM0 1 // Cortex-M0/M0+/M1
  62. #define SEGGER_SYSVIEW_CORE_CM3 2 // Cortex-M3/M4/M7
  63. #define SEGGER_SYSVIEW_CORE_RX 3 // Renesas RX
  64. #if (defined __SES_ARM) || (defined __CROSSWORKS_ARM) || (defined __GNUC__)
  65. #ifdef __ARM_ARCH_6M__
  66. #define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_CM0
  67. #elif (defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__))
  68. #define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_CM3
  69. #endif
  70. #elif defined(__ICCARM__)
  71. #if (defined (__ARM6M__) && (__CORE__ == __ARM6M__))
  72. #define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_CM0
  73. #elif ((defined (__ARM7M__) && (__CORE__ == __ARM7M__)) || (defined (__ARM7EM__) && (__CORE__ == __ARM7EM__)))
  74. #define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_CM3
  75. #endif
  76. #elif defined(__CC_ARM)
  77. #if (defined(__TARGET_ARCH_6S_M))
  78. #define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_CM0
  79. #elif (defined(__TARGET_ARCH_7_M) || defined(__TARGET_ARCH_7E_M))
  80. #define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_CM3
  81. #endif
  82. #elif defined(__ICCRX__)
  83. #define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_RX
  84. #elif defined(__RX)
  85. #define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_RX
  86. #endif
  87. #ifndef SEGGER_SYSVIEW_CORE
  88. #define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_OTHER
  89. #endif
  90. /*********************************************************************
  91. *
  92. * Defines, configurable
  93. *
  94. **********************************************************************
  95. */
  96. /*********************************************************************
  97. *
  98. * SystemView buffer configuration
  99. */
  100. #define SEGGER_SYSVIEW_RTT_BUFFER_SIZE 1024 // Number of bytes that SystemView uses for the buffer.
  101. #define SEGGER_SYSVIEW_RTT_CHANNEL 1 // The RTT channel that SystemView will use. 0: Auto selection
  102. #define SEGGER_SYSVIEW_USE_STATIC_BUFFER 1 // Use a static buffer to generate events instead of a buffer on the stack
  103. #define SEGGER_SYSVIEW_POST_MORTEM_MODE 0 // 1: Enable post mortem analysis mode
  104. /*********************************************************************
  105. *
  106. * SystemView timestamp configuration
  107. */
  108. #if SEGGER_SYSVIEW_CORE == SEGGER_SYSVIEW_CORE_CM3
  109. #define SEGGER_SYSVIEW_GET_TIMESTAMP() (*(U32 *)(0xE0001004)) // Retrieve a system timestamp. Cortex-M cycle counter.
  110. #define SEGGER_SYSVIEW_TIMESTAMP_BITS 32 // Define number of valid bits low-order delivered by clock source
  111. #else
  112. #define SEGGER_SYSVIEW_GET_TIMESTAMP() SEGGER_SYSVIEW_X_GetTimestamp() // Retrieve a system timestamp via user-defined function
  113. #define SEGGER_SYSVIEW_TIMESTAMP_BITS 32 // Define number of valid bits low-order delivered by SEGGER_SYSVIEW_X_GetTimestamp()
  114. #endif
  115. /*********************************************************************
  116. *
  117. * SystemView Id configuration
  118. */
  119. #define SEGGER_SYSVIEW_ID_BASE 0x10000000 // Default value for the lowest Id reported by the application. Can be overridden by the application via SEGGER_SYSVIEW_SetRAMBase(). (i.e. 0x20000000 when all Ids are an address in this RAM)
  120. #define SEGGER_SYSVIEW_ID_SHIFT 2 // Number of bits to shift the Id to save bandwidth. (i.e. 2 when Ids are 4 byte aligned)
  121. /*********************************************************************
  122. *
  123. * SystemView interrupt configuration
  124. */
  125. #if SEGGER_SYSVIEW_CORE == SEGGER_SYSVIEW_CORE_CM3
  126. #define SEGGER_SYSVIEW_GET_INTERRUPT_ID() ((*(U32 *)(0xE000ED04)) & 0x1FF) // Get the currently active interrupt Id. (i.e. read Cortex-M ICSR[8:0] = active vector)
  127. #elif SEGGER_SYSVIEW_CORE == SEGGER_SYSVIEW_CORE_CM0
  128. #define SEGGER_SYSVIEW_GET_INTERRUPT_ID() ((*(U32 *)(0xE000ED04)) & 0x3F) // Get the currently active interrupt Id. (i.e. read Cortex-M ICSR[5:0] = active vector)
  129. #else
  130. #define SEGGER_SYSVIEW_GET_INTERRUPT_ID() SEGGER_SYSVIEW_X_GetInterruptId() // Get the currently active interrupt Id from the user-provided function.
  131. #endif
  132. #endif // SEGGER_SYSVIEW_CONF_H
  133. /*************************** End of file ****************************/