Skip to content

Commit ea552da

Browse files
nordic-krchrlubos
authored andcommitted
[nrf fromlist] drivers: debug: coresight_nrf: Fix setting Trace ID
Mask STM_STMTCSR_TRACEID_Msk is already bit shifted so Kconfig value should first be shifted and then masked. The way it was done previously resulted in TraceID being cleared. Upstream PR #: 107595 Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
1 parent 6042d5e commit ea552da

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/debug/debug_coresight_nrf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ static void nrf_stm_init(void)
134134
sys_write32((1 << STM_STMHEMCR_EN_Pos), stm + STM_STMHEMCR_OFFSET);
135135
}
136136

137-
sys_write32(((CONFIG_DEBUG_CORESIGHT_NRF_ATB_TRACE_ID_STM_GLOBAL & STM_STMTCSR_TRACEID_Msk)
138-
<< STM_STMTCSR_TRACEID_Pos) |
137+
sys_write32(((CONFIG_DEBUG_CORESIGHT_NRF_ATB_TRACE_ID_STM_GLOBAL << STM_STMTCSR_TRACEID_Pos)
138+
& STM_STMTCSR_TRACEID_Msk) |
139139
(1 << STM_STMTCSR_EN_Pos) | (1 << STM_STMTCSR_TSEN_Pos),
140140
stm + STM_STMTCSR_OFFSET);
141141

0 commit comments

Comments
 (0)