Skip to content

Commit cdb6bff

Browse files
mnkpcfriedt
authored andcommitted
soc: same70, samv71: free TRACESWO pin when unused
Pin PB5 is part of ARM Cortex-M debug interface and by default configured to output TDO/TRACESWO signal. Disable TDO/TRACESWO function on PB5 pin when LOG_BACKEND_SWO is not enabled. This ultimately frees the pin to be used by standard SoC peripherals. Signed-off-by: Piotr Mienkowski <[email protected]>
1 parent 8a4e489 commit cdb6bff

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

soc/arm/atmel_sam/same70/soc_config.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ static int atmel_same70_config(const struct device *dev)
4949
while (!((PMC->PMC_SR) & PMC_SR_PCKRDY3)) {
5050
;
5151
}
52+
/* Enable TDO/TRACESWO function on PB5 pin */
53+
MATRIX->CCFG_SYSIO &= ~CCFG_SYSIO_SYSIO5;
54+
#else
55+
/* Disable TDO/TRACESWO function on PB5 pin */
56+
MATRIX->CCFG_SYSIO |= CCFG_SYSIO_SYSIO5;
5257
#endif
5358

5459
return 0;

soc/arm/atmel_sam/samv71/soc_config.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ static int atmel_samv71_config(const struct device *dev)
5353
while (!((PMC->PMC_SR) & PMC_SR_PCKRDY3)) {
5454
;
5555
}
56+
/* Enable TDO/TRACESWO function on PB5 pin */
57+
MATRIX->CCFG_SYSIO &= ~CCFG_SYSIO_SYSIO5;
58+
#else
59+
/* Disable TDO/TRACESWO function on PB5 pin */
60+
MATRIX->CCFG_SYSIO |= CCFG_SYSIO_SYSIO5;
5661
#endif
5762

5863
return 0;

0 commit comments

Comments
 (0)