diff --git a/boards/arm/efr32_radio/CMakeLists.txt b/boards/arm/efr32_radio/CMakeLists.txt index a7a82c8b608..28383c1429d 100644 --- a/boards/arm/efr32_radio/CMakeLists.txt +++ b/boards/arm/efr32_radio/CMakeLists.txt @@ -4,3 +4,5 @@ if(CONFIG_UART_GECKO) zephyr_library() zephyr_library_sources(board.c) endif() + +zephyr_include_directories(.) diff --git a/boards/arm/efr32_radio/Kconfig.board b/boards/arm/efr32_radio/Kconfig.board index c493455d554..6a9175aa9c3 100644 --- a/boards/arm/efr32_radio/Kconfig.board +++ b/boards/arm/efr32_radio/Kconfig.board @@ -23,6 +23,12 @@ config BOARD_EFR32_RADIO_BRD4180A select BOARD_EFR32_RADIO select SOC_PART_NUMBER_EFR32MG21A020F1024IM32 +config BOARD_EFR32_RADIO_BRD4187C + bool "Silicon Labs BRD4187C (Mighty Gecko Radio Board)" + depends on SOC_SERIES_EFR32MG24 + select BOARD_EFR32_RADIO + select SOC_PART_NUMBER_EFR32MG24B220F1536IM48 + config BOARD_EFR32_RADIO_BRD4255A bool "Silicon Labs BRD4255A (Flex Gecko Radio Board)" depends on SOC_SERIES_EFR32FG13P diff --git a/boards/arm/efr32_radio/Kconfig.defconfig b/boards/arm/efr32_radio/Kconfig.defconfig index 2ff8a57ea4e..60686803c2f 100644 --- a/boards/arm/efr32_radio/Kconfig.defconfig +++ b/boards/arm/efr32_radio/Kconfig.defconfig @@ -10,14 +10,21 @@ config BOARD default "efr32_radio_brd4104a" if BOARD_EFR32_RADIO_BRD4104A default "efr32_radio_brd4250b" if BOARD_EFR32_RADIO_BRD4250B default "efr32_radio_brd4180a" if BOARD_EFR32_RADIO_BRD4180A + default "efr32_radio_brd4187c" if BOARD_EFR32_RADIO_BRD4187C default "efr32_radio_brd4255a" if BOARD_EFR32_RADIO_BRD4255A config CMU_HFXO_FREQ + default 39000000 if BOARD_EFR32_RADIO_BRD4187C default 38400000 config CMU_LFXO_FREQ default 32768 +config FLASH_BASE_ADDRESS + hex + default 0x08000000 if BOARD_EFR32_RADIO_BRD4187C + default 0x0 + config LOG_BACKEND_SWO_FREQ_HZ default 875000 depends on LOG_BACKEND_SWO diff --git a/boards/arm/efr32_radio/board.c b/boards/arm/efr32_radio/board.c index b1c80128b33..d6ac8237b78 100644 --- a/boards/arm/efr32_radio/board.c +++ b/boards/arm/efr32_radio/board.c @@ -9,13 +9,16 @@ #include /* This pin is used to enable the serial port using the board controller */ -#ifdef CONFIG_BOARD_EFR32_RADIO_BRD4180A +#if defined(CONFIG_BOARD_EFR32_RADIO_BRD4180A) #define VCOM_ENABLE_GPIO_NODE DT_NODELABEL(gpiod) #define VCOM_ENABLE_GPIO_PIN 4 +#elif defined(CONFIG_BOARD_EFR32_RADIO_BRD4187C) +#define VCOM_ENABLE_GPIO_NODE DT_NODELABEL(gpiob) +#define VCOM_ENABLE_GPIO_PIN 0 #else #define VCOM_ENABLE_GPIO_NODE DT_NODELABEL(gpioa) #define VCOM_ENABLE_GPIO_PIN 5 -#endif /* CONFIG_BOARD_EFR32_RADIO_BRD4180A */ +#endif static int efr32_radio_init(void) { diff --git a/boards/arm/efr32_radio/board.cmake b/boards/arm/efr32_radio/board.cmake index 4c5100906c0..c43175d6b01 100644 --- a/boards/arm/efr32_radio/board.cmake +++ b/boards/arm/efr32_radio/board.cmake @@ -8,6 +8,8 @@ elseif(CONFIG_BOARD_EFR32_RADIO_BRD4250B) board_runner_args(jlink "--device=EFR32FG1PxxxF256") elseif(CONFIG_BOARD_EFR32_RADIO_BRD4180A) board_runner_args(jlink "--device=EFR32MG21AxxxF1024") +elseif(CONFIG_BOARD_EFR32_RADIO_BRD4187C) +board_runner_args(jlink "--device=EFR32MG24BxxxF1536") elseif(CONFIG_BOARD_EFR32_RADIO_BRD4255A) board_runner_args(jlink "--device=EFR32FG13PxxxF512") endif() diff --git a/boards/arm/efr32_radio/doc/brd4187c.rst b/boards/arm/efr32_radio/doc/brd4187c.rst new file mode 100644 index 00000000000..82be3a8f2b7 --- /dev/null +++ b/boards/arm/efr32_radio/doc/brd4187c.rst @@ -0,0 +1,162 @@ +.. _efr32_radio_brd4187c: + +EFR32 BRD4187C (xG24-RB4187C) +############################# + +Overview +******** + +The EFR32MG24 Mighty Gecko Radio Board is one of the two +radio boards delivered with `xG24-PK6010A Website`_. It contains +a Wireless System-On-Chip from the EFR32MG24 family built on an +ARM Cortex®-M33F processor with excellent low power capabilities. + +.. figure:: efr32mg24-xg24-rb4187c.jpg + :align: center + :alt: xG24-RB4187C Mighty Gecko Radio Board + + xG24-RB4187C (image courtesy of Silicon Labs) + +The BRD4187C a.k.a. xG24-RB4187C radio board plugs into the Wireless Pro Kit +Mainboard BRD4002A and is supported as one of :ref:`efr32_radio`. + +Hardware +******** + +- EFR32MG24B220F1536IM48 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 (39 MHz). + +For more information about the EFR32MG24 SoC and BRD4187C board, refer to these +documents: + +- `EFR32MG24 Website`_ +- `EFR32MG24 Datasheet`_ +- `EFR32xG24 Reference Manual`_ +- `xG24-PK6010A Website`_ +- `BRD4187C 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 | ++-----------+------------+-------------------------------------+ +| I2C | on-chip | i2c | ++-----------+------------+-------------------------------------+ +| TRNG | on-chip | trng | ++-----------+------------+-------------------------------------+ +| 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 | ++=======+=============+=====================================+ +| PB2 | GPIO | LED0 | ++-------+-------------+-------------------------------------+ +| PB4 | GPIO | LED1 | ++-------+-------------+-------------------------------------+ +| PB1 | GPIO | Push Button 0 | ++-------+-------------+-------------------------------------+ +| PB3 | GPIO | Push Button 1 | ++-------+-------------+-------------------------------------+ +| PB0 | GPIO | Board Controller Enable | +| | | VCOM_ENABLE | ++-------+-------------+-------------------------------------+ +| PA8 | USART0_TX | UART Console VCOM_TX US0_TX | ++-------+-------------+-------------------------------------+ +| PA9 | USART0_RX | UART Console VCOM_RX US0_RX | ++-------+-------------+-------------------------------------+ + +The default configuration can be found in the defconfig file: + + ``boards/arm/efr32_radio/efr32_radio_brd4187c_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 +************************* + +Please refer to +:ref:`Programming and Debugging EFR32 Radio Board ` +for details on the supported debug interfaces. + +Flashing +======== + +Connect the BRD4002A board with a mounted BRD4187C radio module to your host +computer using the USB port. + +Here is an example for the :ref:`hello_world` application. + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: efr32_radio_brd4187c + :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 should see the following message in the terminal: + +.. code-block:: console + + Hello World! efr32_radio_brd4187c + + +.. _xG24-PK6010A Website: + https://www.silabs.com/development-tools/wireless/efr32xg24-pro-kit-20-dbm + +.. _BRD4187C User Guide: + https://www.silabs.com/documents/public/user-guides/ug526-brd4187c-user-guide.pdf + +.. _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/brd4187c-rm.pdf diff --git a/boards/arm/efr32_radio/doc/efr32mg24-xg24-rb4187c.jpg b/boards/arm/efr32_radio/doc/efr32mg24-xg24-rb4187c.jpg new file mode 100644 index 00000000000..6c9a08e3616 Binary files /dev/null and b/boards/arm/efr32_radio/doc/efr32mg24-xg24-rb4187c.jpg differ diff --git a/boards/arm/efr32_radio/doc/index.rst b/boards/arm/efr32_radio/doc/index.rst index 58557c89f44..43990cac492 100644 --- a/boards/arm/efr32_radio/doc/index.rst +++ b/boards/arm/efr32_radio/doc/index.rst @@ -10,6 +10,7 @@ EFR32 Radio Boards brd4250b.rst brd4180a.rst brd4255a.rst + brd4187c.rst Overview ******** @@ -178,6 +179,9 @@ Reset the board and you should see the following message in the terminal: .. _EFR32MG21 Mighty Gecko Wireless Starter Kit User's Guide: https://www.silabs.com/documents/public/user-guides/ug385-brd4180a-user-guide.pdf +.. _EFR32MG24 Mighty Gecko Wireless Starter Kit User's Guide: + https://www.silabs.com/documents/public/user-guides/ug526-brd4187c-user-guide.pdf + .. _WSTK Main Board BRD4001A Schematics: https://www.silabs.com/documents/public/schematic-files/BRD4001A-A01-schematic.pdf diff --git a/boards/arm/efr32_radio/efr32_radio_brd4187c.dts b/boards/arm/efr32_radio/efr32_radio_brd4187c.dts new file mode 100644 index 00000000000..818c8df90fb --- /dev/null +++ b/boards/arm/efr32_radio/efr32_radio_brd4187c.dts @@ -0,0 +1,130 @@ +/* + * Copyright (c) 2023 Fr. Sauter AG + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; +#include + +/ { + model = "Silicon Labs BRD4187C (Mighty Gecko Radio Board)"; + compatible = "silabs,efr32mg24_brd4187c", "silabs,efr32mg24"; + + chosen { + zephyr,console = &usart0; + zephyr,shell-uart = &usart0; + zephyr,sram = &sram0; + zephyr,flash = &flash0; + zephyr,code-partition = &slot0_partition; + }; + + /* 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 = <&gpiob GECKO_PIN(2) GPIO_ACTIVE_LOW>; + label = "LED 0"; + }; + led1: led_1 { + gpios = <&gpiob GECKO_PIN(4) GPIO_ACTIVE_LOW>; + label = "LED 1"; + }; + }; + + buttons { + compatible = "gpio-keys"; + button0: button_0 { + gpios = <&gpiob GECKO_PIN(1) GPIO_ACTIVE_LOW>; + label = "User Push Button 0"; + }; + button1: button_1 { + gpios = <&gpiob GECKO_PIN(3) GPIO_ACTIVE_LOW>; + label = "User Push Button 1"; + }; + }; + +}; + +&cpu0 { + clock-frequency = <39000000>; +}; + +&usart0 { + current-speed = <115200>; + location-rx = ; + location-tx = ; + status = "okay"; +}; + +&gpio { + location-swo = <0>; + status = "okay"; +}; + +&gpioa { + status = "okay"; +}; + +&gpiob { + status = "okay"; +}; + +&gpioc { + status = "okay"; +}; + +&gpiod { + status = "okay"; +}; + +&wdog0 { + 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 DT_SIZE_K(48)>; + read-only; + }; + + /* Reserve 720 kB for the application in slot 0 */ + slot0_partition: partition@c000 { + label = "image-0"; + reg = <0x0000c000 0x000B4000>; + }; + + /* Reserve 720 kB for the application in slot 1 */ + slot1_partition: partition@C0000 { + label = "image-1"; + reg = <0x000C0000 0x000B4000>; + }; + + /* Reserve 32 kB for the scratch partition */ + scratch_partition: partition@174000 { + label = "image-scratch"; + reg = <0x00174000 DT_SIZE_K(32)>; + }; + + /* Set 16 kB of storage at the end of the 1536 kB of flash */ + storage_partition: partition@17c000 { + label = "storage"; + reg = <0x0017c000 DT_SIZE_K(16)>; + }; + }; +}; diff --git a/boards/arm/efr32_radio/efr32_radio_brd4187c.yaml b/boards/arm/efr32_radio/efr32_radio_brd4187c.yaml new file mode 100644 index 00000000000..3e9b730855c --- /dev/null +++ b/boards/arm/efr32_radio/efr32_radio_brd4187c.yaml @@ -0,0 +1,20 @@ +identifier: efr32_radio_brd4187c +name: BRD4187C +type: mcu +arch: arm +ram: 256 +flash: 1536 +toolchain: + - zephyr + - gnuarmemb + - xtools +supported: + - gpio + - uart + - watchdog +testing: + ignore_tags: + - net + - bluetooth + - pm + - hwinfo diff --git a/boards/arm/efr32_radio/efr32_radio_brd4187c_defconfig b/boards/arm/efr32_radio/efr32_radio_brd4187c_defconfig new file mode 100644 index 00000000000..fc273c86e4f --- /dev/null +++ b/boards/arm/efr32_radio/efr32_radio_brd4187c_defconfig @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_SOC_SERIES_EFR32MG24=y +CONFIG_BOARD_EFR32_RADIO_BRD4187C=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=39000000 +CONFIG_CMU_HFCLK_HFXO=y diff --git a/boards/arm/efr32_radio/sl_device_init_hfxo_config.h b/boards/arm/efr32_radio/sl_device_init_hfxo_config.h new file mode 100644 index 00000000000..c410e7c4093 --- /dev/null +++ b/boards/arm/efr32_radio/sl_device_init_hfxo_config.h @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2023 Antmicro + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef SL_DEVICE_INIT_HFXO_CONFIG_H +#define SL_DEVICE_INIT_HFXO_CONFIG_H + +#ifdef CONFIG_BOARD_EFR32_RADIO_BRD4187C + +#define SL_DEVICE_INIT_HFXO_MODE cmuHfxoOscMode_Crystal +#define SL_DEVICE_INIT_HFXO_FREQ 39000000 +#define SL_DEVICE_INIT_HFXO_CTUNE 140 + +#endif /* CONFIG_BOARD_EFR32_RADIO_BRD4187C */ + +#endif /* SL_DEVICE_INIT_HFXO_CONFIG_H */ diff --git a/dts/arm/silabs/efr32mg24b220f1536im48.dtsi b/dts/arm/silabs/efr32mg24b220f1536im48.dtsi new file mode 100644 index 00000000000..a7c2859b0a1 --- /dev/null +++ b/dts/arm/silabs/efr32mg24b220f1536im48.dtsi @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2023 Fr. Sauter AG + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include + +/ { + sram0: memory@20000000 { + reg = <0x20000000 DT_SIZE_K(256)>; + }; + + soc { + compatible = "silabs,efr32mg24b220f1536im48", + "silabs,efr32mg24", "silabs,efr32", + "simple-bus"; + + flash-controller@50030000 { + flash0: flash@0 { + reg = <0 DT_SIZE_K(1536)>; + }; + }; + }; +}; diff --git a/soc/arm/silabs_exx32/efr32mg24/Kconfig.defconfig.series b/soc/arm/silabs_exx32/efr32mg24/Kconfig.defconfig.series index 9164e669fd3..8c85a13a939 100644 --- a/soc/arm/silabs_exx32/efr32mg24/Kconfig.defconfig.series +++ b/soc/arm/silabs_exx32/efr32mg24/Kconfig.defconfig.series @@ -9,6 +9,7 @@ config SOC_SERIES default "efr32mg24" config SOC_PART_NUMBER + default "EFR32MG24B220F1536IM48" if SOC_PART_NUMBER_EFR32MG24B220F1536IM48 default "EFR32MG24B310F1536IM48" if SOC_PART_NUMBER_EFR32MG24B310F1536IM48 config NUM_IRQS diff --git a/soc/arm/silabs_exx32/efr32mg24/Kconfig.soc b/soc/arm/silabs_exx32/efr32mg24/Kconfig.soc index 7ef9101dd85..14d5c18d498 100644 --- a/soc/arm/silabs_exx32/efr32mg24/Kconfig.soc +++ b/soc/arm/silabs_exx32/efr32mg24/Kconfig.soc @@ -3,6 +3,10 @@ # Copyright (c) 2020 TriaGnoSys GmbH # SPDX-License-Identifier: Apache-2.0 +config SOC_PART_NUMBER_EFR32MG24B220F1536IM48 + bool + depends on SOC_SERIES_EFR32MG24 + config SOC_PART_NUMBER_EFR32MG24B310F1536IM48 bool depends on SOC_SERIES_EFR32MG24