1# Copyright (c) 2024 Nordic Semiconductor ASA 2# SPDX-License-Identifier: Apache-2.0 3 4DT_COMPAT_NORDIC_NRF_TBM := nordic,nrf-tbm 5 6config DEBUG_NRF_ETR 7 bool "Coresight ETR handler (with Nordic TBM)" 8 depends on $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_TBM)) 9 select NRFX_TBM 10 imply UART_ASYNC_API 11 default y 12 help 13 Module handles data stored in the ETR circular buffer (e.g. STM logging 14 data). Busyness is tracked using TBM (Trace Buffer Monitor) peripheral 15 which is specific to Nordic Semiconductor SoCs. 16 17if DEBUG_NRF_ETR 18 19config DEBUG_NRF_ETR_DECODE 20 bool "Decode ETR content" 21 default y if LOG_FRONTEND_STMESP_FSC 22 select MIPI_STP_DECODER 23 select CS_TRACE_DEFMT 24 select LOG_FRONTEND_STMESP_DEMUX 25 select LOG_OUTPUT 26 imply LOG_BACKEND_SHOW_COLOR 27 imply CBPRINTF_FP_SUPPORT 28 help 29 In this mode, log messages stored by Coresight STM logging frontends are 30 decoded and printed in the human readable form. 31 32config DEBUG_NRF_ETR_DECODE_DROP_PERIOD 33 int "Period of dropped messages notification" 34 default 5000 35 help 36 Period (in milliseconds) how often it is checked if any dropped messages 37 have occurred. 38 39config DEBUG_NRF_ETR_DEBUG 40 bool "Debug mode" 41 depends on !LOG_PRINTK 42 select MIPI_STP_DECODER 43 select CS_TRACE_DEFMT 44 help 45 In debug mode STPv2 decoded data is printed. 46 47config DEBUG_NRF_ETR_STACK_SIZE 48 int "ETR thread stack size" 49 default 2048 if DEBUG_NRF_ETR_DECODE || DEBUG_NRF_ETR_DEBUG 50 default 1024 51 52config DEBUG_NRF_ETR_BACKOFF 53 int "Thread backoff time (ms)" 54 default 10 55 help 56 Determines how often attempt to dump the data is performed. 57 58config DEBUG_NRF_ETR_FLUSH_TIMEOUT 59 int "Backoff time during flushing (ms)" 60 default 100 61 help 62 When thread triggers flushing of ETR data, it periodically checks if 63 there is still a pending ETR data. This option specifies how often 64 thread is waking up to check. Given in milliseconds. 65 66config DEBUG_NRF_ETR_SYNC_PERIOD 67 int "Period of custom synchronization frame" 68 default 0 if DEBUG_NRF_ETR_DECODE 69 default 0 if DEBUG_NRF_ETR_DEBUG 70 default 16 71 help 72 To help find the synchronization when decoding the ETR content 73 by a host tool a synchronization pattern (16 bytes of 0xFF) can be 74 sent on regular intervals. This frame is sent between Coresight formatter 75 frames. Use 0 to disable. 76 77config DEBUG_NRF_ETR_SHELL 78 bool "Use shell" 79 select UART_ASYNC_API 80 select UART_ASYNC_RX_HELPER 81 select SHELL_LOG_BACKEND_CUSTOM 82 depends on DEBUG_NRF_ETR_DECODE 83 default y if SHELL 84 help 85 Enable shell with Coresight STM logging support. 86 87if DEBUG_NRF_ETR_SHELL 88 89config DEBUG_NRF_ETR_SHELL_PROMPT 90 string "Displayed prompt name" 91 default "uart:~$ " 92 help 93 Displayed prompt name for UART shell with Coresight STM logging. 94 95config DEBUG_NRF_ETR_SHELL_ASYNC_RX_BUFFER_SIZE 96 int "Size of the RX buffer" 97 default 16 98 help 99 Size of a single RX buffer. Together with buffer count it defines the 100 space that can hold RX data. It may be decreased if shell input is 101 slow and may need to be increased if long messages are pasted directly 102 to the shell prompt. 103 104config DEBUG_NRF_ETR_SHELL_ASYNC_RX_BUFFER_COUNT 105 int "Number of RX buffers" 106 default 4 107 range 2 64 108 help 109 Number of RX buffers. 110 111endif # DEBUG_NRF_ETR_SHELL 112 113endif # DEBUG_NRF_ETR 114 115menuconfig DEBUG_CORESIGHT_NRF 116 bool "Coresight Trace support" 117 default y 118 depends on DT_HAS_NORDIC_CORESIGHT_NRF_ENABLED 119 select PINCTRL 120 select IRONSIDE_SE_CALL 121 help 122 Support CoreSight peripherals in Test and Debug Domain for ARM 123 CoreSight System Trace Macrocell (STM) trace support. 124 125if DEBUG_CORESIGHT_NRF 126 127config DEBUG_CORESIGHT_NRF_ATB_TRACE_ID_STM_GLOBAL 128 def_hex 0x40 129 help 130 Global trace ID used by STM. 131 132config DEBUG_CORESIGHT_NRF_STM_SYNC_BYTE_COUNT 133 int "STM: Emit synhronization packet every N bytes" 134 range 0 4095 135 default 512 136 137config DEBUG_CORESIGHT_NRF_STM_HWEVENTS 138 bool "STM: Enable hardware events" 139 help 140 Enable the output of hardware events in STM. 141 142config DEBUG_CORESIGHT_NRF_TPIU_FFCR_TRIG 143 bool "TPIU: Use flush request trigger" 144 default y 145 help 146 Use CTI channel 1 for triggering flush request in TPIU. 147 148config DEBUG_CORESIGHT_NRF_TPIU_SYNC_FRAME_COUNT 149 int "TPIU: Emit synchronisation packet every N frames" 150 default 8 151 152config DEBUG_CORESIGHT_NRF_TPIU_PORTSIZE 153 int "TPIU: Size of the current TPIU port in bits" 154 range 1 32 155 default 4 156 157config DEBUG_CORESIGHT_NRF_ATBFUNNEL_HOLD_TIME 158 int "ATBFUNNEL: Hold time for the transaction" 159 range 1 15 160 default 4 161 help 162 Number of transactions that are output on the funnel master port from the 163 same slave. 164 165config DEBUG_CORESIGHT_NRF_TSGEN_CLK_DIV 166 int 167 default 8 168 help 169 Clock division factor for generating trace timestamps. The timestamp 170 counter should not be slower than 10% of the fastest processor clock 171 frequency in the system, therefore its clock speed is divided by 172 eight. 173 174module = DEBUG_CORESIGHT_NRF 175module-str = CoreSight Trace 176source "subsys/logging/Kconfig.template.log_config" 177 178endif # DEBUG_CORESIGHT_NRF 179