Skip to content

Introduce BL70x SoC #94004

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

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
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
5 changes: 5 additions & 0 deletions boards/doiting/dt_xt_zb1_devkit/Kconfig.dt_xt_zb1_devkit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) 2025 MASSDRIVER EI (massdriver.space)
# SPDX-License-Identifier: Apache-2.0

config BOARD_DT_XT_ZB1_DEVKIT
select SOC_BL702C10Q2H
25 changes: 25 additions & 0 deletions boards/doiting/dt_xt_zb1_devkit/board.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright (c) 2025 MASSDRIVER EI (massdriver.space)
#
# SPDX-License-Identifier: Apache-2.0

board_runner_args(openocd --cmd-pre-init "source [find bl70x.cfg]")

board_runner_args(openocd --use-elf --no-load --no-init)
board_runner_args(openocd --gdb-init "set mem inaccessible-by-default off")
board_runner_args(openocd --gdb-init "set architecture riscv:rv32")
board_runner_args(openocd --gdb-init "set remotetimeout 250")
board_runner_args(openocd --gdb-init "set print asm-demangle on")
board_runner_args(openocd --gdb-init "set backtrace limit 32")
board_runner_args(openocd --gdb-init "mem 0x22010000 0x22014000 rw")
board_runner_args(openocd --gdb-init "mem 0x42010000 0x42014000 rw")
board_runner_args(openocd --gdb-init "mem 0x22014000 0x22020000 rw")
board_runner_args(openocd --gdb-init "mem 0x42014000 0x42020000 rw")
board_runner_args(openocd --gdb-init "mem 0x22020000 0x2203C000 rw")
board_runner_args(openocd --gdb-init "mem 0x42020000 0x4203C000 rw")
board_runner_args(openocd --gdb-init "mem 0x23000000 0x23400000 ro")
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)

board_runner_args(bflb_mcu_tool --chipname bl702)
include(${ZEPHYR_BASE}/boards/common/bflb_mcu_tool.board.cmake)

board_set_flasher(bflb_mcu_tool)
6 changes: 6 additions & 0 deletions boards/doiting/dt_xt_zb1_devkit/board.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
board:
name: dt_xt_zb1_devkit
full_name: XT-ZB1 Zigbee 3.0 and BLE 5.0 Coexistence Module Development Kit
vendor: doiting
socs:
- name: bl702c10q2h
Binary file not shown.
95 changes: 95 additions & 0 deletions boards/doiting/dt_xt_zb1_devkit/doc/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
.. zephyr:board:: dt_xt_zb1_devkit

XT-ZB1 Development Kit
#######################

Overview
********

XT-ZB1 Zigbee 3.0 and BLE 5.0 coexistence Module is a highly integrated single-chip solution
providing Zigbee and BLE in a single chip.
It also provides a bunch of configurable GPIO, which are configured as digital
peripherals for different applications and control usage.

The XT-ZB1 Module use BL702 as Zigbee and BLE coexistence soc chip.
The embedded memory configuration provides simple application developments.

Hardware
********

For more information about the Bouffalo Lab BL702 MCU:

- `Bouffalo Lab BL702 MCU Website`_
- `Bouffalo Lab BL702 MCU Datasheet`_
- `Bouffalo Lab Development Zone`_
- `Doctors of Intelligence & Technology (www.doiting.com)`_

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

.. zephyr:board-supported-hw::

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

The XT-ZB1 board is configured to run at max speed by default (144MHz).

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

The ``dt_xt_zb1_devkit`` board uses UART0 as default serial port. It is connected
to USB Serial converter and port is used for both program and console.


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

.. zephyr:board-supported-runners::

Samples
=======

#. Build the Zephyr kernel and the :zephyr:code-sample:`hello_world` sample
application:

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

#. Run your favorite terminal program to listen for output. Under Linux the
terminal should be :code:`/dev/ttyUSB0`. For example:

.. code-block:: console

