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

EFM32: add cpu family EFR32ZG23 and board xG23-PK6068A #18780

Merged
merged 11 commits into from
Oct 26, 2022
22 changes: 22 additions & 0 deletions boards/xg23-pk6068a/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright (c) 2022 SSV Software Systems GmbH
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.

config BOARD
default "xg23-pk6068a" if BOARD_XG23_PK6068A

config BOARD_XG23_PK6068A
bool
default y
select CPU_MODEL_EFR32ZG23A020F512GM48

# Put defined MCU peripherals here (in alphabetical order)
select HAS_PERIPH_I2C
select HAS_PERIPH_SPI
select HAS_PERIPH_TIMER
select HAS_PERIPH_UART

# Put other features for this board (in alphabetical order)
select HAVE_SAUL_GPIO
3 changes: 3 additions & 0 deletions boards/xg23-pk6068a/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
MODULE = board

include $(RIOTBASE)/Makefile.base
3 changes: 3 additions & 0 deletions boards/xg23-pk6068a/Makefile.dep
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += saul_gpio
endif
9 changes: 9 additions & 0 deletions boards/xg23-pk6068a/Makefile.features
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CPU = efm32
CPU_FAM = efr32zg23
CPU_MODEL = efr32zg23a020f512gm48

# Put defined MCU peripherals here (in alphabetical order)
FEATURES_PROVIDED += periph_i2c
FEATURES_PROVIDED += periph_spi
FEATURES_PROVIDED += periph_timer
FEATURES_PROVIDED += periph_uart
6 changes: 6 additions & 0 deletions boards/xg23-pk6068a/Makefile.include
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# use JLink for flashing
PROGRAMMER ?= jlink
JLINK_DEVICE = EFR32ZG23BXXXF512
JLINK_PRE_FLASH = r
FLASH_ADDR = 0x08000000
BAUD ?= 115200
38 changes: 38 additions & 0 deletions boards/xg23-pk6068a/board.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Copyright (C) 2022 SSV Software Systems GmbH
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/

/**
* @ingroup boards_xg23-pk6068a
* @{
*
* @file
* @brief Board specific implementations for the xG23-PK6068A board
*
* @author Juergen Fitschen <[email protected]>
*
* @}
*/

#include "cpu.h"
#include "board.h"
#include "periph/gpio.h"

