SEGGER_SYSVIEW_ConfDefaults.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588
  1. /*
  2. * SPDX-FileCopyrightText: 1995-2021 SEGGER Microcontroller GmbH
  3. *
  4. * SPDX-License-Identifier: BSD-1-Clause
  5. *
  6. * SPDX-FileContributor: 2023 Espressif Systems (Shanghai) CO LTD
  7. */
  8. /*********************************************************************
  9. * SEGGER Microcontroller GmbH *
  10. * The Embedded Experts *
  11. **********************************************************************
  12. * *
  13. * (c) 1995 - 2021 SEGGER Microcontroller GmbH *
  14. * *
  15. * www.segger.com Support: support@segger.com *
  16. * *
  17. **********************************************************************
  18. * *
  19. * SEGGER SystemView * Real-time application analysis *
  20. * *
  21. **********************************************************************
  22. * *
  23. * All rights reserved. *
  24. * *
  25. * SEGGER strongly recommends to not make any changes *
  26. * to or modify the source code of this software in order to stay *
  27. * compatible with the SystemView and RTT protocol, and J-Link. *
  28. * *
  29. * Redistribution and use in source and binary forms, with or *
  30. * without modification, are permitted provided that the following *
  31. * condition is met: *
  32. * *
  33. * o Redistributions of source code must retain the above copyright *
  34. * notice, this condition and the following disclaimer. *
  35. * *
  36. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND *
  37. * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, *
  38. * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF *
  39. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
  40. * DISCLAIMED. IN NO EVENT SHALL SEGGER Microcontroller BE LIABLE FOR *
  41. * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR *
  42. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT *
  43. * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; *
  44. * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
  45. * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
  46. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE *
  47. * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH *
  48. * DAMAGE. *
  49. * *
  50. **********************************************************************
  51. * *
  52. * SystemView version: 3.42 *
  53. * *
  54. **********************************************************************
  55. -------------------------- END-OF-HEADER -----------------------------
  56. File : SEGGER_SYSVIEW_ConfDefaults.h
  57. Purpose : Defines defaults for configurable defines used in
  58. SEGGER SystemView.
  59. Revision: $Rev: 26230 $
  60. */
  61. #ifndef SEGGER_SYSVIEW_CONFDEFAULTS_H
  62. #define SEGGER_SYSVIEW_CONFDEFAULTS_H
  63. /*********************************************************************
  64. *
  65. * #include Section
  66. *
  67. **********************************************************************
  68. */
  69. #include "SEGGER_SYSVIEW_Conf.h"
  70. #include "SEGGER_RTT_Conf.h"
  71. #ifdef __cplusplus
  72. extern "C" {
  73. #endif
  74. /*********************************************************************
  75. *
  76. * Defines, fixed
  77. *
  78. **********************************************************************
  79. */
  80. //
  81. // Use auto-detection for SEGGER_SYSVIEW_CORE define
  82. // based on compiler-/toolchain-specific defines
  83. // to define SEGGER_SYSVIEW_GET_INTERRUPT_ID and SEGGER_SYSVIEW_GET_TIMESTAMP
  84. //
  85. #define SEGGER_SYSVIEW_CORE_OTHER 0
  86. #define SEGGER_SYSVIEW_CORE_CM0 1 // Cortex-M0/M0+/M1
  87. #define SEGGER_SYSVIEW_CORE_CM3 2 // Cortex-M3/M4/M7
  88. #define SEGGER_SYSVIEW_CORE_RX 3 // Renesas RX
  89. #ifndef SEGGER_SYSVIEW_CORE
  90. #if (defined __SES_ARM) || (defined __CROSSWORKS_ARM) || (defined __SEGGER_CC__) || (defined __GNUC__) || (defined __clang__)
  91. #if (defined __ARM_ARCH_6M__) || (defined __ARM_ARCH_8M_BASE__)
  92. #define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_CM0
  93. #elif (defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_8M_MAIN__))
  94. #define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_CM3
  95. #endif
  96. #elif defined(__ICCARM__)
  97. #if (defined (__ARM6M__) && (__CORE__ == __ARM6M__)) \
  98. || (defined (__ARM8M_BASELINE__) && (__CORE__ == __ARM8M_BASELINE__))
  99. #define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_CM0
  100. #elif (defined (__ARM7EM__) && (__CORE__ == __ARM7EM__)) \
  101. || (defined (__ARM7M__) && (__CORE__ == __ARM7M__)) \
  102. || (defined (__ARM8M_MAINLINE__) && (__CORE__ == __ARM8M_MAINLINE__)) \
  103. || (defined (__ARM8M_MAINLINE__) && (__CORE__ == __ARM8M_MAINLINE__))
  104. #define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_CM3
  105. #endif
  106. #elif defined(__CC_ARM)
  107. #if (defined(__TARGET_ARCH_6S_M))
  108. #define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_CM0
  109. #elif (defined(__TARGET_ARCH_7_M) || defined(__TARGET_ARCH_7E_M))
  110. #define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_CM3
  111. #endif
  112. #elif defined(__TI_ARM__)
  113. #ifdef __TI_ARM_V6M0__
  114. #define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_CM0
  115. #elif (defined(__TI_ARM_V7M3__) || defined(__TI_ARM_V7M4__))
  116. #define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_CM3
  117. #endif
  118. #elif defined(__ICCRX__)
  119. #define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_RX
  120. #elif defined(__RX)
  121. #define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_RX
  122. #endif
  123. #ifndef SEGGER_SYSVIEW_CORE
  124. #define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_OTHER
  125. #endif
  126. #endif
  127. /*********************************************************************
  128. *
  129. * Defines, defaults
  130. *
  131. **********************************************************************
  132. */
  133. /*********************************************************************
  134. *
  135. * Define: SEGGER_SYSVIEW_APP_NAME
  136. *
  137. * Description
  138. * The application name to be displayed in SystemView.
  139. * Default
  140. * "SystemView-enabled Application"
  141. * Notes
  142. * Convenience define to be used for SEGGER_SYSVIEW_SendSysDesc().
  143. */
  144. #ifndef SEGGER_SYSVIEW_APP_NAME
  145. #define SEGGER_SYSVIEW_APP_NAME "SystemView-enabled Application"
  146. #endif
  147. /*********************************************************************
  148. *
  149. * Define: SEGGER_SYSVIEW_DEVICE_NAME
  150. *
  151. * Description
  152. * The target device name to be displayed in SystemView.
  153. * Default
  154. * "undefined device"
  155. * Notes
  156. * Convenience define to be used for SEGGER_SYSVIEW_SendSysDesc().
  157. */
  158. #ifndef SEGGER_SYSVIEW_DEVICE_NAME
  159. #define SEGGER_SYSVIEW_DEVICE_NAME "undefined device"
  160. #endif
  161. /*********************************************************************
  162. *
  163. * Define: SEGGER_SYSVIEW_GET_INTERRUPT_ID()
  164. *
  165. * Description
  166. * Function macro to retrieve the Id of the currently active
  167. * interrupt.
  168. * Default
  169. * Call user-supplied function SEGGER_SYSVIEW_X_GetInterruptId().
  170. * Notes
  171. * For some known compilers and cores, a ready-to-use, core-specific
  172. * default is set.
  173. * ARMv7M: Read ICSR[8:0] (active vector)
  174. * ARMv6M: Read ICSR[5:0] (active vector)
  175. */
  176. #ifndef SEGGER_SYSVIEW_GET_INTERRUPT_ID
  177. #if SEGGER_SYSVIEW_CORE == SEGGER_SYSVIEW_CORE_CM3
  178. #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)
  179. #elif SEGGER_SYSVIEW_CORE == SEGGER_SYSVIEW_CORE_CM0
  180. #if defined(__ICCARM__)
  181. #if (__VER__ > 6010000)
  182. #define SEGGER_SYSVIEW_GET_INTERRUPT_ID() (__get_IPSR()) // Workaround for IAR, which might do a byte-access to 0xE000ED04. Read IPSR instead.
  183. #else
  184. #define SEGGER_SYSVIEW_GET_INTERRUPT_ID() ((*(U32*)(0xE000ED04)) & 0x3F) // Older versions of IAR do not include __get_IPSR, but might also not optimize to byte-access.
  185. #endif
  186. #else
  187. #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)
  188. #endif
  189. #else
  190. #define SEGGER_SYSVIEW_GET_INTERRUPT_ID() SEGGER_SYSVIEW_X_GetInterruptId() // Get the currently active interrupt Id from the user-provided function.
  191. #endif
  192. #endif
  193. /*********************************************************************
  194. *
  195. * Define: SEGGER_SYSVIEW_GET_TIMESTAMP()
  196. *
  197. * Description
  198. * Function macro to retrieve a system timestamp for SYSVIEW events.
  199. * Default
  200. * Call user-supplied function SEGGER_SYSVIEW_X_GetTimestamp().
  201. * Notes
  202. * For some known compilers and cores, a ready-to-use, core-specific
  203. * default is set.
  204. * ARMv7M: Read Cortex-M Cycle Count register.
  205. *
  206. * The system timestamp clock frequency has to be passed in
  207. * SEGGER_SYSVIEW_Init().
  208. */
  209. #ifndef SEGGER_SYSVIEW_GET_TIMESTAMP
  210. #if defined (SEGGER_SYSVIEW_CORE) && (SEGGER_SYSVIEW_CORE == SEGGER_SYSVIEW_CORE_CM3)
  211. #define SEGGER_SYSVIEW_GET_TIMESTAMP() (*(U32 *)(0xE0001004)) // Retrieve a system timestamp. Cortex-M cycle counter.
  212. #else
  213. #define SEGGER_SYSVIEW_GET_TIMESTAMP() SEGGER_SYSVIEW_X_GetTimestamp() // Retrieve a system timestamp via user-defined function
  214. #endif
  215. #endif
  216. /*********************************************************************
  217. *
  218. * Define: SEGGER_SYSVIEW_TIMESTAMP_BITS
  219. *
  220. * Description
  221. * Number of valid (low-order) bits delivered in system timestamp.
  222. * Default
  223. * 32
  224. * Notes
  225. * Value has to match system timestamp clock source.
  226. */
  227. // Define number of valid bits low-order delivered by clock source.
  228. #ifndef SEGGER_SYSVIEW_TIMESTAMP_BITS
  229. #define SEGGER_SYSVIEW_TIMESTAMP_BITS 32
  230. #endif
  231. /*********************************************************************
  232. *
  233. * Define: SEGGER_SYSVIEW_RTT_CHANNEL
  234. *
  235. * Description
  236. * The RTT channel that SystemView will use.
  237. * Default
  238. * 0: Auto selection.
  239. * Notes
  240. * Value has to be lower than SEGGER_RTT_MAX_NUM_UP_BUFFERS.
  241. */
  242. #ifndef SEGGER_SYSVIEW_RTT_CHANNEL
  243. #define SEGGER_SYSVIEW_RTT_CHANNEL 1
  244. #endif
  245. // Sanity check of RTT channel
  246. #if (SEGGER_SYSVIEW_RTT_CHANNEL == 0) && (SEGGER_RTT_MAX_NUM_UP_BUFFERS < 2)
  247. #error "SEGGER_RTT_MAX_NUM_UP_BUFFERS in SEGGER_RTT_Conf.h has to be > 1!"
  248. #elif (SEGGER_SYSVIEW_RTT_CHANNEL >= SEGGER_RTT_MAX_NUM_UP_BUFFERS)
  249. #error "SEGGER_RTT_MAX_NUM_UP_BUFFERS in SEGGER_RTT_Conf.h has to be > SEGGER_SYSVIEW_RTT_CHANNEL!"
  250. #endif
  251. /*********************************************************************
  252. *
  253. * Define: SEGGER_SYSVIEW_RTT_BUFFER_SIZE
  254. *
  255. * Description
  256. * Number of bytes that SystemView uses for the RTT buffer.
  257. * Default
  258. * 1024
  259. */
  260. #ifndef SEGGER_SYSVIEW_RTT_BUFFER_SIZE
  261. #define SEGGER_SYSVIEW_RTT_BUFFER_SIZE 1024
  262. #endif
  263. /*********************************************************************
  264. *
  265. * Define: SEGGER_SYSVIEW_SECTION
  266. *
  267. * Description
  268. * Section to place the SystemView RTT Buffer into.
  269. * Default
  270. * undefined: Do not place into a specific section.
  271. * Notes
  272. * If SEGGER_RTT_SECTION is defined, the default changes to use
  273. * this section for the SystemView RTT Buffer, too.
  274. */
  275. #if !(defined SEGGER_SYSVIEW_SECTION) && (defined SEGGER_RTT_SECTION)
  276. #define SEGGER_SYSVIEW_SECTION SEGGER_RTT_SECTION
  277. #endif
  278. /*********************************************************************
  279. *
  280. * Define: SEGGER_SYSVIEW_CPU_CACHE_LINE_SIZE
  281. *
  282. * Description
  283. * Largest cache line size (in bytes) in the target system.
  284. * Default
  285. * 0
  286. * Notes
  287. * Required in systems with caches to make sure that the SystemView
  288. * RTT buffer can be aligned accordingly.
  289. */
  290. #ifndef SEGGER_SYSVIEW_CPU_CACHE_LINE_SIZE
  291. #define SEGGER_SYSVIEW_CPU_CACHE_LINE_SIZE 0
  292. #endif
  293. /*********************************************************************
  294. *
  295. * Define: SEGGER_SYSVIEW_ID_BASE
  296. *
  297. * Description
  298. * Lowest Id reported by the application.
  299. * Default
  300. * 0
  301. * Notes
  302. * Value is usually subtracted from mailboxes, semaphores, tasks,
  303. * .... addresses, to compress event parameters.
  304. * Should be the lowest RAM address of the system.
  305. */
  306. #ifndef SEGGER_SYSVIEW_ID_BASE
  307. #define SEGGER_SYSVIEW_ID_BASE 0
  308. #endif
  309. /*********************************************************************
  310. *
  311. * Define: SEGGER_SYSVIEW_ID_SHIFT
  312. *
  313. * Description
  314. * Number of bits to shift Ids.
  315. * Default
  316. * 0
  317. * Notes
  318. * Ids are shifted to compress event parameters.
  319. * Should match the alignment of Ids (addresses),
  320. * e.g. 2 when Ids are 4 byte aligned.
  321. */
  322. #ifndef SEGGER_SYSVIEW_ID_SHIFT
  323. #define SEGGER_SYSVIEW_ID_SHIFT 0
  324. #endif
  325. /*********************************************************************
  326. *
  327. * Define: SEGGER_SYSVIEW_MAX_ARGUMENTS
  328. *
  329. * Description
  330. * Maximum number of arguments which are handled with SystemView
  331. * print routines or may be encoded in one recording function.
  332. * routines.
  333. * Default
  334. * 16
  335. */
  336. #ifndef SEGGER_SYSVIEW_MAX_ARGUMENTS
  337. #define SEGGER_SYSVIEW_MAX_ARGUMENTS 16
  338. #endif
  339. /*********************************************************************
  340. *
  341. * Define: SEGGER_SYSVIEW_MAX_STRING_LEN
  342. *
  343. * Description
  344. * Maximum string length which can be used in SystemView print and
  345. * system description routines.
  346. * Default
  347. * 128
  348. */
  349. #ifndef SEGGER_SYSVIEW_MAX_STRING_LEN
  350. #define SEGGER_SYSVIEW_MAX_STRING_LEN 128
  351. #endif
  352. /*********************************************************************
  353. *
  354. * Define: SEGGER_SYSVIEW_SUPPORT_LONG_ID
  355. *
  356. * Description
  357. * It set, support enconding Evend Ids longer than 14 bit.
  358. * Default
  359. * 1
  360. */
  361. #ifndef SEGGER_SYSVIEW_SUPPORT_LONG_ID
  362. #define SEGGER_SYSVIEW_SUPPORT_LONG_ID 1
  363. #endif
  364. /*********************************************************************
  365. *
  366. * Define: SEGGER_SYSVIEW_SUPPORT_LONG_DATA
  367. *
  368. * Description
  369. * It set, support enconding event data longer than 14 bit.
  370. * Default
  371. * 0
  372. */
  373. #ifndef SEGGER_SYSVIEW_SUPPORT_LONG_DATA
  374. #define SEGGER_SYSVIEW_SUPPORT_LONG_DATA 0
  375. #endif
  376. /*********************************************************************
  377. *
  378. * Define: SEGGER_SYSVIEW_PRINTF_IMPLICIT_FORMAT
  379. *
  380. * Description
  381. * If enabled, on SEGGER_SYSVIEW_PrintHost, check the format string
  382. * and if it includes unsupported formatters, use formatting on the
  383. * target instead.
  384. * Default
  385. * 0: Disabled.
  386. */
  387. #ifndef SEGGER_SYSVIEW_PRINTF_IMPLICIT_FORMAT
  388. #define SEGGER_SYSVIEW_PRINTF_IMPLICIT_FORMAT 0
  389. #endif
  390. /*********************************************************************
  391. *
  392. * Define: SEGGER_SYSVIEW_USE_INTERNAL_RECORDER
  393. *
  394. * Description
  395. * If set, an internal recorder, such as UART or IP is used.
  396. * Default
  397. * 0: Disabled.
  398. * Notes
  399. * Convenience define to be used by SEGGER_SYSVIEW_Conf(),
  400. * such as in embOS configuration to enable Cortex-M cycle counter.
  401. */
  402. #ifndef SEGGER_SYSVIEW_USE_INTERNAL_RECORDER
  403. #define SEGGER_SYSVIEW_USE_INTERNAL_RECORDER 0
  404. #endif
  405. /*********************************************************************
  406. *
  407. * Define: SEGGER_SYSVIEW_CAN_RESTART
  408. *
  409. * Description
  410. * If enabled, send the SystemView start sequence on every start
  411. * command, not just on the first one.
  412. * Enables restart when SystemView disconnected unexpectedly.
  413. * Default
  414. * 1: Enabled
  415. */
  416. #ifndef SEGGER_SYSVIEW_CAN_RESTART
  417. #define SEGGER_SYSVIEW_CAN_RESTART 1
  418. #endif
  419. /*********************************************************************
  420. *
  421. * Define: SEGGER_SYSVIEW_START_ON_INIT
  422. *
  423. * Description
  424. * Enable calling SEGGER_SYSVIEW_Start() after initialization.
  425. * Default
  426. * 0: Disabled.
  427. * Notes
  428. * Convenience define to be used by SEGGER_SYSVIEW_Conf(),
  429. * such as in embOS configuration.
  430. */
  431. #ifndef SEGGER_SYSVIEW_START_ON_INIT
  432. #define SEGGER_SYSVIEW_START_ON_INIT 0
  433. #endif
  434. /*********************************************************************
  435. *
  436. * Define: SEGGER_SYSVIEW_USE_STATIC_BUFFER
  437. *
  438. * Description
  439. * If enabled, use a static buffer instead of a buffer on the stack
  440. * for SystemView event packets.
  441. * Default
  442. * 1: Enabled.
  443. * Notes
  444. * If enabled, the static memory use by SystemView is increased by
  445. * the maximum packet size. SystemView is locked on entry of a
  446. * recording function.
  447. * If disabled, the stack usage by SystemView recording functions
  448. * might be increased by up to the maximum packet size. SystemView
  449. * is locked when writing the packet to the RTT buffer.
  450. */
  451. #ifndef SEGGER_SYSVIEW_USE_STATIC_BUFFER
  452. #define SEGGER_SYSVIEW_USE_STATIC_BUFFER 1
  453. #endif
  454. /*********************************************************************
  455. *
  456. * Define: SEGGER_SYSVIEW_MAX_PACKET_SIZE
  457. *
  458. * Description
  459. * Maximum packet size for a SystemView event.
  460. * Default
  461. * Automatically calculated.
  462. * Notes
  463. * The maximum packet size is mainly defined by the maximum string
  464. * length and the maximum number of arguments.
  465. */
  466. #ifndef SEGGER_SYSVIEW_MAX_PACKET_SIZE
  467. #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)
  468. #endif
  469. /*********************************************************************
  470. *
  471. * Define: SEGGER_SYSVIEW_POST_MORTEM_MODE
  472. *
  473. * Description
  474. * If enabled, SystemView records for post-mortem analysis instead
  475. * of real-time analysis.
  476. * Default
  477. * 0: Disabled.
  478. * Notes
  479. * For more information refer to
  480. * https://www.segger.com/products/development-tools/systemview/technology/post-mortem-mode
  481. */
  482. #ifndef SEGGER_SYSVIEW_POST_MORTEM_MODE
  483. #define SEGGER_SYSVIEW_POST_MORTEM_MODE 0
  484. #endif
  485. /*********************************************************************
  486. *
  487. * Define: SEGGER_SYSVIEW_SYNC_PERIOD_SHIFT
  488. *
  489. * Description
  490. * Configure how frequently syncronization is sent in post-mortem
  491. * mode.
  492. * Default
  493. * 8: (1 << 8) = Every 256 Events.
  494. * Notes
  495. * In post-mortem mode, at least one sync has to be in the RTT buffer.
  496. * Recommended sync frequency: Buffer Size / 16
  497. * For more information refer to
  498. * https://www.segger.com/products/development-tools/systemview/technology/post-mortem-mode
  499. */
  500. #ifndef SEGGER_SYSVIEW_SYNC_PERIOD_SHIFT
  501. #define SEGGER_SYSVIEW_SYNC_PERIOD_SHIFT 8
  502. #endif
  503. /*********************************************************************
  504. *
  505. * Define: SEGGER_SYSVIEW_ON_EVENT_RECORDED()
  506. *
  507. * Description
  508. * Function macro to notify recorder about a new event in buffer.
  509. * Default
  510. * undefined: Do not notify recorder.
  511. * Notes
  512. * Used for non-J-Link recorder,
  513. * such as to enable transmission via UART or notify IP task.
  514. */
  515. #ifndef SEGGER_SYSVIEW_ON_EVENT_RECORDED
  516. #define SEGGER_SYSVIEW_ON_EVENT_RECORDED(NumBytes)
  517. #endif
  518. /*********************************************************************
  519. *
  520. * Define: SEGGER_SYSVIEW_LOCK()
  521. *
  522. * Description
  523. * Function macro to (nestable) lock SystemView recording.
  524. * Default
  525. * Use RTT Locking mechanism (defined by SEGGER_RTT_LOCK()).
  526. * Notes
  527. * If SystemView recording is not locked, recording events from
  528. * interrupts and tasks may lead to unpredictable, undefined, event
  529. * data.
  530. */
  531. #ifndef SEGGER_SYSVIEW_LOCK
  532. unsigned SEGGER_SYSVIEW_X_SysView_Lock(void);
  533. #define SEGGER_SYSVIEW_LOCK() unsigned _SYSVIEW_int_state = SEGGER_SYSVIEW_X_SysView_Lock()
  534. #endif
  535. /*********************************************************************
  536. *
  537. * Define: SEGGER_SYSVIEW_UNLOCK
  538. *
  539. * Description
  540. * Function macro to unlock SystemView recording.
  541. * Default
  542. * Use RTT Unlocking mechanism (defined by SEGGER_RTT_UNLOCK()).
  543. */
  544. #ifndef SEGGER_SYSVIEW_UNLOCK
  545. void SEGGER_SYSVIEW_X_SysView_Unlock(unsigned int_state);
  546. #define SEGGER_SYSVIEW_UNLOCK() SEGGER_SYSVIEW_X_SysView_Unlock(_SYSVIEW_int_state)
  547. #endif
  548. #ifdef __cplusplus
  549. }
  550. #endif
  551. #endif
  552. /*************************** End of file ****************************/