25 #if defined( BSP_ETM_TRACE ) && defined( ETM_PRESENT )
27 #if !defined(BSP_TRACE_ETM_CLKLOC)
28 #define BSP_TRACE_ETM_CLKLOC 0
30 #if !defined(BSP_TRACE_ETM_TD0LOC)
31 #define BSP_TRACE_ETM_TD0LOC 0
33 #if !defined(BSP_TRACE_ETM_TD1LOC)
34 #define BSP_TRACE_ETM_TD1LOC 0
36 #if !defined(BSP_TRACE_ETM_TD2LOC)
37 #define BSP_TRACE_ETM_TD2LOC 0
39 #if !defined(BSP_TRACE_ETM_TD3LOC)
40 #define BSP_TRACE_ETM_TD3LOC 0
47 void BSP_TraceEtmSetup(
void)
55 #if defined(_GPIO_ROUTE_TCLKPEN_MASK)
65 GPIO->ROUTE =
GPIO->ROUTE | GPIO_ROUTE_TCLKPEN | GPIO_ROUTE_TD0PEN | GPIO_ROUTE_TD1PEN
66 | GPIO_ROUTE_TD2PEN | GPIO_ROUTE_TD3PEN
67 | GPIO_ROUTE_ETMLOCATION_LOC0;
76 GPIO->ROUTELOC1 = (BSP_TRACE_ETM_CLKLOC << _GPIO_ROUTELOC1_ETMTCLKLOC_SHIFT)
77 | (BSP_TRACE_ETM_TD0LOC << _GPIO_ROUTELOC1_ETMTD0LOC_SHIFT)
78 | (BSP_TRACE_ETM_TD1LOC << _GPIO_ROUTELOC1_ETMTD1LOC_SHIFT)
79 | (BSP_TRACE_ETM_TD2LOC << _GPIO_ROUTELOC1_ETMTD2LOC_SHIFT)
80 | (BSP_TRACE_ETM_TD3LOC << _GPIO_ROUTELOC1_ETMTD3LOC_SHIFT);
82 | GPIO_ROUTEPEN_ETMTCLKPEN
83 | GPIO_ROUTEPEN_ETMTD0PEN
84 | GPIO_ROUTEPEN_ETMTD1PEN
85 | GPIO_ROUTEPEN_ETMTD2PEN
86 | GPIO_ROUTEPEN_ETMTD3PEN;
91 #if defined( _GPIO_ROUTE_SWOPEN_MASK ) || defined( _GPIO_ROUTEPEN_SWVPEN_MASK )
103 #if defined( _CMU_HFPERCLKEN0_GPIO_MASK )
105 #elif defined( _CMU_HFBUSCLKEN0_GPIO_MASK )
106 CMU->HFBUSCLKEN0 |= CMU_HFBUSCLKEN0_GPIO;
110 #if defined( _GPIO_ROUTE_SWOPEN_MASK )
112 #elif defined( _GPIO_ROUTEPEN_SWVPEN_MASK )
113 GPIO->ROUTEPEN |= GPIO_ROUTEPEN_SWVPEN;
117 #if defined( _GPIO_ROUTE_SWOPEN_MASK )
119 #elif defined( _GPIO_ROUTEPEN_SWVPEN_MASK )
120 GPIO->ROUTELOC0 = (
GPIO->ROUTELOC0 & ~(_GPIO_ROUTELOC0_SWVLOC_MASK)) | BSP_TRACE_SWO_LOCATION;
133 CoreDebug->DHCSR |= CoreDebug_DHCSR_C_DEBUGEN_Msk;
134 CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk;
137 DWT->CTRL = 0x400113FF;
153 ITM->LAR = 0xC5ACCE55;
157 ITM->TER |= (1UL << 0);
162 #if defined( _GPIO_ROUTE_SWOPEN_MASK ) || defined( _GPIO_ROUTEPEN_SWVPEN_MASK )
171 volatile uint32_t *userData = (uint32_t *) USER_PAGE;
174 if (*userData == 0x00000000UL)
Clock management unit (CMU) API.
Board support package API definitions.
#define GPIO_P_MODEL_MODE5_PUSHPULL
#define CMU_OSCENCMD_AUXHFRCOEN
#define GPIO_P_MODEL_MODE6_PUSHPULL
CMSIS Cortex-M Peripheral Access Layer for Silicon Laboratories microcontroller devices.
SWO Trace API (for eAProfiler)
#define _GPIO_ROUTE_SWLOCATION_MASK
#define _GPIO_P_MODEL_MODE3_MASK
#define GPIO_ROUTE_SWOPEN
bool BSP_TraceProfilerSetup(void)
Profiler configuration.
#define _GPIO_P_MODEL_MODE4_MASK
#define GPIO_P_MODEL_MODE3_PUSHPULL
void GPIO_PinModeSet(GPIO_Port_TypeDef port, unsigned int pin, GPIO_Mode_TypeDef mode, unsigned int out)
Set the mode for a GPIO pin.
General Purpose IO (GPIO) peripheral API.
#define CMU_HFPERCLKEN0_GPIO
#define _GPIO_P_MODEL_MODE7_MASK
#define GPIO_P_MODEL_MODE7_PUSHPULL
void BSP_TraceSwoSetup(void)
Configure trace output for energyAware Profiler.
void CMU_ClockEnable(CMU_Clock_TypeDef clock, bool enable)
Enable/disable a clock.
#define _GPIO_P_MODEL_MODE6_MASK
#define CMU_STATUS_AUXHFRCORDY
void CMU_OscillatorEnable(CMU_Osc_TypeDef osc, bool enable, bool wait)
Enable/disable oscillator.
#define GPIO_P_MODEL_MODE4_PUSHPULL
#define _GPIO_P_MODEL_MODE5_MASK
uint32_t CMU_ClockFreqGet(CMU_Clock_TypeDef clock)
Get clock frequency for a clock point.