boards: Add support for SiLabs efr32xg24_dk2601b board
This commit adds support for Silicon Labs efr32xg24_dk2601b board. Signed-off-by: Mateusz Sierszulski <msierszulski@antmicro.com>
This commit is contained in:
parent
7f40908e9d
commit
7e2852fe95
16 changed files with 479 additions and 2 deletions
5
boards/arm/efr32xg24_dk2601b/CMakeLists.txt
Normal file
5
boards/arm/efr32xg24_dk2601b/CMakeLists.txt
Normal file
|
@ -0,0 +1,5 @@
|
|||
# Copyright (c) 2021 Sateesh Kotapati
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
zephyr_library()
|
||||
zephyr_library_sources(board.c)
|
12
boards/arm/efr32xg24_dk2601b/Kconfig
Normal file
12
boards/arm/efr32xg24_dk2601b/Kconfig
Normal file
|
@ -0,0 +1,12 @@
|
|||
# EFR32XG24 DK2601B board
|
||||
|
||||
# Copyright (c) 2022, Silicon Labs
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
if BOARD_EFR32XG24_DK2601B
|
||||
|
||||
module = BOARD_EFR32MG24
|
||||
module-str = Board Control
|
||||
source "subsys/logging/Kconfig.template.log_config"
|
||||
|
||||
endif # BOARD_EFR32XG24_DK2601B
|
9
boards/arm/efr32xg24_dk2601b/Kconfig.board
Normal file
9
boards/arm/efr32xg24_dk2601b/Kconfig.board
Normal file
|
@ -0,0 +1,9 @@
|
|||
# EFR32XG24 DK2601B board
|
||||
|
||||
# Copyright (c) 2021, Sateesh Kotapati
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
config BOARD_EFR32XG24_DK2601B
|
||||
bool "Silicon Labs BRD2601B (Mighty Gecko Radio Board)"
|
||||
depends on SOC_SERIES_EFR32MG24
|
||||
select SOC_PART_NUMBER_EFR32MG24B310F1536IM48
|
21
boards/arm/efr32xg24_dk2601b/Kconfig.defconfig
Normal file
21
boards/arm/efr32xg24_dk2601b/Kconfig.defconfig
Normal file
|
@ -0,0 +1,21 @@
|
|||
# EFR32XG24 DK2601B board
|
||||
|
||||
# Copyright (c) 2021, Sateesh Kotapati
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
if BOARD_EFR32XG24_DK2601B
|
||||
|
||||
config BOARD
|
||||
default "efr32xg24_dk2601b"
|
||||
|
||||
config CMU_HFXO_FREQ
|
||||
default 40000000
|
||||
|
||||
config CMU_LFXO_FREQ
|
||||
default 32768
|
||||
|
||||
config FLASH_BASE_ADDRESS
|
||||
hex
|
||||
default 0x08000000
|
||||
|
||||
endif # BOARD_EFR32XG24_DK2601B
|
71
boards/arm/efr32xg24_dk2601b/board.c
Normal file
71
boards/arm/efr32xg24_dk2601b/board.c
Normal file
|
@ -0,0 +1,71 @@
|
|||
/*
|
||||
* Copyright (c) 2021 Sateesh Kotapati
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <zephyr/init.h>
|
||||
#include <zephyr/drivers/gpio.h>
|
||||
#include <zephyr/sys/printk.h>
|
||||
#include <zephyr/logging/log.h>
|
||||
|
||||
#ifdef CONFIG_SOC_GECKO_DEV_INIT
|
||||
#include "em_cmu.h"
|
||||
#endif
|
||||
|
||||
LOG_MODULE_REGISTER(efr32xg24_dk2601b, CONFIG_BOARD_EFR32MG24_LOG_LEVEL);
|
||||
|
||||
static int efr32xg24_dk2601b_init_clocks(void);
|
||||
|
||||
static int efr32xg24_dk2601b_init(const struct device *dev)
|
||||
{
|
||||
int ret;
|
||||
|
||||
#ifdef CONFIG_SOC_GECKO_DEV_INIT
|
||||
efr32xg24_dk2601b_init_clocks();
|
||||
#endif
|
||||
static struct gpio_dt_spec wake_up_gpio_dev =
|
||||
GPIO_DT_SPEC_GET(DT_NODELABEL(wake_up_trigger), gpios);
|
||||
|
||||
ARG_UNUSED(dev);
|
||||
|
||||
if (!device_is_ready(wake_up_gpio_dev.port)) {
|
||||
LOG_ERR("Wake-up GPIO device was not found!\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
ret = gpio_pin_configure_dt(&wake_up_gpio_dev, GPIO_OUTPUT_ACTIVE);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SOC_GECKO_DEV_INIT
|
||||
static int efr32xg24_dk2601b_init_clocks(void)
|
||||
{
|
||||
CMU_ClockSelectSet(cmuClock_SYSCLK, cmuSelect_HFRCODPLL);
|
||||
#if defined(_CMU_EM01GRPACLKCTRL_MASK)
|
||||
CMU_ClockSelectSet(cmuClock_EM01GRPACLK, cmuSelect_HFRCODPLL);
|
||||
#endif
|
||||
#if defined(_CMU_EM01GRPBCLKCTRL_MASK)
|
||||
CMU_ClockSelectSet(cmuClock_EM01GRPBCLK, cmuSelect_HFRCODPLL);
|
||||
#endif
|
||||
CMU_ClockSelectSet(cmuClock_EM23GRPACLK, cmuSelect_LFRCO);
|
||||
CMU_ClockSelectSet(cmuClock_EM4GRPACLK, cmuSelect_LFRCO);
|
||||
#if defined(RTCC_PRESENT)
|
||||
CMU_ClockSelectSet(cmuClock_RTCC, cmuSelect_LFRCO);
|
||||
#endif
|
||||
#if defined(SYSRTC_PRESENT)
|
||||
CMU_ClockSelectSet(cmuClock_SYSRTC, cmuSelect_LFRCO);
|
||||
#endif
|
||||
CMU_ClockSelectSet(cmuClock_WDOG0, cmuSelect_LFRCO);
|
||||
#if WDOG_COUNT > 1
|
||||
CMU_ClockSelectSet(cmuClock_WDOG1, cmuSelect_LFRCO);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* needs to be done after GPIO driver init */
|
||||
SYS_INIT(efr32xg24_dk2601b_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
|
7
boards/arm/efr32xg24_dk2601b/board.cmake
Normal file
7
boards/arm/efr32xg24_dk2601b/board.cmake
Normal file
|
@ -0,0 +1,7 @@
|
|||
# Copyright (c) 2021, Sateesh Kotapati
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
board_runner_args(jlink "--device=EFR32MG24BxxxF1536" "--reset-after-load")
|
||||
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
|
BIN
boards/arm/efr32xg24_dk2601b/doc/img/efr32xg24_dk2601b.jpg
Normal file
BIN
boards/arm/efr32xg24_dk2601b/doc/img/efr32xg24_dk2601b.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 10 KiB |
154
boards/arm/efr32xg24_dk2601b/doc/index.rst
Normal file
154
boards/arm/efr32xg24_dk2601b/doc/index.rst
Normal file
|
@ -0,0 +1,154 @@
|
|||
.. _efr32mg24_dk2601b:
|
||||
|
||||
xG24-DK2601B
|
||||
###########################
|
||||
|
||||
Overview
|
||||
********
|
||||
|
||||
The EFR32MG24 Mighty Gecko Board dev kit contains
|
||||
a Wireless System-On-Chip from the EFR32MG24 family built on an
|
||||
ARM Cortex®-M33F processor with excellent low power capabilities.
|
||||
|
||||
.. figure:: ./img/efr32xg24_dk2601b.jpg
|
||||
:height: 260px
|
||||
:align: center
|
||||
:alt: SLWRB4180A Mighty Gecko Radio Board
|
||||
|
||||
xG24-DK2601B (image courtesy of Silicon Labs)
|
||||
|
||||
Hardware
|
||||
********
|
||||
|
||||
- EFR32MG24B310F1536IM48-B Mighty Gecko SoC
|
||||
- CPU core: ARM Cortex®-M33 with FPU
|
||||
- Flash memory: 1536 kB
|
||||
- RAM: 256 kB
|
||||
- Transmit power: up to +20 dBm
|
||||
- Operation frequency: 2.4 GHz
|
||||
- Crystals for LFXO (32.768 kHz) and HFXO (38.4 MHz).
|
||||
|
||||
For more information about the EFR32MG24 SoC and BRD2601B board, refer to these
|
||||
documents:
|
||||
|
||||
- `EFR32MG24 Website`_
|
||||
- `EFR32MG24 Datasheet`_
|
||||
- `EFR32xG24 Reference Manual`_
|
||||
- `BRD2601B User Guide`_
|
||||
|
||||
Supported Features
|
||||
==================
|
||||
|
||||
The board configuration supports the following hardware features:
|
||||
|
||||
+-----------+------------+-------------------------------------+
|
||||
| Interface | Controller | Driver/Component |
|
||||
+===========+============+=====================================+
|
||||
| MPU | on-chip | memory protection unit |
|
||||
+-----------+------------+-------------------------------------+
|
||||
| NVIC | on-chip | nested vector interrupt controller |
|
||||
+-----------+------------+-------------------------------------+
|
||||
| SYSTICK | on-chip | systick |
|
||||
+-----------+------------+-------------------------------------+
|
||||
| COUNTER | on-chip | stimer |
|
||||
+-----------+------------+-------------------------------------+
|
||||
| FLASH | on-chip | flash memory |
|
||||
+-----------+------------+-------------------------------------+
|
||||
| GPIO | on-chip | gpio |
|
||||
+-----------+------------+-------------------------------------+
|
||||
| UART | on-chip | serial |
|
||||
+-----------+------------+-------------------------------------+
|
||||
| TRNG | on-chip | semailbox |
|
||||
+-----------+------------+-------------------------------------+
|
||||
| WATCHDOG | on-chip | watchdog |
|
||||
+-----------+------------+-------------------------------------+
|
||||
|
||||
Other hardware features are currently not supported by the port.
|
||||
|
||||
Connections and IOs
|
||||
===================
|
||||
|
||||
In the following table, the column **Name** contains Pin names. For example, PA2
|
||||
means Pin number 2 on PORTA, as used in the board's datasheets and manuals.
|
||||
|
||||
+-------+-------------+-------------------------------------+
|
||||
| Name | Function | Usage |
|
||||
+=======+=============+=====================================+
|
||||
| PA4 | GPIO | LED0 |
|
||||
+-------+-------------+-------------------------------------+
|
||||
| PB0 | GPIO | LED1 |
|
||||
+-------+-------------+-------------------------------------+
|
||||
| PB2 | GPIO | Push Button 0 |
|
||||
+-------+-------------+-------------------------------------+
|
||||
| PB3 | GPIO | Push Button 1 |
|
||||
+-------+-------------+-------------------------------------+
|
||||
| PA5 | USART0_TX | UART Console EFM_BC_TX US0_TX |
|
||||
+-------+-------------+-------------------------------------+
|
||||
| PA6 | USART0_RX | UART Console EFM_BC_RX US0_RX |
|
||||
+-------+-------------+-------------------------------------+
|
||||
|
||||
The default configuration can be found in the defconfig file:
|
||||
|
||||
``boards/arm/efr32_radio/efr32_radio_brd4186a_defconfig``
|
||||
|
||||
System Clock
|
||||
============
|
||||
|
||||
The EFR32MG24 SoC is configured to use the 39 MHz external oscillator on the
|
||||
board.
|
||||
|
||||
Serial Port
|
||||
===========
|
||||
|
||||
The EFR32MG24 SoC has one USART and two EUSARTs.
|
||||
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 sample application :ref:`hello_world` is used for this example.
|
||||
Build the Zephyr kernel and application:
|
||||
|
||||
.. zephyr-app-commands::
|
||||
:zephyr-app: samples/hello_world
|
||||
:board: efr32xg24_dk2601b
|
||||
:goals: build
|
||||
|
||||
Connect the efr32xg24_dk2601b to your host computer using the USB port and you
|
||||
should see a USB connection.
|
||||
|
||||
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! efr32xg24_dk2601b
|
||||
|
||||
.. _EFR32MG24 Website:
|
||||
https://www.silabs.com/wireless/zigbee/efr32mg24-series-2-socs#
|
||||
|
||||
.. _EFR32MG24 Datasheet:
|
||||
https://www.silabs.com/documents/public/data-sheets/efr32mg24-datasheet.pdf
|
||||
|
||||
.. _EFR32xG24 Reference Manual:
|
||||
https://www.silabs.com/documents/public/reference-manuals/efr32xg24-rm.pdf
|
||||
|
||||
.. _BRD2601B User Guide:
|
||||
https://www.silabs.com/documents/public/user-guides/ug524-brd2601b-user-guide.pdf
|
||||
|
||||
.. _J-Link-Downloads:
|
||||
https://www.segger.com/downloads/jlink
|
|
@ -0,0 +1,15 @@
|
|||
# Copyright (c) 2022, Antmicro
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
description: GPIO Wake Up Trigger for EFR32MG24
|
||||
|
||||
compatible: "silabs,gecko-wake-up-trigger"
|
||||
|
||||
include: base.yaml
|
||||
|
||||
properties:
|
||||
gpios:
|
||||
type: phandle-array
|
||||
required: true
|
||||
description: |
|
||||
GPIO used as wake up trigger from EM4 sleep
|
129
boards/arm/efr32xg24_dk2601b/efr32xg24_dk2601b.dts
Normal file
129
boards/arm/efr32xg24_dk2601b/efr32xg24_dk2601b.dts
Normal file
|
@ -0,0 +1,129 @@
|
|||
/*
|
||||
* Copyright (c) 2020 TriaGnoSys GmbH
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
#include <silabs/efr32mg24b310f1536im48.dtsi>
|
||||
#include <silabs/efr32mg24-pinctrl.dtsi>
|
||||
|
||||
/ {
|
||||
model = "Silicon Labs BRD2601B (Mighty Gecko Radio Board)";
|
||||
compatible = "silabs,efr32mg24_brd2601b", "silabs,efr32mg24";
|
||||
|
||||
chosen {
|
||||
zephyr,console = &usart0;
|
||||
zephyr,shell-uart = &usart0;
|
||||
zephyr,sram = &sram0;
|
||||
zephyr,flash = &flash0;
|
||||
zephyr,code-partition = &slot0_partition;
|
||||
};
|
||||
|
||||
aliases {
|
||||
led0 = &red_led;
|
||||
led1 = &green_led;
|
||||
led2 = &blue_led;
|
||||
sw0 = &button0;
|
||||
sw1 = &button1;
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
red_led: led_2 {
|
||||
gpios = <&gpiod GECKO_PIN(2) GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
green_led: led_0 {
|
||||
gpios = <&gpioa GECKO_PIN(4) GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
blue_led: led_1 {
|
||||
gpios = <&gpiob GECKO_PIN(0) GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
|
||||
buttons {
|
||||
compatible = "gpio-keys";
|
||||
button0: button_0 {
|
||||
gpios = <&gpiob GECKO_PIN(2) GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
button1: button_1 {
|
||||
gpios = <&gpiob GECKO_PIN(3) GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
|
||||
wake_up_trigger: gpio-wake-up {
|
||||
compatible = "silabs,gecko-wake-up-trigger";
|
||||
gpios = <&gpioa GECKO_PIN(5) GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
&cpu0 {
|
||||
clock-frequency = <78000000>;
|
||||
};
|
||||
|
||||
&usart0 {
|
||||
current-speed = <115200>;
|
||||
pinctrl-0 = <&usart0_default>;
|
||||
pinctrl-names = "default";
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpio {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpioa {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpiob {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpioc {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpiod {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&flash0 {
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
/* Reserve 48 kB for the bootloader */
|
||||
boot_partition: partition@0 {
|
||||
label = "mcuboot";
|
||||
reg = <0x0 0x0000c000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
/* Reserve 464 kB for the application in slot 0 */
|
||||
slot0_partition: partition@c000 {
|
||||
label = "storage";
|
||||
reg = <0x0000c000 0x00074000>;
|
||||
};
|
||||
|
||||
/* Reserve 464 kB for the application in slot 1 */
|
||||
slot1_partition: partition@80000 {
|
||||
label = "image-0";
|
||||
reg = <0x00080000 0x00074000>;
|
||||
};
|
||||
|
||||
/* Reserve 32 kB for the scratch partition */
|
||||
scratch_partition: partition@f4000 {
|
||||
label = "image-1";
|
||||
reg = <0x000f4000 0x00008000>;
|
||||
};
|
||||
|
||||
/* Set 528Kb of storage at the end of the 1024Kb of flash */
|
||||
storage_partition: partition@fc000 {
|
||||
label = "image-scratch";
|
||||
reg = <0x000fc000 0x00084000>;
|
||||
};
|
||||
};
|
||||
};
|
18
boards/arm/efr32xg24_dk2601b/efr32xg24_dk2601b.yaml
Normal file
18
boards/arm/efr32xg24_dk2601b/efr32xg24_dk2601b.yaml
Normal file
|
@ -0,0 +1,18 @@
|
|||
identifier: efr32xg24_dk2601b
|
||||
name: BRD4601B
|
||||
type: mcu
|
||||
arch: arm
|
||||
ram: 256
|
||||
flash: 1536
|
||||
toolchain:
|
||||
- zephyr
|
||||
- gnuarmemb
|
||||
supported:
|
||||
- gpio
|
||||
- uart
|
||||
testing:
|
||||
ignore_tags:
|
||||
- net
|
||||
- bluetooth
|
||||
- pm
|
||||
- hwinfo
|
18
boards/arm/efr32xg24_dk2601b/efr32xg24_dk2601b_defconfig
Normal file
18
boards/arm/efr32xg24_dk2601b/efr32xg24_dk2601b_defconfig
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Copyright (c) 2022 Silicon Labs
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
CONFIG_SOC_SERIES_EFR32MG24=y
|
||||
CONFIG_BOARD_EFR32XG24_DK2601B=y
|
||||
CONFIG_ARM_MPU=y
|
||||
CONFIG_CONSOLE=y
|
||||
CONFIG_UART_CONSOLE=y
|
||||
CONFIG_SERIAL=y
|
||||
CONFIG_CORTEX_M_SYSTICK=y
|
||||
CONFIG_GPIO=y
|
||||
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=76800000
|
||||
CONFIG_CMU_HFCLK_HFXO=y
|
||||
CONFIG_SOC_GECKO_EMU_DCDC=y
|
||||
CONFIG_SOC_GECKO_EMU_DCDC_MODE_ON=y
|
||||
CONFIG_CMU_HFCLK_LFXO=y
|
||||
CONFIG_HW_STACK_PROTECTION=y
|
||||
CONFIG_PINCTRL=y
|
5
boards/arm/efr32xg24_dk2601b/pre_dt_board.cmake
Normal file
5
boards/arm/efr32xg24_dk2601b/pre_dt_board.cmake
Normal file
|
@ -0,0 +1,5 @@
|
|||
# Copyright (c) 2021 Linaro Limited
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
# SPI is implemented via usart so node name isn't spi@...
|
||||
list(APPEND EXTRA_DTC_FLAGS "-Wno-spi_bus_bridge")
|
14
boards/arm/efr32xg24_dk2601b/sl_device_init_hfxo_config.h
Normal file
14
boards/arm/efr32xg24_dk2601b/sl_device_init_hfxo_config.h
Normal file
|
@ -0,0 +1,14 @@
|
|||
/*
|
||||
* Copyright (c) 2023 Antmicro <www.antmicro.com>
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef SL_DEVICE_INIT_HFXO_CONFIG_H
|
||||
#define SL_DEVICE_INIT_HFXO_CONFIG_H
|
||||
|
||||
#define SL_DEVICE_INIT_HFXO_MODE cmuHfxoOscMode_Crystal
|
||||
#define SL_DEVICE_INIT_HFXO_FREQ 39000000
|
||||
#define SL_DEVICE_INIT_HFXO_CTUNE 140
|
||||
|
||||
#endif /* SL_DEVICE_INIT_HFXO_CONFIG_H */
|
|
@ -20,6 +20,5 @@ config SOC_SERIES_EFR32MG24
|
|||
select SOC_GECKO_EMU
|
||||
select SOC_GECKO_GPIO
|
||||
select SOC_GECKO_DEV_INIT
|
||||
select COUNTER_GECKO_STIMER
|
||||
help
|
||||
Enable support for EFR32MG24 Mighty Gecko MCU series
|
||||
|
|
2
west.yml
2
west.yml
|
@ -119,7 +119,7 @@ manifest:
|
|||
groups:
|
||||
- hal
|
||||
- name: hal_silabs
|
||||
revision: 9dcaa761258cfdfecaacc5a9f0af92f6535d74a3
|
||||
revision: ed4185ce6f6598892fba6ce1b6dede77b217fb37
|
||||
path: modules/hal/silabs
|
||||
groups:
|
||||
- hal
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue