File tree Expand file tree Collapse file tree 8 files changed +80
-17
lines changed
TARGET_Silicon_Labs/TARGET_EFM32
TARGET_EFM32GG/TARGET_EFM32GG_STK3700
TARGET_EFM32GG11/TARGET_EFM32GG11_STK3701
TARGET_EFM32LG/TARGET_EFM32LG_STK3600
TARGET_EFM32PG/TARGET_EFM32PG_STK3401
TARGET_EFM32PG12/TARGET_EFM32PG12_STK3402
TARGET_EFM32WG/TARGET_EFM32WG_STK3800 Expand file tree Collapse file tree 8 files changed +80
-17
lines changed Original file line number Diff line number Diff line change 33
33
#define PWM_TIMER_CLOCK cmuClock_TIMER2
34
34
#define PWM_ROUTE TIMER_ROUTE_LOCATION_LOC1
35
35
36
+ /* Set SWO location */
37
+ #if DEVICE_ITM
38
+ /* Set location 0 */
39
+ #define SWO_LOCATION (GPIO->SWO_ROUTE & ~_GPIO_ROUTE_SWLOCATION_MASK) | GPIO_ROUTE_SWLOCATION_LOC0
40
+ /* Enable output on pin */
41
+ #define GPIO_PORT 5 // GPIO port number (A = 0, B = 1, ...)
42
+ #define SWO_MODE MODEL
43
+ #define SWO_ENABLE_OUTPUT_PIN (GPIO->P[GPIO_PORT].SWO_MODE & ~_GPIO_P_MODEL_MODE2_MASK) | GPIO_P_MODEL_MODE2_PUSHPULL
44
+ #endif
45
+
36
46
/* USB */
37
47
#define USB_TIMER USB_TIMER1
38
48
Original file line number Diff line number Diff line change 33
33
#define PWM_TIMER_CLOCK cmuClock_TIMER1
34
34
#define PWM_ROUTE TIMER_ROUTE_LOCATION_LOC1
35
35
36
+ /* Set SWO location */
37
+ #if DEVICE_ITM
38
+ /* Set location 0 */
39
+ #define SWO_LOCATION (GPIO->SWO_ROUTE & ~_GPIO_ROUTELOC0_SWVLOC_MASK) | GPIO_ROUTELOC0_SWVLOC_LOC0
40
+ /* Enable output on pin */
41
+ #define GPIO_PORT 5 // GPIO port number (A = 0, B = 1, ...)
42
+ #define SWO_MODE MODEL
43
+ #define SWO_ENABLE_OUTPUT_PIN (GPIO->P[GPIO_PORT].SWO_MODE & ~_GPIO_P_MODEL_MODE2_MASK) | GPIO_P_MODEL_MODE2_PUSHPULL
44
+
45
+ /* Set location 1 */
46
+ /*
47
+ #define SWO_LOCATION (GPIO->SWO_ROUTE & ~_GPIO_ROUTELOC0_SWVLOC_MASK) | GPIO_ROUTELOC0_SWVLOC_LOC1
48
+ // Enable output on pin
49
+ #define GPIO_PORT 2 // GPIO port number (A = 0, B = 1, ...)
50
+ #define SWO_MODE MODEH
51
+ #define SWO_ENABLE_OUTPUT_PIN (GPIO->P[GPIO_PORT].SWO_MODE & ~_GPIO_P_MODEH_MODE15_MASK) | GPIO_P_MODEH_MODE15_PUSHPULL
52
+ */
53
+ #endif
54
+
36
55
/* Crystal calibration */
37
56
#if !defined(CMU_HFXOINIT_STK_DEFAULT )
38
57
#define CMU_HFXOINIT_STK_DEFAULT \
Original file line number Diff line number Diff line change 33
33
#define PWM_TIMER_CLOCK cmuClock_TIMER2
34
34
#define PWM_ROUTE TIMER_ROUTE_LOCATION_LOC1
35
35
36
+ /* Set SWO location */
37
+ #if DEVICE_ITM
38
+ /* Set location 0 */
39
+ #define SWO_LOCATION (GPIO->SWO_ROUTE & ~_GPIO_ROUTE_SWLOCATION_MASK) | GPIO_ROUTE_SWLOCATION_LOC0
40
+ /* Enable output on pin */
41
+ #define GPIO_PORT 5 // GPIO port number (A = 0, B = 1, ...)
42
+ #define SWO_MODE MODEL
43
+ #define SWO_ENABLE_OUTPUT_PIN (GPIO->P[GPIO_PORT].SWO_MODE & ~_GPIO_P_MODEL_MODE2_MASK) | GPIO_P_MODEL_MODE2_PUSHPULL
44
+ #endif
45
+
36
46
/* USB */
37
47
#define USB_TIMER USB_TIMER1
38
48
Original file line number Diff line number Diff line change 33
33
#define PWM_TIMER_CLOCK cmuClock_TIMER1
34
34
#define PWM_ROUTE TIMER_ROUTE_LOCATION_LOC1
35
35
36
+ /* Set SWO location */
37
+ #if DEVICE_ITM
38
+ /* Set location 0 */
39
+ #define SWO_LOCATION (GPIO->SWO_ROUTE & ~_GPIO_ROUTELOC0_SWVLOC_MASK) | GPIO_ROUTELOC0_SWVLOC_LOC0
40
+ /* Enable output on pin */
41
+ #define GPIO_PORT 5 // GPIO port number (A = 0, B = 1, ...)
42
+ #define SWO_MODE MODEL
43
+ #define SWO_ENABLE_OUTPUT_PIN (GPIO->P[GPIO_PORT].SWO_MODE & ~_GPIO_P_MODEL_MODE2_MASK) | GPIO_P_MODEL_MODE2_PUSHPULL
44
+ #endif
45
+
36
46
/* Crystal Calibration */
37
47
#if !defined(CMU_HFXOINIT_STK_DEFAULT )
38
48
#define CMU_HFXOINIT_STK_DEFAULT \
Original file line number Diff line number Diff line change 33
33
#define PWM_TIMER_CLOCK cmuClock_TIMER1
34
34
#define PWM_ROUTE TIMER_ROUTE_LOCATION_LOC1
35
35
36
+ /* Set SWO location */
37
+ #if DEVICE_ITM
38
+ /* Set location 0 */
39
+ #define SWO_LOCATION (GPIO->SWO_ROUTE & ~_GPIO_ROUTELOC0_SWVLOC_MASK) | GPIO_ROUTELOC0_SWVLOC_LOC0
40
+ /* Enable output on pin */
41
+ #define GPIO_PORT 5 // GPIO port number (A = 0, B = 1, ...)
42
+ #define SWO_MODE MODEL
43
+ #define SWO_ENABLE_OUTPUT_PIN (GPIO->P[GPIO_PORT].SWO_MODE & ~_GPIO_P_MODEL_MODE2_MASK) | GPIO_P_MODEL_MODE2_PUSHPULL
44
+ #endif
45
+
36
46
/* Crystal calibration */
37
47
#if !defined(CMU_HFXOINIT_STK_DEFAULT )
38
48
#define CMU_HFXOINIT_STK_DEFAULT \
Original file line number Diff line number Diff line change 33
33
#define PWM_TIMER_CLOCK cmuClock_TIMER2
34
34
#define PWM_ROUTE TIMER_ROUTE_LOCATION_LOC1
35
35
36
+ /* Set SWO location */
37
+ #if DEVICE_ITM
38
+ /* Set location 0 */
39
+ #define SWO_LOCATION (GPIO->SWO_ROUTE & ~_GPIO_ROUTE_SWLOCATION_MASK) | GPIO_ROUTE_SWLOCATION_LOC0
40
+ /* Enable output on pin */
41
+ #define GPIO_PORT 5 // GPIO port number (A = 0, B = 1, ...)
42
+ #define SWO_MODE MODEL
43
+ #define SWO_ENABLE_OUTPUT_PIN (GPIO->P[GPIO_PORT].SWO_MODE & ~_GPIO_P_MODEL_MODE2_MASK) | GPIO_P_MODEL_MODE2_PUSHPULL
44
+ #endif
45
+
36
46
/* USB */
37
47
#define USB_TIMER USB_TIMER1
38
48
Original file line number Diff line number Diff line change 19
19
#include "hal/itm_api.h"
20
20
#include "cmsis.h"
21
21
#include "em_cmu.h"
22
+ #include "device_peripherals.h"
22
23
23
24
#include <stdbool.h>
24
25
@@ -40,26 +41,18 @@ static void setupSWOForPrint(void)
40
41
GPIO -> ROUTEPEN |= GPIO_ROUTEPEN_SWVPEN ;
41
42
#endif
42
43
#endif
43
-
44
- #if defined(_EFM32_GIANT_FAMILY ) || defined(_EFM32_LEOPARD_FAMILY ) || defined(_EFM32_WONDER_FAMILY ) || defined(_EFM32_PEARL_FAMILY )
45
- // Set location 0
46
- #if defined( _GPIO_ROUTE_SWOPEN_MASK )
47
- GPIO -> ROUTE = (GPIO -> ROUTE & ~(_GPIO_ROUTE_SWLOCATION_MASK )) | GPIO_ROUTE_SWLOCATION_LOC0 ;
48
- #elif defined( _GPIO_ROUTEPEN_SWVPEN_MASK )
49
- GPIO -> ROUTELOC0 = (GPIO -> ROUTELOC0 & ~(_GPIO_ROUTELOC0_SWVLOC_MASK )) | GPIO_ROUTELOC0_SWVLOC_LOC0 ;
50
- #endif
51
44
52
- // Enable output on pin - GPIO Port F, Pin 2
53
- GPIO -> P [ 5 ]. MODEL &= ~( _GPIO_P_MODEL_MODE2_MASK );
54
- GPIO -> P [ 5 ]. MODEL |= GPIO_P_MODEL_MODE2_PUSHPULL ;
55
- #else
56
- // Set location 1
57
- GPIO -> ROUTE = ( GPIO -> ROUTE & ~( _GPIO_ROUTE_SWLOCATION_MASK )) | GPIO_ROUTE_SWLOCATION_LOC1 ;
45
+ #if defined( _GPIO_ROUTE_MASK )
46
+ #define SWO_ROUTE ROUTE
47
+ #endif
48
+ #if defined( _GPIO_ROUTELOC0_MASK )
49
+ #define SWO_ROUTE ROUTELOC0
50
+ #endif
58
51
52
+ // Set SWO location
53
+ GPIO -> SWO_ROUTE = SWO_LOCATION ;
59
54
// Enable output on pin
60
- GPIO -> P [2 ].MODEH &= ~(_GPIO_P_MODEH_MODE15_MASK );
61
- GPIO -> P [2 ].MODEH |= GPIO_P_MODEH_MODE15_PUSHPULL ;
62
- #endif
55
+ GPIO -> P [GPIO_PORT ].SWO_MODE = SWO_ENABLE_OUTPUT_PIN ;
63
56
64
57
// Enable debug clock AUXHFRCO
65
58
CMU -> OSCENCMD = CMU_OSCENCMD_AUXHFRCOEN ;
Original file line number Diff line number Diff line change 6951
6951
" I2CSLAVE" ,
6952
6952
" I2C_ASYNCH" ,
6953
6953
" INTERRUPTIN" ,
6954
+ " ITM" ,
6954
6955
" LPTICKER" ,
6955
6956
" PORTIN" ,
6956
6957
" PORTINOUT" ,
You can’t perform that action at this time.
0 commit comments