$ screen /dev/ttyUSB0 115200

The -o option tells minicom not to send the modem initialization
string. Connection should be configured as follows:

- Speed: 115200
- Data: 8 bits
- Parity: None
- Stop bits: 1

Then, press and release RST button

.. code-block:: console

*** Booting Zephyr OS build v4.2.0-1031-g63c9db88d01a ***
Hello World! dt_xt_zb1_devkit/bl702c10q2h

Congratulations, you have ``dt_xt_zb1_devkit`` configured and running Zephyr.


.. _Bouffalo Lab BL702 MCU Website:
https://www.bouffalolab.com/product/?type=detail&id=8

.. _Bouffalo Lab BL702 MCU Datasheet:
https://github.com/bouffalolab/bl_docs/tree/main/BL702_DS/en

.. _Bouffalo Lab Development Zone:
https://dev.bouffalolab.com/home?id=guest

.. _Doctors of Intelligence & Technology (www.doiting.com):
https://www.doiting.com
25 changes: 25 additions & 0 deletions boards/doiting/dt_xt_zb1_devkit/dt_xt_zb1_devkit-pinctrl.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright (c) 2025 MASSDRIVER EI (massdriver.space)
* SPDX-License-Identifier: Apache-2.0
*/

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

&pinctrl {
uart0_default: uart0_default {
group1 {
pinmux = <GPIO15_UART0_RX>,
<GPIO14_UART0_TX>;
bias-pull-up;
input-schmitt-enable;
};
};

uart0_sleep: uart0_sleep {
group1 {
pinmux = <GPIO15_UART0_RX>,
<GPIO14_UART0_TX>;
bias-high-impedance;
};
};
};
63 changes: 63 additions & 0 deletions boards/doiting/dt_xt_zb1_devkit/dt_xt_zb1_devkit.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
* Copyright (c) 2025 MASSDRIVER EI (massdriver.space)
* SPDX-License-Identifier: Apache-2.0
*/

/dts-v1/;

#include <bflb/bl70x.dtsi>
#include "dt_xt_zb1_devkit-pinctrl.dtsi"

/ {
model = "Zigbee 3.0 and BLE 5.0 Coexistence Module Development Kit";
compatible = "bflb,bl702";

chosen {
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
zephyr,itcm = &itcm;
zephyr,dtcm = &dtcm;
zephyr,sram = &sram0;
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
};
};

&cpu0 {
clock-frequency = <DT_FREQ_M(144)>;
};

&flashctrl {
flash0: flash@23000000 {
compatible = "soc-nv-flash", "mxicy,kh25v80";
reg = <0x23000000 (0x1000000 - 0x2000)>;
write-block-size = <256>;
erase-block-size = <DT_SIZE_K(4)>;

partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

slot0_partition: partition@0 {
label = "image-0";
reg = <0x00000000 0x80000>;
read-only;
};

storage_partition: partition@80000 {
label = "storage";
reg = <0x00080000 (0x80000 - 0x2000)>;
};
};
};
};

&uart0 {
status = "okay";
current-speed = <115200>;

pinctrl-0 = <&uart0_default>;
pinctrl-1 = <&uart0_sleep>;
pinctrl-names = "default", "sleep";
};
18 changes: 18 additions & 0 deletions boards/doiting/dt_xt_zb1_devkit/dt_xt_zb1_devkit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (c) 2025 MASSDRIVER EI (massdriver.space)
# SPDX-License-Identifier: Apache-2.0

identifier: dt_xt_zb1_devkit
name: Zigbee 3.0 and BLE 5.0 Coexistence Module Development Kitt
type: mcu
arch: riscv
ram: 132
toolchain:
- zephyr
testing:
ignore_tags:
- net
- bluetooth
supported:
- pinctrl
- uart
vendor: doiting
8 changes: 8 additions & 0 deletions boards/doiting/dt_xt_zb1_devkit/dt_xt_zb1_devkit_defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright (c) 2021-2025 ATL Electronics
# SPDX-License-Identifier: Apache-2.0

