Skip to content

Commit 6bfee9c

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

File tree

9 files changed

+312
-0
lines changed

9 files changed

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

0 commit comments

Comments
 (0)