Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions boards/realtek/rtl8777g_dongle/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Copyright (c) 2025 Realtek Semiconductor Corp.
# SPDX-License-Identifier: Apache-2.0
if BOARD_RTL8777G_DONGLE

config BOARD
default "rtl8777g_dongle"

if BT
config NUM_METAIRQ_PRIORITIES
default 1

config MAIN_STACK_SIZE
default 2048

config COMMON_LIBC_MALLOC_ARENA_SIZE
default 1024

config BT_CTLR
default n

config REALTEK_BT
default y

config BT_L2CAP_TX_MTU
default 247

config BT_BUF_EVT_RX_COUNT
default 8

config BT_BUF_EVT_RX_SIZE
default 255

config BT_BUF_ACL_TX_SIZE
default 251

config BT_BUF_ACL_RX_SIZE
default 255

config BT_BUF_ACL_RX_COUNT
default 7

endif # BT

config HW_STACK_PROTECTION
default ARCH_HAS_STACK_PROTECTION

endif # BOARD_RTL8777G_DONGLE
4 changes: 4 additions & 0 deletions boards/realtek/rtl8777g_dongle/Kconfig.rtl8777g_dongle
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (c) 2025 Realtek Semiconductor Corp.
# SPDX-License-Identifier: Apache-2.0
config BOARD_RTL8777G_DONGLE
select SOC_RTL8777G
3 changes: 3 additions & 0 deletions boards/realtek/rtl8777g_dongle/board.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
board_runner_args(jlink "--device=RTL87X2G" "--speed=4000")

include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
5 changes: 5 additions & 0 deletions boards/realtek/rtl8777g_dongle/board.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
board:
name: rtl8777g_dongle
vendor: realtek
socs:
- name: rtl8777g
105 changes: 105 additions & 0 deletions boards/realtek/rtl8777g_dongle/doc/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
.. _rtl8777g_dongle:

RTL8777G Dongle Evaluation Board
#################################

Overview
********

The RTL8777G Dongle Evaluation Board provides a hardware environment for user development, including:

- 1x Reset button
- 4x Buttons
- 3x LEDs
- 1x Micro USB-B port (connected to FT232RL USB-to-UART chip)
- 1x USB-A connector
- 25x Exposed pins (user-configurable)
- On-board ceramic antenna and IPEX socket (for optional external antenna)
- 5V to 3.3V LDO
- UART programming interface

The RTL8777G Dongle Evaluation Board features the RTL8777G SoC.
RTL8777G is an ultra-low power wireless microcontroller that supports Bluetooth 5.3/Zigbee/Thread/Matter protocols.

.. note::
The RTL8777G is part of the RTL87x2G series chip family (despite the naming inconsistency).

Hardware
********

SoC Series
==========

The RTL8777G/RTL87x2G series comprises various chip types, each supporting different hardware features.

Below are the common hardware features:

- Realtek KM4 core compatible with Arm Cortex-M55, running at 40MHz (Maximum 125MHz)
- M-profile Vector Extension (MVE) for vector computation
- 32KB I-Cache, 16KB D-Cache, and 384KB SRAM
- Hardware Keyscan / Quad Decode
- Flash On-The-Fly Decryption
- Embedded IR TX/RX
- ISO7816 Interface
- SPIC/SPI_m/SPI_s/SDIO/SD (eMMC)
- Low Power Comparator
- 8-Channel AUXADC
- CAN Bus
- I2S/DAC/AMIC/DMIC/PDM
- USB 2.0 High-Speed Interface

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

The UART2 console uses P3_0 (TX) and P3_1 (RX), connected through the on-board FT232RL
USB-to-UART converter accessible via the Micro USB-B port.

LEDs:

- LED D1 Blue: GPIOA_21 (P2_0), active high
- LED D2 Red: GPIOA_18 (P8_2, XO32K), active high
- LED D3 Green: GPIOA_17 (P8_1, XI32K), active high

Buttons (active low, internal pull-up):

- SW1: GPIOB_22 (P9_1)
- SW2: GPIOB_21 (P9_0)
- SW3: GPIOB_8 (P4_3)
- SW4: GPIOB_7 (P4_2)

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

The RTL8777G SoC is configured to use the internal 32KHz clock as a source for the
system clock, with the CPU running at 40MHz.

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

The RTL8777G SoC has 6 UARTs. By default, UART2 is configured for the console and
log output at 115200 baud.

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

Flashing
========

Before flashing, ensure the SoC is in download mode:

1. Use a jumper to connect the LOG pin (P0_3) with GND.
2. Press the RST button once to reboot the SoC and enter download mode.
3. Flash using mpcli or JLink.
4. Remove the jumper and press RST to enter normal mode.

To build and flash the :zephyr:code-sample:`hello_world` sample:

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

References
**********

- `RTL87x2G Introduction <https://www.realmcu.com/en/Home/Product/RTL8762G-RTL877xG-Series>`_
16 changes: 16 additions & 0 deletions boards/realtek/rtl8777g_dongle/rtl8777g_dongle-pinctrl.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* Copyright (c) 2025 Realtek Semiconductor Corp.
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <dt-bindings/pinctrl/rtl87x2g-pinctrl.h>

