Skip to content

boards: silabs: Support for efm32tg_stk3300 #91191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions boards/silabs/starter_kits/efm32tg_stk3300/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright (c) 2025, Lukas Woodtli
# SPDX-License-Identifier: Apache-2.0

if BOARD_EFM32TG_STK3300

config CMU_HFXO_FREQ
default 32000000

config CMU_LFXO_FREQ
default 32768

endif # BOARD_EFM32TG_STK3300
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) 2025, Lukas Woodtli
# SPDX-License-Identifier: Apache-2.0

config BOARD_EFM32TG_STK3300
select SOC_PART_NUMBER_EFM32TG840F32
5 changes: 5 additions & 0 deletions boards/silabs/starter_kits/efm32tg_stk3300/board.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) 2025, Lukas Woodtli
# SPDX-License-Identifier: Apache-2.0

board_runner_args(jlink "--device=EFM32TG840F32")
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
6 changes: 6 additions & 0 deletions boards/silabs/starter_kits/efm32tg_stk3300/board.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
board:
name: efm32tg_stk3300
full_name: EFM32 Tiny Gecko (EFM32TG-STK3300)
vendor: silabs
socs:
- name: efm32tg840f32
Binary file not shown.
142 changes: 142 additions & 0 deletions boards/silabs/starter_kits/efm32tg_stk3300/doc/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
.. zephyr:board:: efm32tg_stk3300

Overview
********

The EFM32 Tiny Gecko Starter Kit EFM32TG-STK3300 contains a MCU from the
EFM32TG family built on ARM® Cortex®-M3 processor with excellent low
power capabilities.

Hardware
********

- EFM32TG840F32 MCU with 32 kB flash and 4 kB RAM
- Advanced Energy Monitoring provides real-time information about the energy
consumption of an application or prototype design.
- 160 segment Energy Micro LCD
- 2 user buttons, 1 LED and a touch slider
- Ambient Light Sensor, Inductive-capacitive metal sensor and touch sensor
- On-board Segger J-Link USB debugger

For more information about the EFM32TG SoC and EFM32TG-STK3300 board:

- `EFM32TG Website`_
- `EFM32TG Datasheet`_
- `EFM32TG Reference Manual`_
- `EFM32TG-STK3300 Website`_
- `EFM32TG-STK3300 User Guide`_
- `EFM32TG-STK3300 Schematics`_

Supported Features
==================

.. zephyr:board-supported-hw::

Connections and IOs
===================

The EFM32TG SoC has six gpio controllers (PORTA to PORTF), but only three are
currently enabled (PORTB, PORTC and PORTD) for the EFM32TG-STK3300 board.

In the following table, the column Name contains Pin names. For example, PE2
means Pin number 2 on PORTE, as used in the board's datasheets and manuals.

+------+-----------+---------------------------------------+
| Name | Function | Usage |
+======+===========+=======================================+
| PD7 | GPIO | LED0 |
+------+-----------+---------------------------------------+
| PD8 | GPIO | Push Button PB0 |
+------+-----------+---------------------------------------+
| PB11 | GPIO | Push Button PB1 |
+------+-----------+---------------------------------------+
| PD0 | USART1_TX | UART Console USART1_TX #1 (EXP Pin 4) |
+------+-----------+---------------------------------------+
| PD1 | USART1_RX | UART Console USART1_RX #1 (EXP Pin 6) |
+------+-----------+---------------------------------------+

System Clock
============

The EFM32TG SoC is configured to use the 32 MHz external oscillator on the
board.

Serial Port
===========

The EFM32TG SoC has two USARTs and two Low Energy UARTs (LEUART).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only one

USART1 is used for the console. It is exposed to the EXP Header on the
board (TX: Pin 4, RX: Pin 6).

Programming and Debugging
*************************

.. zephyr:board-supported-runners::

.. note::
Before using the kit the first time, you should update the J-Link firmware
in Simplicity Studio or with *JLinkConfig*.

Flashing
========

The EFM32TG-STK3300 includes an `J-Link`_ debug adaptor built into the
board. It is used to flash and debug the EFM32TG on the board.

Flashing an application to EFM32-STK3300
----------------------------------------

The sample application :zephyr:code-sample:`hello_world` is used for this example.
Build the Zephyr kernel and application:

.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: efm32tg_stk3300
:goals: build

Connect the EFM32TG-STK3300 to your host computer using the USB port.
Flash the device:

.. code-block:: console

west flash

Connect the board with
Use a Serial-to-USB cable to connect the host computer with the board.
The serial port is exposed on the EXP Header (TX: Pin 4, RX: Pin 6).

