Skip to content
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

Add Silabs SLTB009A Board #60137

Merged
merged 3 commits into from
Jul 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions boards/arm/efm32gg_sltb009a/Kconfig.board
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# EFM32GG SLTB009A board configuration
# Copyright (c) 2023 Antmicro <www.antmicro.com>
# SPDX-License-Identifier: Apache-2.0

config BOARD_EFM32GG_SLTB009A
bool "SiLabs EFM32GG-SLTB009A (Giant Gecko 12)"
depends on SOC_SERIES_EFM32GG12B
select SOC_PART_NUMBER_EFM32GG12B810F1024GM64
24 changes: 24 additions & 0 deletions boards/arm/efm32gg_sltb009a/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# EFM32GG SLTB009A default board configuration
# Copyright (c) 2023 Antmicro <www.antmicro.com>
# SPDX-License-Identifier: Apache-2.0

if BOARD_EFM32GG_SLTB009A

config BOARD
string
default "efm32gg_sltb009a"

config CMU_HFXO_FREQ
default 50000000

config CMU_HFRCO_FREQ
default 72000000

config CMU_LFXO_FREQ
default 32768

config LOG_BACKEND_SWO_FREQ_HZ
default 875000
depends on LOG_BACKEND_SWO

endif # BOARD_EFM32GG_SLTB009A
5 changes: 5 additions & 0 deletions boards/arm/efm32gg_sltb009a/board.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) 2023 Antmicro <www.antmicro.com>
# SPDX-License-Identifier: Apache-2.0

board_runner_args(jlink "--device=EFM32GG12B810F1024")
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
167 changes: 167 additions & 0 deletions boards/arm/efm32gg_sltb009a/doc/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
.. _efm32gg_sltb009a:

EFM32GG12 Thunderboard Kit
##########################

Overview
********

The EFM32GG12 Thunderboard Kit (SLTB009A) is an evaluation platform for the EFM32GG12 GiantGecko Microcontroller,
featuring an ARM Cortex-M4 with FPU, 1024kB flash, and 192kB RAM.

.. figure:: efm32gg12-thunderboard-kit.jpg
:align: center
:alt: SLTB009A

SLTB009A (Credit: Silicon Labs)

Hardware
********

- PDM stereo microphones
- USB connectivity
- On-board Segger J-Link USB debugger
- 2 user buttons and 2 LEDs
- USB C connector

For more information about the WGM160P and SLTB009A board:

- `SLTB009A Website`_
- `SLTB009A User Guide`_
- `EFM32GG12 Datasheet`_
- `EFM32GG12 Reference Manual`_

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

The efm32gg_sltb009a board configuration supports the following hardware
features:

+-----------+------------+-------------------------------------+
| Interface | Controller | Driver/Component |
+===========+============+=====================================+
| MPU | on-chip | memory protection unit |
+-----------+------------+-------------------------------------+
| COUNTER | on-chip | rtcc |
+-----------+------------+-------------------------------------+
| FLASH | on-chip | flash memory |
+-----------+------------+-------------------------------------+
| GPIO | on-chip | gpio |
+-----------+------------+-------------------------------------+
| I2C | on-chip | i2c port-polling |
+-----------+------------+-------------------------------------+
| NVIC | on-chip | nested vector interrupt controller |
+-----------+------------+-------------------------------------+
| UART | on-chip | serial port-polling; |
| | | serial port-interrupt |
+-----------+------------+-------------------------------------+

The default configuration can be found in the defconfig file:

``boards/arm/efm32gg_sltb009a/efm32gg_sltb009a_defconfig``


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

The EFM32GG12 MCU has six GPIO controllers (PORTA to PORTF), all of which are
currently enabled for the SLTB009A board.

In the following table, the column **Name** contains pin names. For example, PE1
means pin number 1 on PORTE, as used in the board's datasheets and manuals.

+-------+-------------+-------------------------------------+
| Name | Function | Usage |
+=======+=============+=====================================+
| PE12 | GPIO | LED0 |
+-------+-------------+-------------------------------------+
| PA13 | GPIO | LED1 |
+-------+-------------+-------------------------------------+
| PD5 | GPIO | Push Button PB0 |
+-------+-------------+-------------------------------------+
| PD8 | GPIO | Push Button PB1 |
+-------+-------------+-------------------------------------+
| PE7 | UART_TX | UART TX Console VCOM_TX US0_TX #1 |
+-------+-------------+-------------------------------------+
| PE6 | UART_RX | UART RX Console VCOM_RX US0_RX #1 |
+-------+-------------+-------------------------------------+
| PC0 | I2C_SDA | SENSOR_I2C_SDA I2C0_SDA #1 |
+-------+-------------+-------------------------------------+
| PC1 | I2C_SCL | SENSOR_I2C_SCL I2C0_SCL #1 |
+-------+-------------+-------------------------------------+
| PC4 | I2C_SDA | SENSOR_I2C_SDA I2C1_SDA #1 |
+-------+-------------+-------------------------------------+
| PC5 | I2C_SCL | SENSOR_I2C_SCL I2C1_SCL #1 |
+-------+-------------+-------------------------------------+


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

The EFM32GG12 MCU is configured to work at 72 MHz.

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

The EFM32GG12 SoC has five USARTs, two UARTs and two Low Energy UARTs (LEUART).
USART0 is connected to the board controller and is used for the console.

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

.. note::
Before using the kit the first time, you should update the J-Link firmware
from `J-Link-Downloads`_

Flashing
========

The SLTB009A includes an `J-Link`_ serial and debug adaptor built into the
board. The adaptor provides:

