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 )
104 CMU->HFPERCLKEN0 |= CMU_HFPERCLKEN0_GPIO;
105 #elif defined( _CMU_HFBUSCLKEN0_GPIO_MASK )
110 #if defined( _GPIO_ROUTE_SWOPEN_MASK )
111 GPIO->ROUTE |= GPIO_ROUTE_SWOPEN;
112 #elif defined( _GPIO_ROUTEPEN_SWVPEN_MASK )
117 #if defined( _GPIO_ROUTE_SWOPEN_MASK )
118 GPIO->ROUTE = (
GPIO->ROUTE & ~(_GPIO_ROUTE_SWLOCATION_MASK)) | BSP_TRACE_SWO_LOCATION;
119 #elif defined( _GPIO_ROUTEPEN_SWVPEN_MASK )
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_MODE3_PUSHPULL
#define _GPIO_P_MODEL_MODE5_MASK
#define CMU_HFBUSCLKEN0_GPIO
CMSIS Cortex-M Peripheral Access Layer for Silicon Laboratories microcontroller devices.
#define _GPIO_P_MODEL_MODE4_MASK
#define _GPIO_ROUTELOC0_SWVLOC_MASK
#define CMU_STATUS_AUXHFRCORDY
SWO Trace API (for eAProfiler)
#define GPIO_P_MODEL_MODE5_PUSHPULL
bool BSP_TraceProfilerSetup(void)
Profiler configuration.
#define _GPIO_P_MODEL_MODE3_MASK
#define _GPIO_P_MODEL_MODE7_MASK
void GPIO_PinModeSet(GPIO_Port_TypeDef port, unsigned int pin, GPIO_Mode_TypeDef mode, unsigned int out)
Set the mode for a GPIO pin.
#define GPIO_P_MODEL_MODE4_PUSHPULL
General Purpose IO (GPIO) peripheral API.
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_ROUTEPEN_SWVPEN
#define GPIO_P_MODEL_MODE6_PUSHPULL
#define CMU_OSCENCMD_AUXHFRCOEN
#define GPIO_P_MODEL_MODE7_PUSHPULL
void CMU_OscillatorEnable(CMU_Osc_TypeDef osc, bool enable, bool wait)
Enable/disable oscillator.
#define _GPIO_P_MODEL_MODE6_MASK
uint32_t CMU_ClockFreqGet(CMU_Clock_TypeDef clock)
Get clock frequency for a clock point.