Open a serial terminal (minicom, putty, etc.) with the following settings:

- Speed: 115200
- Data: 8 bits
- Parity: None
- Stop bits: 1

Reset the board and you should be able to see on the corresponding Serial Port
the following message:

.. code-block:: console

Hello World! efm32tg_stk3300/efm32tg840f32


.. _EFM32TG-STK3300 Website:
https://www.silabs.com/products/development-tools/mcu/32-bit/efm32-tiny-gecko-starter-kit

.. _EFM32TG-STK3300 User Guide:
https://www.silabs.com/documents/public/user-guides/ug420-efm32tg-stk3300.pdf

.. _EFM32TG-STK3300 Schematics:
https://www.silabs.com/documents/public/schematic-files/BRD2100A-A04-schematic.pdf

.. _EFM32TG Website:
https://www.silabs.com/products/mcu/32-bit/efm32-tiny-gecko

.. _EFM32TG Datasheet:
https://www.silabs.com/documents/public/data-sheets/EFM32TG840.pdf

.. _EFM32TG Reference Manual:
https://www.silabs.com/documents/public/reference-manuals/EFM32TG-RM.pdf

.. _J-Link:
https://www.segger.com/jlink-debug-probes.html
78 changes: 78 additions & 0 deletions boards/silabs/starter_kits/efm32tg_stk3300/efm32tg_stk3300.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/*
* Copyright (c) 2025 Lukas Woodtli
*
* SPDX-License-Identifier: Apache-2.0
*/

/dts-v1/;
#include <silabs/efm32tg840f32.dtsi>
#include <zephyr/dt-bindings/input/input-event-codes.h>

/ {
model = "Silicon Labs EFM32TG STK3300 board";
compatible = "silabs,efm32tg_stk3300", "silabs,efm32tg";

chosen {
zephyr,console = &usart1;
zephyr,flash = &flash0;
zephyr,shell-uart = &usart1;
zephyr,sram = &sram0;
};

/* These aliases are provided for compatibility with samples */
aliases {
led0 = &led0;
sw0 = &button0;
sw1 = &button1;
};

leds {
compatible = "gpio-leds";

led0: led_0 {
gpios = <&gpiod 7 0>;
label = "LED 0";
};
};

buttons {
compatible = "gpio-keys";

button0: button_0 {
/* gpio flags need validation */
gpios = <&gpiod 8 GPIO_ACTIVE_LOW>;
label = "User Push Button 0";
zephyr,code = <INPUT_KEY_0>;
};

button1: button_1 {
/* gpio flags need validation */
gpios = <&gpiob 11 GPIO_ACTIVE_LOW>;
label = "User Push Button 1";
zephyr,code = <INPUT_KEY_1>;
};
};
};

&cpu0 {
clock-frequency = <32000000>;
};

&gpiob {
status = "okay";
};

&gpioc {
status = "okay";
};

&gpiod {
status = "okay";
};

&usart1 {
current-speed = <115200>;
location-tx = <GECKO_LOCATION(1) GECKO_PORT_D GECKO_PIN(0)>;
location-rx = <GECKO_LOCATION(1) GECKO_PORT_D GECKO_PIN(1)>;
status = "okay";
};
17 changes: 17 additions & 0 deletions boards/silabs/starter_kits/efm32tg_stk3300/efm32tg_stk3300.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
identifier: efm32tg_stk3300
name: EFM32 Wonder Gecko Starter Kit (EFM32TG-STK3300, BRD2100)
type: mcu
arch: arm
ram: 4
flash: 32
toolchain:
- zephyr
- gnuarmemb
supported:
- gpio
- nvs
testing:
ignore_tags:
- net
- bluetooth
vendor: silabs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright (c) 2025, Lukas Woodtli
# SPDX-License-Identifier: Apache-2.0

CONFIG_ARM_MPU=n
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_SERIAL=y
CONFIG_GPIO=y
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=32000000
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get from dts property using function, and it should be set in soc Kconfig.defconfig file, not by a board

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the way other boards configure the clock cycles. It's also part of an example here: Board Porting Guide

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that documentation is very outdated and needs to be fixed, but this also needs to be fixed, this Kconfig needs to come from a dts value and in the soc Kconfig.defconfig file

Copy link
Author

@LukasWoodtli LukasWoodtli Jun 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather have this changed in a different PR. It should be consistent for all board. And then the documentation should be updated accordingly.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nothing new to be added with the old style, so if the old style remains in this PR then this PR will remain nacked

CONFIG_CMU_HFCLK_HFXO=y
Loading
Loading