void board_init(void)
{
/* Enable VCOM iface */
gpio_init(VCOM_EN_PIN, GPIO_OUT);
gpio_set(VCOM_EN_PIN);

#ifndef RIOTBOOT
#ifdef MODULE_SI7021
/* Enable Si7021 sensor */
gpio_init(SI7021_EN_PIN, GPIO_OUT);
gpio_set(SI7021_EN_PIN);
#endif
#endif
}
121 changes: 121 additions & 0 deletions boards/xg23-pk6068a/doc.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
/**
* @defgroup boards_xg23-pk6068a Silicon Labs xG23-PK6068A starter kit
* @ingroup boards
* @brief Support for the xG23-PK6068A board.

## Overview
The EFR32xG23 (xG23) Pro Kit is designed to support the development of Wireless
IoT devices based on Sub-GHz wireless protocols. The Pro Kit includes a radio
board that provides a complete reference design for the EFR32xG23 Wireless SoC,
with the matching network for +20 dBm covering 868 to 915 MHz.

The main board contains an onboard J-Link debugger with a Packet Trace
Interface and a Virtual COM port, enabling application development and
debugging of the attached radio board as well as external hardware through an
expansion header.

## Hardware

### MCU
| MCU | EFR32ZG23 |
|-----------------|--------------------------------------------------------------------------------------------------|
| Family | ARM Cortex-M33 |
| Vendor | Silicon Labs |
| Vendor Family | EFM32 Wireless Gecko |
| RAM | 64.0 KiB |
| Flash | 512.0 KiB |
| EEPROM | no |
| Frequency | up to 78 MHz |
| FPU | yes |
| MPU | no |
| DMA | 8 channels |
| Timers | 4x 16-bits, 1x 32-bits |
| ADCs | 16-bit ADC |
| UARTs | 1x USART, 3x EUSART |
| SPIs | 1x USART |
| I2Cs | 2x |
| Vcc | 1.71 V - 3.8 V |
| Datasheet | [EFR32ZG23](https://www.silabs.com/documents/public/data-sheets/efr32zg23-datasheet.pdf) |
| Manual | [EFR32xG23](https://www.silabs.com/documents/public/reference-manuals/efr32xg23-rm.pdf) |
| Board Manual | [xG23](https://www.silabs.com/documents/public/user-guides/ug507-brd4210a-user-guide.pdf) |
| Board Schematic | [Main Board BRD4001A](https://www.silabs.com/documents/public/schematic-files/BRD4001A-A01-schematic.pdf), [EFR32ZG23 Module BRD4210A](https://www.silabs.com/documents/public/schematic-files/BRD4210A-A01-schematic.pdf) |

### Pinout

This is the pinout of the expansion header on the right side of the board.
PIN 1 is the bottom-left contact when the header faces you horizontally.

| | PIN | PIN | |
|------|-----|-----|------|
| 3V3 | 20 | 19 | RES |
| 5V | 18 | 17 | RES |
| PC7 | 16 | 15 | PC5 |
| PA9 | 14 | 13 | PA7 |
| PA8 | 12 | 11 | PA6 |
| PC0 | 10 | 9 | PD2 |
| PC3 | 8 | 7 | PA5 |
| PC2 | 6 | 5 | PA0 |
| PC1 | 4 | 3 | PA10 |
| VMCU | 2 | 1 | GND |


### Peripheral mapping
| Peripheral | Number | Hardware | Pins | Comments | Min. Power Mode |
|------------|---------|-----------------|--------------------------------|----------------------------------|-----------------|
| I2C | 0 | I2C0 | SDA: PC7, CLK: PC5 | | EM1 |
| SPI | 0 | USART0 | MOSI: PC1, MISO: PC2, CLK: PC3 | PC4 used as CS for Serial Flash | EM1 |
| Timer | 0 | TIMER0 | | Default ztimer backend | EM1 |
| | 1 | LETIMER0 | | | EM3 |
| UART | 0 | EUSART1 | RX: PA9, TX: PA8 | Default STDIO output | EM1 |

### User interface
| Peripheral | Mapped to | Pin | Comments |
|------------|-----------|------|------------|
| Button | PB0 | PB1 | |
| | PB1 | PB3 | |
| LED | LED0 | PB2 | Yellow LED |
| | LED1 | PD3 | Yellow LED |

## Implementation Status
| Device | ID | Supported | Comments |
|-------------------------------|-------------|-----------|----------------------------------------------------------------|
| MCU | EFR32ZG | yes | Power modes supported |
| Low-level driver | ADC | no | |
| | Flash | yes | |
| | GPIO | yes | Interrupts are shared across pins (see reference manual) |
| | HW Crypto | partially | Only hwrng |
| | I2C | yes | |
| | PWM | no | |
| | RTC | no | As RTT or RTC |
| | SPI | partially | Only master mode |
| | Timer | yes | |
| | UART | yes | |
| LCD driver | LS013B7DH03 | yes | Sharp Low Power Memory LCD via the U8g2 package |
| Temperature + humidity sensor | Si7021 | yes | Silicon Labs Temperature + Humidity sensor |

## Flashing the device
To flash, [SEGGER JLink](https://www.segger.com/jlink-software.html) is
required.

Flashing is supported by RIOT-OS using the command below:

```
make flash
```

To run the GDB debugger, use the command:

```
make debug
```

Or, to connect with your own debugger:

```
make debug-server
```

## License information
* Silicon Labs' EMLIB: zlib-style license (permits distribution of source).

*/
126 changes: 126 additions & 0 deletions boards/xg23-pk6068a/include/board.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
/*
* Copyright (C) 2022 SSV Software Systems GmbH
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/

/**
* @ingroup boards_xg23-pk6068a
* @{
*
* @file
* @brief Board specific definitions for the xG23-PK6068A
*
* @author Juergen Fitschen <[email protected]>
*/

#ifndef BOARD_H
#define BOARD_H

