Skip to content
Merged
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
7 changes: 7 additions & 0 deletions boards/rakwireless/rak3112/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Copyright (c) 2025 Kenneth Lu
# SPDX-License-Identifier: Apache-2.0

config HEAP_MEM_POOL_ADD_SIZE_BOARD
int
default 4096 if BOARD_RAK3112_ESP32S3_PROCPU
default 256 if BOARD_RAK3112_ESP32S3_APPCPU
7 changes: 7 additions & 0 deletions boards/rakwireless/rak3112/Kconfig.rak3112
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Copyright (c) 2025 Kenneth Lu
# SPDX-License-Identifier: Apache-2.0

config BOARD_RAK3112
select SOC_ESP32S3_R2
select SOC_ESP32S3_PROCPU if BOARD_RAK3112_ESP32S3_PROCPU
select SOC_ESP32S3_APPCPU if BOARD_RAK3112_ESP32S3_APPCPU
10 changes: 10 additions & 0 deletions boards/rakwireless/rak3112/Kconfig.sysbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
# SPDX-License-Identifier: Apache-2.0

choice BOOTLOADER
default BOOTLOADER_MCUBOOT
endchoice

choice BOOT_SIGNATURE_TYPE
default BOOT_SIGNATURE_TYPE_NONE
endchoice
9 changes: 9 additions & 0 deletions boards/rakwireless/rak3112/board.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# SPDX-License-Identifier: Apache-2.0

if(NOT "${OPENOCD}" MATCHES "^${ESPRESSIF_TOOLCHAIN_PATH}/.*")
set(OPENOCD OPENOCD-NOTFOUND)
endif()
find_program(OPENOCD openocd PATHS ${ESPRESSIF_TOOLCHAIN_PATH}/openocd-esp32/bin NO_DEFAULT_PATH)

include(${ZEPHYR_BASE}/boards/common/esp32.board.cmake)
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
6 changes: 6 additions & 0 deletions boards/rakwireless/rak3112/board.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
board:
name: rak3112
full_name: RAK3112
vendor: rakwireless
socs:
- name: esp32s3
Binary file added boards/rakwireless/rak3112/doc/img/pinout.webp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kartben for comment on file

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added boards/rakwireless/rak3112/doc/img/rak3112.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
81 changes: 81 additions & 0 deletions boards/rakwireless/rak3112/doc/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
.. zephyr:board:: rak3112

Overview
********

The RAK3112 is a low-power, long-range LoRaWAN module based on the
Espressif ESP32-S3 MCU with an integrated Semtech SX1262 LoRa
transceiver. Supporting LoRa, BLE, and Wi-Fi, this module is ideal for
various IoT applications such as home automation, sensor networks,
building automation, and other IoT network applications.

Hardware
********

It is designed for easy access to the pins on the board and to simplify the evaluation of the RAK3112
module.

The main hardware features are:

- RAK3112 based on Espressif ESP32-S3, dual-core Xtensa® LX7 CPU up to 240 MHz
- Semtech SX1262 for LoRa® modulations
- Integrated 2.4 GHz Wi-Fi (802.11 b/g/n) and Bluetooth® LE 5
- 512 KB of SRAM and 384 KB of ROM on the chip
- IPEX connectors for the antennas
- I/O ports:

- UART
- I2C
- SPI
- GPIO
- ADC

.. image:: img/pinout.webp
:align: center
:alt: RAK3112-pinout

For more information about the RAK3112 stamp module:

- `WisDuo RAK3112 Website`_
- `Espressif ESP32-S3 Website`_

Supported Features
==================

.. zephyr:board-supported-hw::

System requirements
*******************

Espressif HAL requires WiFi and Bluetooth binary blobs in order work. Run the command
below to retrieve those files.

.. code-block:: console

west blobs fetch hal_espressif

.. note::

It is recommended running the command above after :file:`west update`.

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

.. zephyr:board-supported-runners::

.. include:: ../../../espressif/common/building-flashing.rst
:start-after: espressif-building-flashing

.. include:: ../../../espressif/common/board-variants.rst
:start-after: espressif-board-variants

References
**********

.. target-notes::

.. _WisDuo RAK3112 Website:
https://docs.rakwireless.com/Product-Categories/WisDuo/RAK3112-Module/Overview/

.. _Espressif ESP32-S3 Website:
https://www.espressif.com/en/products/socs/esp32-s3
67 changes: 67 additions & 0 deletions boards/rakwireless/rak3112/rak3112-pinctrl.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
* Copyright (c) 2025 Kenneth Lu
* SPDX-License-Identifier: Apache-2.0
*/

#include <dt-bindings/pinctrl/esp32s3-pinctrl.h>
#include <zephyr/dt-bindings/pinctrl/esp-pinctrl-common.h>
#include <zephyr/dt-bindings/pinctrl/esp32s3-gpio-sigmap.h>

