Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
8 changes: 8 additions & 0 deletions boards/riscv/dt_bl10_devkit/Kconfig.board
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Bouffalo Lab BL602 DevKit
#
# Copyright (c) 2021 ATL Electronics
# SPDX-License-Identifier: Apache-2.0

config BOARD_DT_BL10_DEVKIT
bool "2.4GHz Wi-Fi and BLE coexistence Module Development Kit"
depends on SOC_PART_NUMBER_BL602C20Q2I
11 changes: 11 additions & 0 deletions boards/riscv/dt_bl10_devkit/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Bouffalo Lab BL602 DevKit
#
# Copyright (c) 2021 ATL Electronics
# SPDX-License-Identifier: Apache-2.0

if BOARD_DT_BL10_DEVKIT

config BOARD
default "dt_bl10_devkit"

endif # BOARD_DT_BL10_DEVKIT
4 changes: 4 additions & 0 deletions boards/riscv/dt_bl10_devkit/board.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (c) 2021, ATL Electronics
# SPDX-License-Identifier: Apache-2.0

include(${ZEPHYR_BASE}/boards/common/blflash.board.cmake)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
187 changes: 187 additions & 0 deletions boards/riscv/dt_bl10_devkit/doc/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
.. _dt_bl10_devkit:

BL602 Development Board
#######################

Overview
********

BL602/BL604 is a Wi-Fi+BLE chipset introduced by Bouffalo Lab, which is used
for low power consumption and high performance application development. The
wireless subsystem includes 2.4G radio, Wi-Fi 802.11b/g/n and BLE 5.0
baseband/MAC design. The microcontroller subsystem includes a 32-bit RISC CPU
with low power consumption, cache and memory. The power management unit
controls the low power consumption mode. In addition, it also supports
various security features. The external interfaces include SDIO, SPI, UART,
I2C, IR remote, PWM, ADC, DAC, PIR and GPIO.

The BL602 Development Board features a SiFive E24 32 bit RISC-V CPU with FPU,
it supports High Frequency clock up to 192Mhz, have 128k ROM, 276kB RAM,
2.4 GHz WIFI 1T1R mode, support 20 MHz, data rate up to 72.2 Mbps, BLE 5.0
with 2MB phy. It is a secure MCU which supports Secure boot, ECC-256 signed
image, QSPI/SPI Flash On-The-Fly AES Decryption and PKA (Public Key
Accelerator).

.. image:: img/dt_bl10_devkit.jpg
:width: 450px
:align: center
:alt: dt_bl10_devkit

Hardware
********

For more information about the Bouffalo Lab BL-602 MCU:

- `Bouffalo Lab BL602 MCU Website`_
- `Bouffalo Lab BL602 MCU Datasheet`_
- `Bouffalo Lab Development Zone`_
- `dt_bl10_devkit Schematic`_
- `Doctors of Intelligence & Technology (www.doiting.com)`_
- `The RISC-V BL602 Book`_

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

The board configuration supports the following hardware features:

+-----------+------------+-----------------------+
| Interface | Controller | Driver/Component |
+===========+============+=======================+
| MTIMER | on-chip | RISC-V Machine Timer |
+-----------+------------+-----------------------+
| PINCTRL | on-chip | pin muxing |
+-----------+------------+-----------------------+
| UART | on-chip | serial port-polling |
+-----------+------------+-----------------------+


The default configurations can be found in the Kconfig
:zephyr_file:`boards/risc/dt_bl10_devkit/dt_bl10_devkit_defconfig`.

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

The BL602 Development Board is configured to run at max speed (192MHz).

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

The dt_bl10_devkit_ 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
*************************

BL Flash tool
=============

The BL-602 have a ROM bootloader that allows user flash device by serial port.
There are some tools available at internet and this will describe one of them.
The below guide was created based on RISC-V BL602 Book, chapter 3
`Flashing Firmware to BL602`_.

#. `Install Rustup`_

#. Clone blflash rust version

.. code-block:: console

$ git clone --recursive https://github.com/spacemeowx2/blflash

#. Build blflash

.. code-block:: console

$ cd blflash
$ cargo build --release

#. Install blflash. The recommended use is copy to home folder

.. code-block:: console

$ cp blflash ~/bin/

#. Test

.. code-block:: console

$ blflash -V

It will print blflash version

.. code-block:: console

$ blflash 0.3.3

Samples
=======

#. Build the Zephyr kernel and the :ref:`hello_world` sample application:

.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: dt_bl10_devkit
:goals: build
:compact:

