diff --git a/examples/Makefile-efr32mg21 b/examples/Makefile-efr32mg21 index ba8854d58..161e66ee6 100644 --- a/examples/Makefile-efr32mg21 +++ b/examples/Makefile-efr32mg21 @@ -70,7 +70,11 @@ AbsTopSourceDir := $(dir $(realpath $(firstword $(MAKEFILE_LIST) ifeq ($(BOARD_LOWERCASE),brd4180a) MCU = EFR32MG21A020F1024IM32 else -$(error Please provide a value for BOARD variable e.g BOARD=BRD4180A (currently supported BRD4180A)) +ifeq ($(BOARD_LOWERCASE),brd4180b) +MCU = EFR32MG21A020F1024IM32 +else +$(error Please provide a value for BOARD variable e.g BOARD=BRD4180A (currently supported BRD4180A, BRD4180B)) +endif endif EFR32_MBEDTLS_CPPFLAGS = -DMBEDTLS_CONFIG_FILE='\"mbedtls_config.h\"' diff --git a/examples/platforms/efr32/efr32mg13/brd4168a/hal-config.h b/examples/platforms/efr32/efr32mg13/brd4168a/hal-config.h index e9ce34792..98fd43f4c 100644 --- a/examples/platforms/efr32/efr32mg13/brd4168a/hal-config.h +++ b/examples/platforms/efr32/efr32mg13/brd4168a/hal-config.h @@ -246,7 +246,6 @@ // [PYD1698]$ // $[SERIAL] -#define BSP_SERIAL_APP_PORT (HAL_SERIAL_PORT_USART0) #define BSP_SERIAL_APP_TX_PIN (0U) #define BSP_SERIAL_APP_TX_PORT (gpioPortA) #define BSP_SERIAL_APP_TX_LOC (0U) diff --git a/examples/platforms/efr32/efr32mg21/brd4180b/board_config.h b/examples/platforms/efr32/efr32mg21/brd4180b/board_config.h new file mode 100644 index 000000000..1507a9d1f --- /dev/null +++ b/examples/platforms/efr32/efr32mg21/brd4180b/board_config.h @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2020, The OpenThread Authors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the copyright holder nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * @file + * This file includes dev board compile-time configuration constants for efr32. + * + */ + +#ifndef __BOARD_CONFIG_H__ +#define __BOARD_CONFIG_H__ + +#define RADIO_CONFIG_2P4GHZ_OQPSK_SUPPORT 1 /// Dev board suppports OQPSK modulation in 2.4GHz band. +#define RADIO_CONFIG_915MHZ_OQPSK_SUPPORT 0 /// Dev board doesn't support OQPSK modulation in 915MHz band. + +#ifndef RADIO_CONFIG_DEBUG_COUNTERS_SUPPORT +#define RADIO_CONFIG_DEBUG_COUNTERS_SUPPORT 0 /// Set to 1 to enable debug counters in radio.c +#endif + +#ifndef RADIO_CONFIG_DMP_SUPPORT +#define RADIO_CONFIG_DMP_SUPPORT 0 /// Set to 1 to enable Dynamic Multi-Protocol support in radio.c +#endif + +#endif // __BOARD_CONFIG_H__ diff --git a/examples/platforms/efr32/efr32mg21/brd4180b/hal-config.h b/examples/platforms/efr32/efr32mg21/brd4180b/hal-config.h new file mode 100644 index 000000000..eca62f431 --- /dev/null +++ b/examples/platforms/efr32/efr32mg21/brd4180b/hal-config.h @@ -0,0 +1,279 @@ +#ifndef HAL_CONFIG_H +#define HAL_CONFIG_H + +#include "em_device.h" +#include "hal-config-types.h" + +// This file is auto-generated by Hardware Configurator in Simplicity Studio. +// Any content between $[ and ]$ will be replaced whenever the file is regenerated. +// Content outside these regions will be preserved. + +// $[ACMP0] +// [ACMP0]$ + +// $[ACMP1] +// [ACMP1]$ + +// $[ANTDIV] +// [ANTDIV]$ + +// $[BTL_BUTTON] +// [BTL_BUTTON]$ + +// $[BUTTON] +#define BSP_BUTTON_PRESENT (1) + +#define BSP_BUTTON0_PIN (0U) +#define BSP_BUTTON0_PORT (gpioPortB) + +#define BSP_BUTTON1_PIN (1U) +#define BSP_BUTTON1_PORT (gpioPortB) + +#define BSP_BUTTON_COUNT (2U) +#define BSP_BUTTON_INIT \ + { \ + {BSP_BUTTON0_PORT, BSP_BUTTON0_PIN}, { BSP_BUTTON1_PORT, BSP_BUTTON1_PIN } \ + } +#define BSP_BUTTON_GPIO_DOUT (HAL_GPIO_DOUT_LOW) +#define BSP_BUTTON_GPIO_MODE (HAL_GPIO_MODE_INPUT) +#define HAL_BUTTON_COUNT (2U) +#define HAL_BUTTON_ENABLE \ + { \ + 0, 1 \ + } +// [BUTTON]$ + +// $[CMU] +#define HAL_CLK_HFCLK_SOURCE (HAL_CLK_HFCLK_SOURCE_HFXO) +#define HAL_CLK_PLL_CONFIGURATION (HAL_CLK_PLL_CONFIGURATION_40MHZ) +#define HAL_CLK_EM01CLK_SOURCE (HAL_CLK_HFCLK_SOURCE_HFRCODPLL) +#define HAL_CLK_EM23CLK_SOURCE (HAL_CLK_LFCLK_SOURCE_LFRCO) +#define HAL_CLK_EM4CLK_SOURCE (HAL_CLK_LFCLK_SOURCE_LFRCO) +#define HAL_CLK_RTCCCLK_SOURCE (HAL_CLK_LFCLK_SOURCE_LFRCO) +#define HAL_CLK_WDOGCLK_SOURCE (HAL_CLK_LFCLK_SOURCE_LFRCO) +#define BSP_CLK_HFXO_PRESENT (1) +#define BSP_CLK_HFXO_FREQ (38400000UL) +#define BSP_CLK_HFXO_INIT CMU_HFXOINIT_DEFAULT +#define BSP_CLK_HFXO_CTUNE (129) +#define BSP_CLK_LFXO_PRESENT (1) +#define BSP_CLK_LFXO_INIT CMU_LFXOINIT_DEFAULT +#define BSP_CLK_LFXO_FREQ (32768U) +#define BSP_CLK_LFXO_CTUNE (37U) +#define HAL_CLK_LFXO_PRECISION (100UL) +// [CMU]$ + +// $[COEX] +// [COEX]$ + +// $[EMU] +// [EMU]$ + +// $[EXTFLASH] +// [EXTFLASH]$ + +// $[EZRADIOPRO] +// [EZRADIOPRO]$ + +// $[FEM] +// [FEM]$ + +// $[GPIO] +#define PORTIO_GPIO_SWV_PIN (3U) +#define PORTIO_GPIO_SWV_PORT (gpioPortA) + +#define BSP_TRACE_SWO_PIN (3U) +#define BSP_TRACE_SWO_PORT (gpioPortA) + +// [GPIO]$ + +// $[I2C0] +// [I2C0]$ + +// $[I2C1] +// [I2C1]$ + +// $[I2CSENSOR] +// [I2CSENSOR]$ + +// $[IADC0] +// [IADC0]$ + +// $[IOEXP] +// [IOEXP]$ + +// $[LED] +#define BSP_LED_PRESENT (1) + +#define BSP_LED0_PIN (2U) +#define BSP_LED0_PORT (gpioPortD) + +#define BSP_LED1_PIN (3U) +#define BSP_LED1_PORT (gpioPortD) + +#define BSP_LED_COUNT (2U) +#define BSP_LED_INIT \ + { \ + {BSP_LED0_PORT, BSP_LED0_PIN}, { BSP_LED1_PORT, BSP_LED1_PIN } \ + } +#define HAL_LED_COUNT (2U) +#define HAL_LED_ENABLE \ + { \ + 0, 1 \ + } +#define BSP_LED_POLARITY (1) +// [LED]$ + +// $[LETIMER0] +// [LETIMER0]$ + +// $[LFXO] +// [LFXO]$ + +// $[MODEM] +// [MODEM]$ + +// $[PA] +#define HAL_PA_ENABLE (1) + +#define HAL_PA_CURVE_HEADER "pa_curves_efr32.h" +#define HAL_PA_POWER (252U) +#define HAL_PA_RAMP (10UL) +#define BSP_PA_VOLTAGE (3300U) +#define HAL_PA_SELECTION (HAL_PA_SELECTION_2P4_HP) +// [PA]$ + +// $[PORTIO] +// [PORTIO]$ + +// $[PRS] +// [PRS]$ + +// $[PTI] +#define PORTIO_PTI_DFRAME_PIN (5U) +#define PORTIO_PTI_DFRAME_PORT (gpioPortC) + +#define PORTIO_PTI_DOUT_PIN (4U) +#define PORTIO_PTI_DOUT_PORT (gpioPortC) + +#define HAL_PTI_ENABLE (1) + +#define BSP_PTI_DFRAME_PIN (5U) +#define BSP_PTI_DFRAME_PORT (gpioPortC) + +#define BSP_PTI_DOUT_PIN (4U) +#define BSP_PTI_DOUT_PORT (gpioPortC) + +#define HAL_PTI_MODE (HAL_PTI_MODE_UART) +#define HAL_PTI_BAUD_RATE (1600000UL) +// [PTI]$ + +// $[SERIAL] +#define HAL_SERIAL_RXWAKE_ENABLE (0) +#define HAL_SERIAL_IDLE_WAKE_ENABLE (1) +#define HAL_SERIAL_USART0_ENABLE (0) +#define HAL_SERIAL_USART1_ENABLE (0) +#define HAL_SERIAL_USART2_ENABLE (0) + +#define BSP_SERIAL_APP_TX_PIN (5U) +#define BSP_SERIAL_APP_TX_PORT (gpioPortA) + +#define BSP_SERIAL_APP_RX_PIN (6U) +#define BSP_SERIAL_APP_RX_PORT (gpioPortA) + +#define BSP_SERIAL_APP_CTS_PIN (4U) +#define BSP_SERIAL_APP_CTS_PORT (gpioPortA) + +#define BSP_SERIAL_APP_RTS_PIN (1U) +#define BSP_SERIAL_APP_RTS_PORT (gpioPortC) + +#define HAL_SERIAL_APP_BAUD_RATE (115200UL) +#define HAL_SERIAL_APP_FLOW_CONTROL (HAL_USART_FLOW_CONTROL_HWUART) +#define HAL_SERIAL_APP_RXSTOP (16UL) +#define HAL_SERIAL_APP_RXSTART (16UL) +#define HAL_SERIAL_APP_TX_QUEUE_SIZE (128UL) +#define HAL_SERIAL_APP_RX_QUEUE_SIZE (128UL) +// [SERIAL]$ + +// $[SPIDISPLAY] +// [SPIDISPLAY]$ + +// $[SPINCP] +// [SPINCP]$ + +// $[TIMER0] +// [TIMER0]$ + +// $[TIMER1] +// [TIMER1]$ + +// $[TIMER2] +// [TIMER2]$ + +// $[TIMER3] +// [TIMER3]$ + +// $[UARTNCP] +// [UARTNCP]$ + +// $[USART0] +#define PORTIO_USART0_CTS_PIN (4U) +#define PORTIO_USART0_CTS_PORT (gpioPortA) + +#define PORTIO_USART0_RTS_PIN (1U) +#define PORTIO_USART0_RTS_PORT (gpioPortC) + +#define PORTIO_USART0_RX_PIN (6U) +#define PORTIO_USART0_RX_PORT (gpioPortA) + +#define PORTIO_USART0_TX_PIN (5U) +#define PORTIO_USART0_TX_PORT (gpioPortA) + +#define HAL_USART0_ENABLE (1) + +#define BSP_USART0_TX_PIN (5U) +#define BSP_USART0_TX_PORT (gpioPortA) + +#define BSP_USART0_RX_PIN (6U) +#define BSP_USART0_RX_PORT (gpioPortA) + +#define BSP_USART0_CTS_PIN (4U) +#define BSP_USART0_CTS_PORT (gpioPortA) + +#define BSP_USART0_RTS_PIN (1U) +#define BSP_USART0_RTS_PORT (gpioPortC) + +#define HAL_USART0_BAUD_RATE (115200UL) +#define HAL_USART0_FLOW_CONTROL (HAL_USART_FLOW_CONTROL_HWUART) +#define HAL_USART0_RXSTOP (16UL) +#define HAL_USART0_RXSTART (16UL) +#define HAL_USART0_TX_QUEUE_SIZE (128UL) +#define HAL_USART0_RX_QUEUE_SIZE (128UL) +// [USART0]$ + +// $[USART1] +// [USART1]$ + +// $[USART2] +// [USART2]$ + +// $[VCOM] +#define HAL_VCOM_ENABLE (1) + +#define BSP_VCOM_ENABLE_PIN (4U) +#define BSP_VCOM_ENABLE_PORT (gpioPortD) + +// [VCOM]$ + +// $[VUART] +// [VUART]$ + +// $[WDOG] +#define HAL_WDOG_ENABLE (0) + +// [WDOG]$ + +#if defined(_SILICON_LABS_MODULE) +#include "sl_module.h" +#endif + +#endif /* HAL_CONFIG_H */ diff --git a/third_party/silabs/Makefile.am b/third_party/silabs/Makefile.am index 693676ca7..5825b2228 100644 --- a/third_party/silabs/Makefile.am +++ b/third_party/silabs/Makefile.am @@ -232,7 +232,6 @@ SILABS_EFR32MG12_SOURCES SILABS_EFR32MG13_SOURCES = \ gecko_sdk_suite/v3.0/hardware/kit/common/drivers/mx25flash_spi.c \ - gecko_sdk_suite/v3.0/hardware/kit/common/drivers/retargetserial.c \ gecko_sdk_suite/v3.0/platform/Device/SiliconLabs/EFR32MG13P/Source/system_efr32mg13p.c \ gecko_sdk_suite/v3.0//platform/Device/SiliconLabs/EFR32MG13P/Source/GCC/startup_efr32mg13p.c \ $(NULL)