SEGGER_SYSVIEW_ConfDefaults.h 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. /*********************************************************************
  2. * SEGGER Microcontroller GmbH & Co. KG *
  3. * The Embedded Experts *
  4. **********************************************************************
  5. * *
  6. * (c) 2015 - 2017 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. * 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 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. * conditions are met: *
  25. * *
  26. * o Redistributions of source code must retain the above copyright *
  27. * notice, this list of conditions and the following disclaimer. *
  28. * *
  29. * o Redistributions in binary form must reproduce the above *
  30. * copyright notice, this list of conditions and the following *
  31. * disclaimer in the documentation and/or other materials provided *
  32. * with the distribution. *
  33. * *
  34. * o Neither the name of SEGGER Microcontroller GmbH & Co. KG *
  35. * nor the names of its contributors may be used to endorse or *
  36. * promote products derived from this software without specific *
  37. * prior written permission. *
  38. * *
  39. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND *
  40. * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, *
  41. * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF *
  42. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
  43. * DISCLAIMED. IN NO EVENT SHALL SEGGER Microcontroller BE LIABLE FOR *
  44. * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR *
  45. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT *
  46. * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; *
  47. * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
  48. * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
  49. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE *
  50. * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH *
  51. * DAMAGE. *
  52. * *
  53. **********************************************************************
  54. * *
  55. * SystemView version: V2.42 *
  56. * *
  57. **********************************************************************
  58. -------------------------- END-OF-HEADER -----------------------------
  59. File : SEGGER_SYSVIEW_ConfDefaults.h
  60. Purpose : Defines defaults for configurable defines used in
  61. SEGGER SystemView.
  62. Revision: $Rev: 3734 $
  63. */
  64. #ifndef SEGGER_SYSVIEW_CONFDEFAULTS_H
  65. #define SEGGER_SYSVIEW_CONFDEFAULTS_H
  66. /*********************************************************************
  67. *
  68. * #include Section
  69. *
  70. **********************************************************************
  71. */
  72. #include "SEGGER_SYSVIEW_Conf.h"
  73. #include "SEGGER_RTT_Conf.h"
  74. #ifdef __cplusplus
  75. extern "C" {
  76. #endif
  77. /*********************************************************************
  78. *
  79. * Configuration defaults
  80. *
  81. **********************************************************************
  82. */
  83. // Number of bytes that SystemView uses for a buffer.
  84. #ifndef SEGGER_SYSVIEW_RTT_BUFFER_SIZE
  85. #define SEGGER_SYSVIEW_RTT_BUFFER_SIZE 1024
  86. #endif
  87. // The RTT channel that SystemView will use.
  88. #ifndef SEGGER_SYSVIEW_RTT_CHANNEL
  89. #define SEGGER_SYSVIEW_RTT_CHANNEL 0
  90. #endif
  91. // Sanity check of RTT channel
  92. #if (SEGGER_SYSVIEW_RTT_CHANNEL == 0) && (SEGGER_RTT_MAX_NUM_UP_BUFFERS < 2)
  93. #error "SEGGER_RTT_MAX_NUM_UP_BUFFERS in SEGGER_RTT_Conf.h has to be > 1!"
  94. #elif (SEGGER_SYSVIEW_RTT_CHANNEL >= SEGGER_RTT_MAX_NUM_UP_BUFFERS)
  95. #error "SEGGER_RTT_MAX_NUM_UP_BUFFERS in SEGGER_RTT_Conf.h has to be > SEGGER_SYSVIEW_RTT_CHANNEL!"
  96. #endif
  97. // Place the SystemView buffer into its own/the RTT section
  98. #if !(defined SEGGER_SYSVIEW_BUFFER_SECTION) && (defined SEGGER_RTT_SECTION)
  99. #define SEGGER_SYSVIEW_BUFFER_SECTION SEGGER_RTT_SECTION
  100. #endif
  101. // Retrieve a system timestamp. This gets the Cortex-M cycle counter.
  102. #ifndef SEGGER_SYSVIEW_GET_TIMESTAMP
  103. #error "SEGGER_SYSVIEW_GET_TIMESTAMP has to be defined in SEGGER_SYSVIEW_Conf.h!"
  104. #endif
  105. // Define number of valid bits low-order delivered by clock source.
  106. #ifndef SEGGER_SYSVIEW_TIMESTAMP_BITS
  107. #define SEGGER_SYSVIEW_TIMESTAMP_BITS 32
  108. #endif
  109. // Lowest Id reported by the Application.
  110. #ifndef SEGGER_SYSVIEW_ID_BASE
  111. #define SEGGER_SYSVIEW_ID_BASE 0
  112. #endif
  113. // Number of bits to shift Ids to save bandwidth
  114. #ifndef SEGGER_SYSVIEW_ID_SHIFT
  115. #define SEGGER_SYSVIEW_ID_SHIFT 0
  116. #endif
  117. #ifndef SEGGER_SYSVIEW_GET_INTERRUPT_ID
  118. #error "SEGGER_SYSVIEW_GET_INTERRUPT_ID has to be defined in SEGGER_SYSVIEW_Conf.h!"
  119. #endif
  120. #ifndef SEGGER_SYSVIEW_MAX_ARGUMENTS
  121. #define SEGGER_SYSVIEW_MAX_ARGUMENTS 16
  122. #endif
  123. #ifndef SEGGER_SYSVIEW_MAX_STRING_LEN
  124. #define SEGGER_SYSVIEW_MAX_STRING_LEN 128
  125. #endif
  126. // Use a static buffer instead of a buffer on the stack for packets
  127. #ifndef SEGGER_SYSVIEW_USE_STATIC_BUFFER
  128. #define SEGGER_SYSVIEW_USE_STATIC_BUFFER 1
  129. #endif
  130. // Maximum packet size used by SystemView for the static buffer
  131. #ifndef SEGGER_SYSVIEW_MAX_PACKET_SIZE
  132. #define SEGGER_SYSVIEW_MAX_PACKET_SIZE SEGGER_SYSVIEW_INFO_SIZE + SEGGER_SYSVIEW_MAX_STRING_LEN + 2 * SEGGER_SYSVIEW_QUANTA_U32 + SEGGER_SYSVIEW_MAX_ARGUMENTS * SEGGER_SYSVIEW_QUANTA_U32
  133. #endif
  134. // Use post-mortem analysis instead of real-time analysis
  135. #ifndef SEGGER_SYSVIEW_POST_MORTEM_MODE
  136. #define SEGGER_SYSVIEW_POST_MORTEM_MODE 0
  137. #endif
  138. // Configure how frequently syncronization is sent
  139. #ifndef SEGGER_SYSVIEW_SYNC_PERIOD_SHIFT
  140. #define SEGGER_SYSVIEW_SYNC_PERIOD_SHIFT 8
  141. #endif
  142. // Lock SystemView (nestable)
  143. #ifndef SEGGER_SYSVIEW_LOCK
  144. #define SEGGER_SYSVIEW_LOCK() SEGGER_RTT_LOCK()
  145. #endif
  146. // Unlock SystemView (nestable)
  147. #ifndef SEGGER_SYSVIEW_UNLOCK
  148. #define SEGGER_SYSVIEW_UNLOCK() SEGGER_RTT_UNLOCK()
  149. #endif
  150. #ifdef __cplusplus
  151. }
  152. #endif
  153. #endif
  154. /*************************** End of file ****************************/