&pinctrl {
uart2_default: uart2_default {
group1 {
psels = <BEE_PSEL(UART2_TX, P3_0, DIR_OUT, DRV_HIGH, PULL_UP)>,
<BEE_PSEL(UART2_RX, P3_1, DIR_IN, DRV_HIGH, PULL_UP)>;

Check failure on line 13 in boards/realtek/rtl8777g_dongle/rtl8777g_dongle-pinctrl.dtsi

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

CODE_INDENT

boards/realtek/rtl8777g_dongle/rtl8777g_dongle-pinctrl.dtsi:13 code indent should use tabs where possible
};
};
};
155 changes: 155 additions & 0 deletions boards/realtek/rtl8777g_dongle/rtl8777g_dongle.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
/*
* Copyright (c) 2025 Realtek Semiconductor Corp.
*
* SPDX-License-Identifier: Apache-2.0
*/

/dts-v1/;
#include <realtek/rtl87x2g.dtsi>
#include <zephyr/dt-bindings/input/input-event-codes.h>
#include "rtl8777g_dongle-pinctrl.dtsi"

/ {
model = "Realtek RTL8777G Dongle Evaluation Board";
compatible = "realtek,rtl8777g_dongle";

chosen {
zephyr,sram = &tcm0;
zephyr,flash = &flash;
zephyr,code-partition = &app_partition;
zephyr,itcm = &tcm1;
zephyr,console = &uart2;
zephyr,shell-uart = &uart2;
zephyr,flash-controller = &fmc;
zephyr,bt-hci = &bee_bt_hci;
zephyr,entropy = &trng;
};

aliases {
led0 = &led0;
sw0 = &button0;
sw1 = &button1;
sw2 = &button2;
sw3 = &button3;
};

leds {
compatible = "gpio-leds";

led0: led0 {
gpios = <&gpioa 21 GPIO_ACTIVE_HIGH>;
label = "LED D1 Blue";
};

led1: led1 {
gpios = <&gpioa 18 GPIO_ACTIVE_HIGH>;
label = "LED D2 Red";
};

led2: led2 {
gpios = <&gpioa 17 GPIO_ACTIVE_HIGH>;
label = "LED D3 Green";
};
};

buttons {
compatible = "gpio-keys";
status = "okay";

button0: button_0 {
gpios = <&gpiob 22 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
label = "SW1";
zephyr,code = <INPUT_KEY_0>;
};

button1: button_1 {
gpios = <&gpiob 21 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
label = "SW2";
zephyr,code = <INPUT_KEY_1>;
};

button2: button_2 {
gpios = <&gpiob 8 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
label = "SW3";
zephyr,code = <INPUT_KEY_2>;
};

button3: button_3 {
gpios = <&gpiob 7 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
label = "SW4";
zephyr,code = <INPUT_KEY_3>;
};
};

};

&flash {
reg = <0x4000000 DT_SIZE_K(4096)>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
reserved: partition@0 {
label = "reserved-image";
reg = <0x0 DT_SIZE_K(4)>;
};
config_file: partition@1000 {
label = "config-file-image";
reg = <0x1000 DT_SIZE_K(4)>;
};
boot_patch_0: partition@2000 {
label = "boot-patch-0-image";
reg = <0x2000 DT_SIZE_K(32)>;
};
boot_patch_1: partition@a000 {
label = "boot-patch-1-image";
reg = <0xA000 DT_SIZE_K(32)>;
};
ota_header: partition@12000 {
label = "ota-header-image";
reg = <0x12000 DT_SIZE_K(4)>;
};
system_patch: partition@13000 {
label = "system-patch-image";
reg = <0x13000 DT_SIZE_K(32)>;
};
stack_patch: partition@1b000 {
label = "stack-patch-image";
reg = <0x1B000 DT_SIZE_K(72)>;
};
app_partition: partition@2d000 {
label = "app-image";
reg = <0x2D000 DT_SIZE_K(3900)>;
};
storage_partition: partition@3fc000 {
label = "storage";
reg = <0x3FC000 DT_SIZE_K(16)>;
};
};
};

&cpu {
clock-frequency = <40000000>;
};

&gpioa {
status = "okay";
};

&gpiob {
status = "okay";
};

&uart2 {
pinctrl-0 = <&uart2_default>;
pinctrl-names = "default";
status = "okay";
current-speed = <115200>;
parity = "none";
stop-bits = "1";
data-bits = <8>;
};

&bee_bt_hci {
status = "okay";
};
33 changes: 33 additions & 0 deletions boards/realtek/rtl8777g_dongle/rtl8777g_dongle.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
identifier: rtl8777g_dongle
name: RTL8777G Dongle Evaluation Board
type: mcu
arch: arm
ram: 100
flash: 4096
toolchain:
- zephyr
- gnuarmemb
- xtools
supported:
- gpio
- uart
- entropy
- ble
# TODO: to be tested
# - adc
# - counter
# - dma
# - i2c
# - kscan
# - nvs
# - pwm
# - spi
# - usb_device
# - watchdog
testing:
ignore_tags:
- net
- hwinfo
- ipc
- pm
vendor: realtek
18 changes: 18 additions & 0 deletions boards/realtek/rtl8777g_dongle/rtl8777g_dongle_defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Console Driver
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y

# UART Driver
CONFIG_SERIAL=y
CONFIG_UART_INTERRUPT_DRIVEN=y
# CONFIG_UART_ASYNC_API=y

# Build a secure image by default
CONFIG_TRUSTED_EXECUTION_SECURE=y
CONFIG_ARM_SECURE_BUSFAULT_HARDFAULT_NMI=y

# DISASSEMBLY
CONFIG_OUTPUT_DISASSEMBLY=y

# Enable HW stack protection
CONFIG_HW_STACK_PROTECTION=y
Loading