Skip to content

Commit 6ebeba0

Browse files
committed
boards: riscv: Introduce bl604e_iot_dvk
Add initial version. Signed-off-by: Gerson Fernando Budke <[email protected]>
1 parent 479ad78 commit 6ebeba0

File tree

12 files changed

+428
-0
lines changed

12 files changed

+428
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Copyright (c) 2022-2025 ATL Electronics
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
config BOARD_BL604E_IOT_DVK
6+
select SOC_BL604E20Q2I
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Copyright (c) 2021-2025 ATL Electronics
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <dt-bindings/pinctrl/bl604x-pinctrl.h>
8+
9+
&pinctrl {
10+
uart0_default: uart0_default {
11+
group1 {
12+
pinmux = <GPIO7_UART0_RX>,
13+
<GPIO16_UART0_TX>;
14+
bias-pull-up;
15+
input-schmitt-enable;
16+
};
17+
};
18+
19+
uart0_sleep: uart0_sleep {
20+
group1 {
21+
pinmux = <GPIO7_UART0_RX>,
22+
<GPIO16_UART0_TX>;
23+
bias-high-impedance;
24+
};
25+
};
26+
};
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*
2+
* Copyright (c) 2022-2025 ATL Electronics
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/dts-v1/;
8+
9+
#include <bouffalolab/bl60x.dtsi>
10+
#include "bl604e_iot_dvk-pinctrl.dtsi"
11+
12+
/ {
13+
model = "BL604E IOT DVK development board";
14+
compatible = "bflb,bl604";
15+
16+
chosen {
17+
zephyr,flash = &flash0;
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(192)>;
28+
};
29+
30+
&spi1 {
31+
#address-cells = <1>;
32+
#size-cells = <0>;
33+
reg = <0x4000b000 0x1000 0x23000000 0xc00000>;
34+
35+
flash0: flash@0 {
36+
compatible = "issi,is25lp128", "jedec,spi-nor";
37+
status = "disabled";
38+
size = <DT_SIZE_M(128)>;
39+
jedec-id = [96 60 18];
40+
reg = <0>;
41+
spi-max-frequency = <DT_FREQ_M(133)>;
42+
};
43+
};
44+
45+
&uart0 {
46+
status = "okay";
47+
current-speed = <115200>;
48+
49+
pinctrl-0 = <&uart0_default>;
50+
pinctrl-1 = <&uart0_sleep>;
51+
pinctrl-names = "default", "sleep";
52+
};
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Copyright (c) 2022-2025 ATL Electronics
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
identifier: bl604e_iot_dvk
6+
name: BL604E IOT DVK development board
7+
type: mcu
8+
arch: riscv
9+
ram: 64
10+
toolchain:
11+
- zephyr
12+
testing:
13+
ignore_tags:
14+
- net
15+
- bluetooth
16+
supported:
17+
- pinctrl
18+
- uart
19+
vendor: bflb
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Copyright (c) 2022-2025 ATL Electronics
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
CONFIG_CONSOLE=y
6+
CONFIG_SERIAL=y
7+
8+
CONFIG_UART_CONSOLE=y
9+
CONFIG_UART_BFLB=y
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright (c) 2022-2025 ATL Electronics
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
board_runner_args(openocd --cmd-pre-init "source [find bl60x.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 0x22008000 0x22014000 rw")
14+
board_runner_args(openocd --gdb-init "mem 0x42008000 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(blflash --port /dev/ttyACM0)
23+
include(${ZEPHYR_BASE}/boards/common/blflash.board.cmake)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
board:
2+
name: bl604e_iot_dvk
3+
full_name: BL604E IOT DVK development board
4+
vendor: bflb
5+
socs:
6+
- name: bl604e20q2i
75.1 KB
Loading
Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
.. zephyr:board:: bl604e_iot_dvk
2+
3+
Overview
4+
********
5+
6+
BL602/BL604 is a Wi-Fi+BLE chipset introduced by Bouffalo Lab, which is used
7+
for low power consumption and high performance application development. The
8+
wireless subsystem includes 2.4G radio, Wi-Fi 802.11b/g/n and BLE 5.0
9+
baseband/MAC design. The microcontroller subsystem includes a 32-bit RISC CPU
10+
with low power consumption, cache and memory. The power management unit
11+
controls the low power consumption mode. In addition, it also supports
12+
various security features. The external interfaces include SDIO, SPI, UART,
13+
I2C, IR remote, PWM, ADC, DAC, PIR and GPIO.
14+
15+
The BL602 Development Board features a SiFive E24 32 bit RISC-V CPU with FPU,
16+
it supports High Frequency clock up to 192Mhz, have 128k ROM, 276kB RAM,
17+
2.4 GHz WIFI 1T1R mode, support 20 MHz, data rate up to 72.2 Mbps, BLE 5.0
18+
with 2MB phy. It is a secure MCU which supports Secure boot, ECC-256 signed
19+
image, QSPI/SPI Flash On-The-Fly AES Decryption and PKA (Public Key
20+
Accelerator).
21+
22+
Hardware
23+
********
24+
25+
For more information about the Bouffalo Lab BL-60x MCU:
26+
27+
- `Bouffalo Lab BL60x MCU Website`_
28+
- `Bouffalo Lab BL60x MCU Datasheet`_
29+
- `Bouffalo Lab Development Zone`_
30+
- `The RISC-V BL602 Book`_
31+
32+
Supported Features
33+
==================
34+
35+
The ``bl604e_iot_dvk`` board supports the following hardware features:
36+
37+
+-----------+------------+-----------------------+
38+
| Interface | Controller | Driver/Component |
39+
+===========+============+=======================+
40+
| MTIMER | on-chip | RISC-V Machine Timer |
41+
+-----------+------------+-----------------------+
42+
| PINCTRL | on-chip | pin muxing |
43+
+-----------+------------+-----------------------+
44+
| UART | on-chip | serial port-polling; |
45+
| | | serial port-interrupt |
46+
+-----------+------------+-----------------------+
47+
48+
49+
The default configuration can be found in the Kconfig
50+
:zephyr_file:`boards/bouffalolab/bl60x/bl604e_iot_dvk/bl604e_iot_dvk_defconfig`.
51+
52+
System Clock
53+
============
54+
55+
The BL604E Development Board is configured to run at max speed (192MHz).
56+
57+
Serial Port
58+
===========
59+
60+
The ``bl604e_iot_dvk`` board uses UART0 as default serial port. It is connected
61+
to USB Serial converter and port is used for both program and console.
62+
63+
64+
Programming and Debugging
65+
*************************
66+
67+
BL Flash tool
68+
=============
69+
70+
The BL-60x has a ROM bootloader that allows user flash device by serial port.
71+
There are some tools available at internet and this will describe one of them.
72+
The below guide was created based on RISC-V BL602 Book, chapter 3
73+
`Flashing Firmware to BL602`_.
74+
75+
#. `Install Rustup`_
76+
77+
#. Install cargo
78+
79+
.. code-block:: console
80+
81+
$ sudo apt-get install cargo
82+
83+
#. Clone blflash rust version
84+
85+
.. code-block:: console
86+
87+
$ git clone --recursive https://github.com/spacemeowx2/blflash
88+
89+
#. Build blflash
90+
91+
.. code-block:: console
92+
93+
$ cd blflash
94+
$ cargo build --release
95+
96+
#. Install blflash. The recommended use is copy to home folder
97+
98+
.. code-block:: console
99+
100+
$ cp target/release/blflash ~/bin/
101+
102+
#. Test
103+
104+
.. code-block:: console
105+
106+
$ blflash -V
107+
108+
It will print blflash version
109+
110+
.. code-block:: console
111+
112+
$ blflash 0.3.5
113+
114+
Samples
115+
=======
116+
117+
#. Build the Zephyr kernel and the :zephyr:code-sample:`hello_world` sample
118+
application:
119+
120+
.. zephyr-app-commands::
121+
:zephyr-app: samples/hello_world
122+
:board: bl604e_iot_dvk
123+
:goals: build
124+
:compact:
125+
126+
#. To flash an image using blflash runner:
127+
128+
#. Press BOOT button
129+
130+
#. Press and release RST button
131+
132+
#. Release BOOT button
133+
134+
.. code-block:: console
135+
136+
west flash -r blflash
137+
138+
#. Run your favorite terminal program to listen for output. Under Linux the
139+
terminal should be :code:`/dev/ttyACM0`. For example:
140+
141+
.. code-block:: console
142+
143+
$ minicom -D /dev/ttyACM0 -o
144+
145+
The -o option tells minicom not to send the modem initialization
146+
string. Connection should be configured as follows:
147+
148+
- Speed: 115200
149+
- Data: 8 bits
150+
- Parity: None
151+
- Stop bits: 1
152+
153+
Then, press and release RST button
154+
155+
.. code-block:: console
156+
157+
*** Booting Zephyr OS build v3.7.0-3255-g6e0fa5c1c77a ***
158+
Hello World! bl604e_iot_dvk/bl604e20q2i
159+
160+
Congratulations, you have ``bl604e_iot_dvk`` configured and running Zephyr.
161+
162+
163+
.. _Bouffalo Lab BL60x MCU Website:
164+
https://en.bouffalolab.com/product/?type=detail&id=6
165+
166+
.. _Bouffalo Lab BL60x MCU Datasheet:
167+
https://github.com/bouffalolab/bl_docs/tree/main/BL602_DS/en
168+
169+
.. _Bouffalo Lab Development Zone:
170+
https://dev.bouffalolab.com/home?id=guest
171+
172+
.. _Install Rustup:
173+
https://rustup.rs/
174+
175+
.. _The RISC-V BL602 Book:
176+
https://lupyuen.github.io/articles/book
177+
178+
.. _Flashing Firmware to BL602:
179+
https://lupyuen.github.io/articles/book#flashing-firmware-to-bl602

0 commit comments

Comments
 (0)