#include "cpu.h"
#include "periph_conf.h"
#include "periph_cpu.h"
#include "periph/gpio.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
* @brief Initialize pm_layered with no pre-defined blockers
*
* All peripheral drivers keep track of required pm modes.
*/
#define PM_BLOCKER_INITIAL { 0, 0, 0 }

/**
* @brief Power mode required for GPIO IRQs
*
* If all GPIO IRQs are expected on port A or B, EM3 is the lowest allowed
* power mode. No power level has to be blocked in this case.
* If GPIO IRQs shall be fired on port C or D, we must stay in EM1.
* Uncomment the line down below in this case.
*/
/* #define GPIO_INT_PM_BLOCKER PM_MODE_EM2 */

/**
* @name Board VCOM interface
*
* Define the GPIO pin to enable the VCOM interface
*/
#define VCOM_UART UART_DEV(0)
#define VCOM_EN_PIN GPIO_PIN(PB, 0)

/**
* @name Push button pin definitions
* @{
*/
#define PB0_PIN GPIO_PIN(PB, 1)
#define PB1_PIN GPIO_PIN(PB, 3)
/** @} */

/**
* @name LED pin definitions
* @{
*/
#define LED0_PIN GPIO_PIN(PB, 2)
#define LED1_PIN GPIO_PIN(PD, 3)
/** @} */

/**
* @name Macros for controlling the on-board LEDs
* @{
*/
#define LED0_ON gpio_set(LED0_PIN)
#define LED0_OFF gpio_clear(LED0_PIN)
#define LED0_TOGGLE gpio_toggle(LED0_PIN)
#define LED1_ON gpio_set(LED1_PIN)
#define LED1_OFF gpio_clear(LED1_PIN)
#define LED1_TOGGLE gpio_toggle(LED1_PIN)
/** @} */

/**
* @name Display configuration
*
* Connection to the on-board Sharp Memory LCD (LS013B7DH03).
* @{
*/
#define DISP_SPI SPI_DEV(0)
#define DISP_SCS_PIN GPIO_PIN(PC, 8)
#define DISP_EXTCOMIN_PIN GPIO_PIN(PC, 6)
#define DISP_ENABLE_PIN GPIO_PIN(PC, 9)
/** @} */

/**
* @name Flash configuration
*
* Connection to the on-board MX25R8035F.
* @{
*/
#define FLASH_SPI SPI_DEV(0)
#define FLASH_CS_PIN GPIO_PIN(PC, 4)
/** @} */

/**
* @name Sensor configuration
*
* Connection to the on-board Si7021 temperature & humidity sensor.
* @{
*/
#define SI70XX_PARAM_I2C_DEV I2C_DEV(0)
#define SI7021_EN_PIN GPIO_PIN(PC, 9)
/** @} */

/**
* @brief Initialize board specific hardware
*/
void board_init(void);

#ifdef __cplusplus
}
#endif

#endif /* BOARD_H */
/** @} */
63 changes: 63 additions & 0 deletions boards/xg23-pk6068a/include/gpio_params.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
* Copyright (C) 2022 SSV Software Systems GmbH
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/

/**
* @ingroup boards_xg23-pk6068a
* @{
*
* @file
* @brief Board specific configuration of direct mapped GPIOs
*
* @author Juergen Fitschen <[email protected]>
*/

#ifndef GPIO_PARAMS_H
#define GPIO_PARAMS_H

#include "board.h"
#include "saul/periph.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
* @brief GPIO pin configuration
*/
static const saul_gpio_params_t saul_gpio_params[] =
{
{
.name = "LED 0",
.pin = LED0_PIN,
.mode = GPIO_OUT
},
{
.name = "LED 1",
.pin = LED1_PIN,
.mode = GPIO_OUT
},
{
.name = "Button 1",
.pin = PB0_PIN,
.mode = GPIO_IN_PU,
.flags = SAUL_GPIO_INVERTED
},
{
.name = "Button 2",
.pin = PB1_PIN,
.mode = GPIO_IN_PU,
.flags = SAUL_GPIO_INVERTED
}
};

#ifdef __cplusplus
}
#endif

#endif /* GPIO_PARAMS_H */
/** @} */
Loading