Developing firmware for EFM32 devices with Visual Studio

This tutorial shows how to develop firmware for the EFM32 devices with Visual Studio and VisualGDB. Before you begin, install VisualGDB 5.1 or later.

  1. Start Visual Studio and open the VisualGDB Embedded Project Wizard:01-efm32prj
  2. Proceed with the default project type (Embedded binary):02-binary
  3. On the next page select the ARM toolchain and choose your EFM32 device from the list. VisualGDB will automatically download the necessary support files. In this tutorial we will show how to program the EFM32 Giant Gecko Starter Kit (STK3700), so we select the EFM32GG990F1024 device:03-device
  4. Proceed with the default LEDBlink sample. If you are using a different board, change the LED port name and pin number to match your board:04-sample
  5. The EFM32 Giant Gecko development board comes with a built-in Segger J-Link programmer, so we simply select the Segger J-Link debug method and the Segger J-Link software will automatically recognize the chip:05-segger
  6. Press “Finish” to generate the project. Build it via Build->Build Solution:06-build
  7. Press F5 to automatically program the board and start debugging. Notice how the LED on the board begins to blink:led_on
  8. Set a breakpoint at the second call to GPIO_PinOutClear and wait until it hits: 07-step
  9. Step over the call and notice how the LED turns off:led_off
  10. You can use the Hardware Registers view to check the state of various hardware registers. E.g. you can easily see how setting pin 2 of port E to 1 changes to DOUT register of the GPIO port E (P[4]):09-hwreg
  11. If you want to monitor some of your program’s variables without stopping the program, use the Live Variables window to add live watches and enable plotting to view them graphically. E.g. you can plot how the TickCount value increases linearly over time:  11-plot
  12. You can use the Embedded Frameworks page of the VisualGDB Project Properties to add reference to various software frameworks. E.g. you can add a reference to the EFM32 USB library if you want to use USB functionality in your code:10-frameworks