#. To flash an image using blflash runner:

#. Press D8 button

#. Press and release EN button

#. Release D8 button

.. code-block:: console

west flash -r blflash

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

.. code-block:: console

$ minicom -D /dev/ttyUSB0 -o

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 EN button

.. code-block:: console

*** Booting Zephyr OS build zephyr-v2.6.0-1729-g22140c728537 ***
Hello World! dt_bl10_devkit

Congratulations, you have `dt_bl10_devkit`_ configured and running Zephyr.


.. _Bouffalo Lab BL602 MCU Website:
https://www.bouffalolab.com/bl602

.. _Bouffalo Lab BL602 MCU Datasheet:
https://github.com/bouffalolab/bl_docs/tree/main/BL602_DS/en

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

.. _dt_bl10_devkit Schematic:
https://github.com/SmartArduino/Doiting_BL/blob/master/board/DT-BL10%20User%20Mannual.pdf

.. _Doctors of Intelligence & Technology (www.doiting.com):
https://www.doiting.com

.. _Install Rustup:
https://rustup.rs/

.. _The RISC-V BL602 Book:
https://lupyuen.github.io/articles/book

.. _Flashing Firmware to BL602:
https://lupyuen.github.io/articles/book#flashing-firmware-to-bl602
28 changes: 28 additions & 0 deletions boards/riscv/dt_bl10_devkit/dt_bl10_devkit-pinctrl.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright (c) 2021, ATL Electronics
* SPDX-License-Identifier: Apache-2.0
*/

#include <bouffalolab/bl602.dtsi>

&pinctrl {
uart0_default: uart0_default {
pins1 {
bflb,pins = <BFLB_PIN(uart0, 7)>,
<BFLB_PIN(uart0, 16)>;
bflb,signals = <BFLB_SIG_UART_RXD>,
<BFLB_SIG_UART_TXD>;
bias-pull-up;
input-schmitt-enable;
};
};
uart0_sleep: uart0_sleep {
pins1 {
bflb,pins = <BFLB_PIN(uart0, 7)>,
<BFLB_PIN(uart0, 16)>;
bflb,signals = <BFLB_SIG_UART_RXD>,
<BFLB_SIG_UART_TXD>;
bias-high-impedance;
};
};
};
50 changes: 50 additions & 0 deletions boards/riscv/dt_bl10_devkit/dt_bl10_devkit.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* Copyright (c) 2021, ATL Electronics
* SPDX-License-Identifier: Apache-2.0
*/

/dts-v1/;

#include "dt_bl10_devkit-pinctrl.dtsi"

/ {
model = "2.4GHz Wi-Fi and BLE coexistence Module Development Kit";
compatible = "bflb,bl602";

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

&cpu0 {
clock-frequency = <160000000>;
};

&spi1 {
#address-cells = <1>;
#size-cells = <0>;
reg = <0x4000b000 0x1000 0x23000000 0xc00000>;
flash0: flash@0 {
compatible = "issi,is25lp128", "jedec,spi-nor";
size = <134217728>;
label = "FLASH0";
jedec-id = [96 60 18];
reg = <0>;
// Dummy entry
spi-max-frequency = <0>;
Comment on lines +38 to +39
Copy link
Contributor

Choose a reason for hiding this comment

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

What's going on here? This does not look correct. Is it just for draft?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hi @mbolivar-nordic , all this PR still marked as draft. I only asked to @gmarull some tips about pinctrl because it is a new API and this SoC have some odd parts.

};
};

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

pinctrl-0 = <&uart0_default>;
pinctrl-1 = <&uart0_sleep>;
pinctrl-names = "default", "sleep";
};
14 changes: 14 additions & 0 deletions boards/riscv/dt_bl10_devkit/dt_bl10_devkit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright (c) 2021, ATL Electronics
# SPDX-License-Identifier: Apache-2.0

identifier: dt_bl10_devkit
name: 2.4GHz Wi-Fi and BLE coexistence Module Development Kit
type: mcu
arch: riscv32
ram: 64
toolchain:
- zephyr
testing:
ignore_tags:
- net
- bluetooth
10 changes: 10 additions & 0 deletions boards/riscv/dt_bl10_devkit/dt_bl10_devkit_defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright (c) 2021, ATL Electronics
# SPDX-License-Identifier: Apache-2.0

CONFIG_SOC_SERIES_BL6=y
CONFIG_SOC_PART_NUMBER_BL602C20Q2I=y
CONFIG_BOARD_DT_BL10_DEVKIT=y

CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_SERIAL=y