The debug interface of efm32 uses the SWD interface, namely the two-wire JTAG interface. The two signal lines are swclk and swdio respectively. Swclk is an internal drop-down by default, and swdio is an internal pull-up by default. If you want to reuse these two ports into gpio ports, You need to modify the gpio-> route register. Disable the reuse function.
Routine:
Disable the SWD interface and set it to the gpio output function.
# Include <stdint. h>
# Include <stdbool. h>
# Include "efm32.h"
# Include "efm32_chip.h"
# Include "efm32_cmu.h"
# Include "efm32_gpio.h"
/*************************************** ***********************************//**
* @ Brief Main Function
**************************************** *************************************/
Int main (void)
{
/* Chip errata */
Chip_init ();
Cmu_clockenable (cmuclock_gpio, true );
Unsigned long ulDelay = 30000000;
While (ulDelay --);
GPIO_DbgSWDClkEnable (false );
GPIO_DbgSWDIOEnable (false );
GPIO_PinModeSet (gpioPortF, 0, gpioModePushPull, 1 );
GPIO_PinModeSet (gpioPortF, 1, gpioModePushPull, 1 );
/* Infinite blink loop */
While (1)
{
Unsigned long ulcc = 5000;
While (ulcc --);
GPIO_PinOutToggle (gpioPortF, 0 );
GPIO_PinOutToggle (gpioPortF, 1 );
}
}