Skip to content

Commit ef0ceb7

Browse files
committed
boards: add dt_xt_zb1_devkit
Introduce a bl70x board Signed-off-by: Camille BAUD <[email protected]>
1 parent be2fe8e commit ef0ceb7

File tree

11 files changed

+331
-0
lines changed

11 files changed

+331
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2025 MASSDRIVER EI (massdriver.space)
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config BOARD_DT_XT_ZB1_DEVKIT
5+
select SOC_BL702C10Q2H
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Copyright (c) 2025 MASSDRIVER EI (massdriver.space)
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
board_runner_args(openocd --cmd-pre-init "source [find bl70x.cfg]")
6+
7+
board_runner_args(openocd --use-elf --no-load --no-init)
8+
board_runner_args(openocd --gdb-init "set mem inaccessible-by-default off")
9+
board_runner_args(openocd --gdb-init "set architecture riscv:rv32")
10+
board_runner_args(openocd --gdb-init "set remotetimeout 250")
11+
board_runner_args(openocd --gdb-init "set print asm-demangle on")
12+
board_runner_args(openocd --gdb-init "set backtrace limit 32")
13+
board_runner_args(openocd --gdb-init "mem 0x22010000 0x22014000 rw")
14+
board_runner_args(openocd --gdb-init "mem 0x42010000 0x42014000 rw")
15+
board_runner_args(openocd --gdb-init "mem 0x22014000 0x22020000 rw")
16+
board_runner_args(openocd --gdb-init "mem 0x42014000 0x42020000 rw")
17+
board_runner_args(openocd --gdb-init "mem 0x22020000 0x2203C000 rw")
18+
board_runner_args(openocd --gdb-init "mem 0x42020000 0x4203C000 rw")
19+
board_runner_args(openocd --gdb-init "mem 0x23000000 0x23400000 ro")
20+
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
21+
22+
board_runner_args(bflb_mcu_tool --chipname bl702)
23+
include(${ZEPHYR_BASE}/boards/common/bflb_mcu_tool.board.cmake)
24+
25+
board_set_flasher(bflb_mcu_tool)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
board:
2+
name: dt_xt_zb1_devkit
3+
full_name: XT-ZB1 Zigbee 3.0 and BLE 5.0 Coexistence Module Development Kit
4+
vendor: doiting
5+
socs:
6+
- name: bl702c10q2h
Binary file not shown.
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
.. zephyr:board:: dt_xt_zb1_devkit
2+
3+
XT-ZB1 Development Kit
4+
#######################
5+
6+
Overview
7+
********
8+
9+
XT-ZB1 Zigbee 3.0 and BLE 5.0 coexistence Module is a highly integrated single-chip solution
10+
providing Zigbee and BLE in a single chip.
11+
It also provides a bunch of configurable GPIO, which are configured as digital
12+
peripherals for different applications and control usage.
13+
14+
The XT-ZB1 Module use BL702 as Zigbee and BLE coexistence soc chip.
15+
The embedded memory configuration provides simple application developments.
16+
17+
Hardware
18+
********
19+
20+
For more information about the Bouffalo Lab BL702 MCU:
21+
22+
- `Bouffalo Lab BL702 MCU Website`_
23+
- `Bouffalo Lab BL702 MCU Datasheet`_
24+
- `Bouffalo Lab Development Zone`_
25+
- `Doctors of Intelligence & Technology (www.doiting.com)`_
26+
27+
Supported Features
28+
==================
29+
30+
.. zephyr:board-supported-hw::
31+
32+
System Clock
33+
============
34+
35+
The XT-ZB1 board is configured to run at max speed by default (144MHz).
36+
37+
Serial Port
38+
===========
39+
40+
The ``dt_xt_zb1_devkit`` board uses UART0 as default serial port. It is connected
41+
to USB Serial converter and port is used for both program and console.
42+
43+
44+
Programming and Debugging
45+
*************************
46+
47+
.. zephyr:board-supported-runners::
48+
49+
Samples
50+
=======
51+
52+
#. Build the Zephyr kernel and the :zephyr:code-sample:`hello_world` sample
53+
application:
54+
55+
.. zephyr-app-commands::
56+
:zephyr-app: samples/hello_world
57+
:board: dt_xt_zb1_devkit
58+
:goals: build flash
59+
60+
#. Run your favorite terminal program to listen for output. Under Linux the
61+
terminal should be :code:`/dev/ttyUSB0`. For example:
62+
63+
.. code-block:: console
64+
65+
$ screen /dev/ttyUSB0 115200
66+
67+
The -o option tells minicom not to send the modem initialization
68+
string. Connection should be configured as follows:
69+
70+
- Speed: 115200
71+
- Data: 8 bits
72+
- Parity: None
73+
- Stop bits: 1
74+
75+
Then, press and release RST button
76+
77+
.. code-block:: console
78+
79+
*** Booting Zephyr OS build v4.2.0-1031-g63c9db88d01a ***
80+
Hello World! dt_xt_zb1_devkit/bl702c10q2h
81+
82+
Congratulations, you have ``dt_xt_zb1_devkit`` configured and running Zephyr.
83+
84+
85+
.. _Bouffalo Lab BL702 MCU Website:
86+
https://www.bouffalolab.com/product/?type=detail&id=8
87+
88+
.. _Bouffalo Lab BL702 MCU Datasheet:
89+
https://github.com/bouffalolab/bl_docs/tree/main/BL702_DS/en
90+
91+
.. _Bouffalo Lab Development Zone:
92+
https://dev.bouffalolab.com/home?id=guest
93+
94+
.. _Doctors of Intelligence & Technology (www.doiting.com):
95+
https://www.doiting.com
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright (c) 2025 MASSDRIVER EI (massdriver.space)
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
#include <dt-bindings/pinctrl/bl702x-pinctrl.h>
7+
8+
&pinctrl {
9+
uart0_default: uart0_default {
10+
group1 {
11+
pinmux = <GPIO15_UART0_RX>,
12+
<GPIO14_UART0_TX>;
13+
bias-pull-up;
14+
input-schmitt-enable;
15+
};
16+
};
17+
18+
uart0_sleep: uart0_sleep {
19+
group1 {
20+
pinmux = <GPIO15_UART0_RX>,
21+
<GPIO14_UART0_TX>;
22+
bias-high-impedance;
23+
};
24+
};
25+
};
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/*
2+
* Copyright (c) 2025 MASSDRIVER EI (massdriver.space)
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
/dts-v1/;
7+
8+
#include <bflb/bl70x.dtsi>
9+
#include "dt_xt_zb1_devkit-pinctrl.dtsi"
10+
11+
/ {
12+
model = "Zigbee 3.0 and BLE 5.0 Coexistence Module Development Kit";
13+
compatible = "bflb,bl702";
14+
15+
chosen {
16+
zephyr,flash = &flash0;
17+
zephyr,code-partition = &slot0_partition;
18+
zephyr,itcm = &itcm;
19+
zephyr,dtcm = &dtcm;
20+
zephyr,sram = &sram0;
21+
zephyr,console = &uart0;
22+
zephyr,shell-uart = &uart0;
23+
};
24+
};
25+
26+
&cpu0 {
27+
clock-frequency = <DT_FREQ_M(144)>;
28+
};
29+
30+
&flashctrl {
31+
flash0: flash@23000000 {
32+
compatible = "soc-nv-flash", "mxicy,kh25v80";
33+
reg = <0x23000000 (0x1000000 - 0x2000)>;
34+
write-block-size = <256>;
35+
erase-block-size = <DT_SIZE_K(4)>;
36+
/* jedec-id = [c2 20 14]; */
37+
38+
partitions {
39+
compatible = "fixed-partitions";
40+
#address-cells = <1>;
41+
#size-cells = <1>;
42+
43+
slot0_partition: partition@0 {
44+
label = "image-0";
45+
reg = <0x00000000 0x80000>;
46+
read-only;
47+
};
48+
49+
storage_partition: partition@80000 {
50+
label = "storage";
51+
reg = <0x00080000 (0x80000 - 0x2000)>;
52+
};
53+
};
54+
};
55+
};
56+
57+
&uart0 {
58+
status = "okay";
59+
current-speed = <115200>;
60+
61+
pinctrl-0 = <&uart0_default>;
62+
pinctrl-1 = <&uart0_sleep>;
63+
pinctrl-names = "default", "sleep";
64+
};
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright (c) 2025 MASSDRIVER EI (massdriver.space)
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
identifier: dt_xt_zb1_devkit
5+
name: Zigbee 3.0 and BLE 5.0 Coexistence Module Development Kitt
6+
type: mcu
7+
arch: riscv
8+
ram: 132
9+
toolchain:
10+
- zephyr
11+
testing:
12+
ignore_tags:
13+
- net
14+
- bluetooth
15+
supported:
16+
- pinctrl
17+
- uart
18+
vendor: doiting
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Copyright (c) 2021-2025 ATL Electronics
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
CONFIG_CONSOLE=y
5+
CONFIG_SERIAL=y
6+
7+
CONFIG_UART_CONSOLE=y
8+
CONFIG_UART_INTERRUPT_DRIVEN=y
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Copyright (c) 2024-2025 MASSDRIVER EI (massdriver.space)
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
if { [info exists CHIPNAME] } {
6+
set _CHIPNAME $CHIPNAME
7+
} else {
8+
set _CHIPNAME riscv
9+
}
10+
11+
if { [info exists WORKAREASIZE] } {
12+
set _WORKAREASIZE $WORKAREASIZE
13+
} else {
14+
set _WORKAREASIZE 0x10000
15+
}
16+
17+
if { [info exists WORKAREAADDR] } {
18+
set _WORKAREAADDR $WORKAREAADDR
19+
} else {
20+
set _WORKAREAADDR 0x22020000
21+
}
22+
23+
if { [info exists CPUTAPID] } {
24+
set _CPUTAPID $CPUTAPID
25+
} else {
26+
set _CPUTAPID 0x20000e05
27+
}
28+
29+
transport select jtag
30+
jtag newtap $_CHIPNAME cpu -irlen 5 -expected-id $_CPUTAPID
31+
32+
set _TARGETNAME $_CHIPNAME.cpu
33+
target create $_TARGETNAME.0 riscv -chain-position $_TARGETNAME
34+
35+
$_TARGETNAME.0 configure -work-area-phys $_WORKAREAADDR -work-area-size $_WORKAREASIZE -work-area-backup 1
36+
37+
echo "Ready for Remote Connections"
38+
39+
$_TARGETNAME.0 configure -event reset-assert-pre {
40+
echo "reset-assert-pre"
41+
adapter speed 400
42+
}
43+
44+
$_TARGETNAME.0 configure -event reset-deassert-post {
45+
echo "reset-deassert-post"
46+
47+
adapter speed 400
48+
49+
reg mstatus 0x0
50+
reg pc 0x21000000
51+
}
52+
53+
$_TARGETNAME.0 configure -event reset-init {
54+
echo "reset-init"
55+
56+
adapter speed 400
57+
}
58+
59+
$_TARGETNAME.0 configure -event gdb-attach {
60+
echo "Debugger attaching: halting execution"
61+
reset halt
62+
gdb_breakpoint_override hard
63+
}
64+
65+
$_TARGETNAME.0 configure -event gdb-detach {
66+
echo "Debugger detaching: resuming execution"
67+
resume
68+
}
69+
70+
gdb_memory_map enable
71+
gdb_flash_program enable
72+
73+
# 'progbuf', 'sysbus' or 'abstract'
74+
riscv set_mem_access sysbus
75+
riscv set_command_timeout_sec 1
76+
77+
init
78+
reset init
79+
80+
reset init

0 commit comments

Comments
 (0)