- A USB connection to the host computer
- A physical UART connection which is relayed over interface USB serial port.

Flashing an application to SLTB009A
--------------------------------------

Connect the SLTB009A to your host computer using the USB port.

Here is an example to build and flash the :ref:`hello_world` application.

.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: efm32gg_stb009a
:goals: flash

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'll see the following message on the corresponding serial port
terminal session:

.. code-block:: console

Hello World! efm32gg_sltb009a

.. _SLTB009A Website:
https://www.silabs.com/development-tools/thunderboard/thunderboard-gg12-kit

.. _SLTB009A User Guide:
https://www.silabs.com/documents/public/user-guides/ug371-sltb009a-user-guide.pdf

.. _EFM32GG12 Datasheet:
https://www.silabs.com/documents/public/data-sheets/efm32gg12-datasheet.pdf

.. _EFM32GG12 Reference Manual:
https://www.silabs.com/documents/public/reference-manuals/efm32gg12-rm.pdf

.. _J-Link:
https://www.segger.com/jlink-debug-probes.html

.. _J-Link-Downloads:
https://www.segger.com/downloads/jlink
152 changes: 152 additions & 0 deletions boards/arm/efm32gg_sltb009a/efm32gg_sltb009a.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
/*
* Copyright (c) 2023 Antmicro <www.antmicro.com>
*
* SPDX-License-Identifier: Apache-2.0
*/

/dts-v1/;
#include <silabs/efm32gg12b810f1024gm64.dtsi>

/ {
model = "Silicon Labs EFM32GG SLTB009A board";
compatible = "silabs,efm32gg_sltb009a";

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

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

leds {
compatible = "gpio-leds";
led0: led_0 {
gpios = <&gpioe 12 GPIO_ACTIVE_HIGH>;
label = "LED 0";
};
led1: led_1 {
gpios = <&gpioa 13 GPIO_ACTIVE_HIGH>;
label = "LED 1";
};
};

buttons {
compatible = "gpio-keys";
button0: button_0 {
gpios = <&gpiod 5 GPIO_ACTIVE_HIGH>;
label = "User Push Button 0";
};
button1: button_1 {
gpios = <&gpiod 8 GPIO_ACTIVE_HIGH>;
label = "User Push Button 1";
};
};
};

&usart0 {
current-speed = <115200>;
location-rx = <GECKO_LOCATION(1) GECKO_PORT_E GECKO_PIN(6)>;
location-tx = <GECKO_LOCATION(1) GECKO_PORT_E GECKO_PIN(7)>;
status = "okay";
};

&usart4 {
current-speed = <115200>;
location-rx = <GECKO_LOCATION(0) GECKO_PORT_B GECKO_PIN(8)>;
location-tx = <GECKO_LOCATION(0) GECKO_PORT_B GECKO_PIN(7)>;
status = "okay";
};

&leuart0 {
current-speed = <9600>;
location-rx = <GECKO_LOCATION(1) GECKO_PORT_B GECKO_PIN(14)>;
location-tx = <GECKO_LOCATION(1) GECKO_PORT_B GECKO_PIN(13)>;
status = "okay";
};

&i2c0 {
location-sda = <GECKO_LOCATION(4) GECKO_PORT_C GECKO_PIN(0)>;
location-scl = <GECKO_LOCATION(4) GECKO_PORT_C GECKO_PIN(1)>;
status = "okay";
};

&i2c1 {
location-sda = <GECKO_LOCATION(0) GECKO_PORT_C GECKO_PIN(4)>;
location-scl = <GECKO_LOCATION(0) GECKO_PORT_C GECKO_PIN(5)>;
status = "okay";
};

&rtcc0 {
prescaler = <1>;
status = "okay";
};

&gpioa {
status = "okay";
board-controller-enable {
// VCOM Isolation. Set PA15 to HIGH to enable VCOM_{RX,TX}.
gpio-hog;
gpios = <15 GPIO_ACTIVE_HIGH>;
output-high;
};
};

&gpio {
location-swo = <0>;
status = "okay";
};

&gpiob {
status = "okay";
};

&gpioc {
status = "okay";
};

&gpiod {
status = "okay";
};

&gpioe {
status = "okay";
};

&gpiof {
status = "okay";
};

&flash0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

/* Set 12Kb of storage at the end of the 2048Kb of flash */
storage_partition: partition@1fd000 {
label = "storage";
reg = <0x001fd000 0x00003000>;
};
};
};

&wdog0 {
status = "okay";
};

&trng0 {
status = "okay";
};

&cpu0 {
clock-frequency = <72000000>;
};
15 changes: 15 additions & 0 deletions boards/arm/efm32gg_sltb009a/efm32gg_sltb009a.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
identifier: efm32gg_sltb009a
name: EFM32GG-SLTB009A
type: mcu
arch: arm
ram: 192
flash: 1024
toolchain:
- zephyr
supported:
- i2c
- gpio
- nvs
testing:
ignore_tags:
- bluetooth
12 changes: 12 additions & 0 deletions boards/arm/efm32gg_sltb009a/efm32gg_sltb009a_defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright (c) 2023 Antmicro <www.antmicro.com>
# SPDX-License-Identifier: Apache-2.0

CONFIG_SOC_SERIES_EFM32GG12B=y
CONFIG_BOARD_EFM32GG_SLTB009A=y
CONFIG_ARM_MPU=y
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_SERIAL=y
CONFIG_GPIO=y
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=72000000
CONFIG_CMU_HFCLK_HFRCO=y