CONFIG_CONSOLE=y
CONFIG_SERIAL=y

CONFIG_UART_CONSOLE=y
CONFIG_UART_INTERRUPT_DRIVEN=y
80 changes: 80 additions & 0 deletions boards/doiting/dt_xt_zb1_devkit/support/bl70x.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Copyright (c) 2024-2025 MASSDRIVER EI (massdriver.space)
#
# SPDX-License-Identifier: Apache-2.0

if { [info exists CHIPNAME] } {
set _CHIPNAME $CHIPNAME
} else {
set _CHIPNAME riscv
}

if { [info exists WORKAREASIZE] } {
set _WORKAREASIZE $WORKAREASIZE
} else {
set _WORKAREASIZE 0x10000
}

if { [info exists WORKAREAADDR] } {
set _WORKAREAADDR $WORKAREAADDR
} else {
set _WORKAREAADDR 0x22020000
}

if { [info exists CPUTAPID] } {
set _CPUTAPID $CPUTAPID
} else {
set _CPUTAPID 0x20000e05
}

transport select jtag
jtag newtap $_CHIPNAME cpu -irlen 5 -expected-id $_CPUTAPID

set _TARGETNAME $_CHIPNAME.cpu
target create $_TARGETNAME.0 riscv -chain-position $_TARGETNAME

$_TARGETNAME.0 configure -work-area-phys $_WORKAREAADDR -work-area-size $_WORKAREASIZE -work-area-backup 1

echo "Ready for Remote Connections"

$_TARGETNAME.0 configure -event reset-assert-pre {
echo "reset-assert-pre"
adapter speed 400
}

$_TARGETNAME.0 configure -event reset-deassert-post {
echo "reset-deassert-post"

adapter speed 400

reg mstatus 0x0
reg pc 0x21000000
}

$_TARGETNAME.0 configure -event reset-init {
echo "reset-init"

adapter speed 400
}

$_TARGETNAME.0 configure -event gdb-attach {
echo "Debugger attaching: halting execution"
reset halt
gdb_breakpoint_override hard
}

$_TARGETNAME.0 configure -event gdb-detach {
echo "Debugger detaching: resuming execution"
resume
}

gdb_memory_map enable
gdb_flash_program enable

# 'progbuf', 'sysbus' or 'abstract'
riscv set_mem_access sysbus
riscv set_command_timeout_sec 1

init
reset init

reset init
5 changes: 5 additions & 0 deletions boards/doiting/dt_xt_zb1_devkit/support/openocd.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# For WCH linkE in DAP mode

interface cmsis-dap

adapter speed 400
1 change: 1 addition & 0 deletions drivers/clock_control/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_NRF_HSFLL_LOCAL clock_cont
zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_NRF_LFCLK clock_control_nrf_lfclk.c)
zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_NRF_AUXPLL clock_control_nrf_auxpll.c)
zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_BOUFFALOLAB_BL60X clock_control_bl60x.c)
zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_BOUFFALOLAB_BL70X clock_control_bl70x.c)

if(CONFIG_CLOCK_CONTROL_RENESAS_RZA2M_CPG)
zephyr_library_sources(clock_control_renesas_rza2m_cpg.c)
Expand Down
5 changes: 5 additions & 0 deletions drivers/clock_control/Kconfig.bflb
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@ config CLOCK_CONTROL_BOUFFALOLAB_BL60X
bool "Bouffalolab BL60x Clock Control"
default y
depends on DT_HAS_BFLB_BL60X_CLOCK_CONTROLLER_ENABLED

config CLOCK_CONTROL_BOUFFALOLAB_BL70X
bool "Bouffalolab BL70x Clock Control"
default y
depends on DT_HAS_BFLB_BL70X_CLOCK_CONTROLLER_ENABLED
Loading
Loading