&pinctrl {

i2c0_default: i2c0_default {
group1 {
pinmux = <I2C0_SDA_GPIO9>, <I2C0_SCL_GPIO40>;
bias-pull-up;
drive-open-drain;
output-high;
};
};

i2c1_default: i2c1_default {
group1 {
pinmux = <I2C1_SDA_GPIO17>, <I2C1_SCL_GPIO18>;
bias-pull-up;
drive-open-drain;
output-high;
};
};

spim2_default: spim2_default {
group1 {
pinmux = <SPIM2_MISO_GPIO3>,
<SPIM2_SCLK_GPIO5>,
<SPIM2_CSEL_GPIO7>;
};

group2 {
pinmux = <SPIM2_MOSI_GPIO6>;
output-low;
};
};

spim3_default: spim3_default {
group1 {
pinmux = <SPIM3_MISO_GPIO10>,
<SPIM3_SCLK_GPIO13>,
<SPIM3_CSEL_GPIO12>;
};

group2 {
pinmux = <SPIM3_MOSI_GPIO11>;
output-low;
};
};

uart0_default: uart0_default {
group1 {
pinmux = <UART0_TX_GPIO43>;
output-high;
};

group2 {
pinmux = <UART0_RX_GPIO44>;
bias-pull-up;
};
};
};
29 changes: 29 additions & 0 deletions boards/rakwireless/rak3112/rak3112_esp32s3_appcpu.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright (c) 2025 Kenneth Lu
* SPDX-License-Identifier: Apache-2.0
*/

/dts-v1/;
#include <espressif/esp32s3/esp32s3_r2.dtsi>
#include <espressif/partitions_0x0_amp_16M.dtsi>

/ {
model = "RAK3112 APPCPU";
compatible = "rakwireless,rak3112";

chosen {
zephyr,sram = &sram1;
zephyr,ipc_shm = &shm0;
zephyr,ipc = &ipm0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_appcpu_partition;
};
};

&flash0 {
reg = <0x0 DT_SIZE_M(16)>;
};

&trng0 {
status = "okay";
};
27 changes: 27 additions & 0 deletions boards/rakwireless/rak3112/rak3112_esp32s3_appcpu.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
identifier: rak3112/esp32s3/appcpu
name: RAK3112 APPCPU
type: mcu
arch: xtensa
toolchain:
- zephyr
supported:
- uart
testing:
ignore_tags:
- net
- bluetooth
- flash
- cpp
- posix
- watchdog
- logging
- kernel
- pm
- gpio
- crypto
- eeprom
- heap
- cmsis_rtos
- jwt
- zdsp
vendor: rakwireless
3 changes: 3 additions & 0 deletions boards/rakwireless/rak3112/rak3112_esp32s3_appcpu_defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# SPDX-License-Identifier: Apache-2.0

CONFIG_CLOCK_CONTROL=y
110 changes: 110 additions & 0 deletions boards/rakwireless/rak3112/rak3112_esp32s3_procpu.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
/*
* Copyright (c) 2025 Kenneth Lu
* SPDX-License-Identifier: Apache-2.0
*/

/dts-v1/;
#include <espressif/esp32s3/esp32s3_r2.dtsi>
#include "rak3112-pinctrl.dtsi"
#include <zephyr/dt-bindings/input/input-event-codes.h>
#include <espressif/partitions_0x0_amp_16M.dtsi>
#include <zephyr/dt-bindings/lora/sx126x.h>

/ {
model = "RAK3112 PROCPU";
compatible = "espressif,esp32s3";

aliases {
i2c-1 = &i2c1;
uart-0 = &uart0;
watchdog0 = &wdt0;
lora0 = &lora;
};

chosen {
zephyr,sram = &sram1;
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
zephyr,bt-hci = &esp32_bt_hci;
};
};

&flash0 {
reg = <0x0 DT_SIZE_M(16)>;
};

&gpio0 {
status = "okay";
};

&gpio1 {
status = "okay";
};

&i2c0 {
clock-frequency = <I2C_BITRATE_STANDARD>;
pinctrl-0 = <&i2c0_default>;
pinctrl-names = "default";
};

&spi2 {
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
pinctrl-0 = <&spim2_default>;
pinctrl-names = "default";

lora: lora@0 {
compatible = "semtech,sx1262";
reg = <0>;
reset-gpios = <&gpio 8 (GPIO_OPEN_DRAIN | GPIO_ACTIVE_LOW)>;
busy-gpios = <&gpio 48 GPIO_ACTIVE_HIGH>;
dio1-gpios = <&gpio 47 GPIO_ACTIVE_HIGH>;
antenna-enable-gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
dio2-tx-enable;
dio3-tcxo-voltage = <SX126X_DIO3_TCXO_1V8>;
tcxo-power-startup-delay-ms = <5>;
spi-max-frequency = <1000000>;
};
};

&uart0 {
status = "okay";
current-speed = <115200>;
pinctrl-0 = <&uart0_default>;
pinctrl-names = "default";
};

&wdt0 {
status = "okay";
};

&trng0 {
status = "okay";
};

&timer0 {
status = "okay";
};

&timer1 {
status = "okay";
};

&timer2 {
status = "okay";
};

&timer3 {
status = "okay";
};

&esp32_bt_hci {
status = "okay";
};

&wifi {
status = "okay";
};
18 changes: 18 additions & 0 deletions boards/rakwireless/rak3112/rak3112_esp32s3_procpu.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
identifier: rak3112/esp32s3/procpu
name: RAK3112 PROCPU
type: mcu
arch: xtensa
toolchain:
- zephyr
supported:
- gpio
- i2c
- spi
- watchdog
- regulator
- uart
- pwm
- pinmux
- nvs
- display
vendor: rakwireless
8 changes: 8 additions & 0 deletions boards/rakwireless/rak3112/rak3112_esp32s3_procpu_defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright (c) 2025 Kenneth Lu
# SPDX-License-Identifier: Apache-2.0

CONFIG_GPIO=y
CONFIG_CONSOLE=y
CONFIG_SERIAL=y
CONFIG_UART_CONSOLE=y
CONFIG_CLOCK_CONTROL=y
Loading
Loading