-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Introduce Bouffalo Lab SoC's #78795
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
Introduce Bouffalo Lab SoC's #78795
Changes from 1 commit
b169a89
c71987d
0d79fd0
60d4562
5318a75
d3ac8c9
ba4daeb
784efc1
df8f88d
b20d5ad
2757196
01828de
b45434d
d032c73
902bb4e
dcaf4eb
a32c5ce
3173294
a699d4f
5613e36
6cfc420
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # Copyright (c) 2022-2024 ATL Electronics | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| config BOARD_BL604E_IOT_DVK | ||
| select SOC_BL604E20Q2I |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| /* | ||
| * Copyright (c) 2021-2024 ATL Electronics | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| #include <dt-bindings/pinctrl/bl604x-pinctrl.h> | ||
|
|
||
| &pinctrl { | ||
| uart0_default: uart0_default { | ||
| group1 { | ||
| pinmux = <GPIO7_UART0_RX>, | ||
| <GPIO16_UART0_TX>; | ||
| bias-pull-up; | ||
| input-schmitt-enable; | ||
| }; | ||
| }; | ||
|
|
||
| uart0_sleep: uart0_sleep { | ||
| group1 { | ||
| pinmux = <GPIO7_UART0_RX>, | ||
| <GPIO16_UART0_TX>; | ||
| bias-high-impedance; | ||
| }; | ||
| }; | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| /* | ||
| * Copyright (c) 2022-2024 ATL Electronics | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| /dts-v1/; | ||
|
|
||
| #include <bouffalolab/bl604e.dtsi> | ||
| #include "bl604e_iot_dvk-pinctrl.dtsi" | ||
|
|
||
| / { | ||
| model = "BL604E IOT DVK development board"; | ||
| compatible = "bflb,bl604"; | ||
|
|
||
| chosen { | ||
| zephyr,flash = &flash0; | ||
| zephyr,itcm = &itcm; | ||
| zephyr,dtcm = &dtcm; | ||
| zephyr,sram = &sram0; | ||
| zephyr,console = &uart0; | ||
| zephyr,shell-uart = &uart0; | ||
| }; | ||
| }; | ||
|
|
||
| &cpu0 { | ||
| clock-frequency = <192000000>; | ||
| }; | ||
|
|
||
| &spi1 { | ||
| #address-cells = <1>; | ||
| #size-cells = <0>; | ||
| reg = <0x4000b000 0x1000 0x23000000 0xc00000>; | ||
| flash0: flash@0 { | ||
| compatible = "issi,is25lp128", "jedec,spi-nor"; | ||
| status = "disabled"; | ||
| size = <134217728>; | ||
| jedec-id = [96 60 18]; | ||
| reg = <0>; | ||
| spi-max-frequency = <133000000>; | ||
|
||
| }; | ||
| }; | ||
|
|
||
| &uart0 { | ||
| status = "okay"; | ||
| current-speed = <115200>; | ||
|
|
||
| pinctrl-0 = <&uart0_default>; | ||
| pinctrl-1 = <&uart0_sleep>; | ||
| pinctrl-names = "default", "sleep"; | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # Copyright (c) 2022-2024 ATL Electronics | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| identifier: bl604e_iot_dvk | ||
| name: BL604E IOT DVK development board | ||
| type: mcu | ||
| arch: riscv | ||
| ram: 64 | ||
| toolchain: | ||
| - zephyr | ||
| testing: | ||
| ignore_tags: | ||
| - net | ||
| - bluetooth | ||
| supported: | ||
| - pinctrl | ||
| - uart | ||
| vendor: bflb |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # Copyright (c) 2022-2024 ATL Electronics | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| CONFIG_CONSOLE=y | ||
| CONFIG_SERIAL=y | ||
|
|
||
| CONFIG_UART_CONSOLE=y | ||
| CONFIG_UART_BFLB=y | ||
| CONFIG_UART_INTERRUPT_DRIVEN=y |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # Copyright (c) 2022-2024 ATL Electronics | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| board_runner_args(openocd --cmd-pre-init "source [find bl6.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 0x22008000 0x22014000 rw") | ||
| board_runner_args(openocd --gdb-init "mem 0x42008000 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(blflash --port /dev/ttyACM0) | ||
| include(${ZEPHYR_BASE}/boards/common/blflash.board.cmake) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| board: | ||
| name: bl604e_iot_dvk | ||
| full_name: BL604E IOT DVK development board | ||
| vendor: bflb | ||
| socs: | ||
| - name: bl604e20q2i |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,179 @@ | ||
| .. zephyr:board:: bl604e_iot_dvk | ||
|
|
||
| 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). | ||
|
|
||
| Hardware | ||
| ******** | ||
|
|
||
| For more information about the Bouffalo Lab BL-60x MCU: | ||
|
|
||
| - `Bouffalo Lab BL60x MCU Website`_ | ||
| - `Bouffalo Lab BL60x MCU Datasheet`_ | ||
| - `Bouffalo Lab Development Zone`_ | ||
| - `The RISC-V BL602 Book`_ | ||
|
|
||
| Supported Features | ||
| ================== | ||
|
|
||
| The board configuration supports the following hardware features: | ||
nandojve marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| +-----------+------------+-----------------------+ | ||
| | Interface | Controller | Driver/Component | | ||
| +===========+============+=======================+ | ||
| | MTIMER | on-chip | RISC-V Machine Timer | | ||
| +-----------+------------+-----------------------+ | ||
| | PINCTRL | on-chip | pin muxing | | ||
| +-----------+------------+-----------------------+ | ||
| | UART | on-chip | serial port-polling; | | ||
| | | | serial port-interrupt | | ||
| +-----------+------------+-----------------------+ | ||
|
|
||
|
|
||
| The default configurations can be found in the Kconfig | ||
nandojve marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| :zephyr_file:`boards/bouffalolab/bl6/bl604e_iot_dvk/bl604e_iot_dvk_defconfig`. | ||
|
|
||
| System Clock | ||
| ============ | ||
|
|
||
| The BL604E Development Board is configured to run at max speed (192MHz). | ||
|
|
||
| Serial Port | ||
| =========== | ||
|
|
||
| The ``bl604e_iot_dvk`` uses UART0 as default serial port. It is connected to | ||
nandojve marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| USB Serial converter and port is used for both program and console. | ||
|
|
||
|
|
||
| Programming and Debugging | ||
| ************************* | ||
|
|
||
| BL Flash tool | ||
| ============= | ||
|
|
||
| The BL-60x have a ROM bootloader that allows user flash device by serial port. | ||
nandojve marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 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`_ | ||
|
|
||
| #. Install cargo | ||
|
|
||
| .. code-block:: console | ||
|
|
||
| $ sudo apt-get install cargo | ||
|
|
||
| #. 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 target/release/blflash ~/bin/ | ||
|
|
||
| #. Test | ||
|
|
||
| .. code-block:: console | ||
|
|
||
| $ blflash -V | ||
|
|
||
| It will print blflash version | ||
|
|
||
| .. code-block:: console | ||
|
|
||
| $ blflash 0.3.5 | ||
|
|
||
| Samples | ||
| ======= | ||
|
|
||
| #. Build the Zephyr kernel and the :zephyr:code-sample:`hello_world` sample | ||
| application: | ||
|
|
||
| .. zephyr-app-commands:: | ||
| :zephyr-app: samples/hello_world | ||
| :board: bl604e_iot_dvk | ||
| :goals: build | ||
| :compact: | ||
|
|
||
| #. To flash an image using blflash runner: | ||
|
|
||
| #. Press BOOT button | ||
|
|
||
| #. Press and release RST button | ||
|
|
||
| #. Release BOOT 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/ttyACM0`. For example: | ||
|
|
||
| .. code-block:: console | ||
|
|
||
| $ minicom -D /dev/ttyACM0 -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 RST button | ||
|
|
||
| .. code-block:: console | ||
|
|
||
| *** Booting Zephyr OS build v3.7.0-3255-g6e0fa5c1c77a *** | ||
| Hello World! bl604e_iot_dvk/bl604e20q2i | ||
|
|
||
| Congratulations, you have ``bl604e_iot_dvk`` configured and running Zephyr. | ||
|
|
||
|
|
||
| .. _Bouffalo Lab BL60x MCU Website: | ||
| https://en.bouffalolab.com/product/?type=detail&id=6 | ||
|
|
||
| .. _Bouffalo Lab BL60x MCU Datasheet: | ||
| https://github.com/bouffalolab/bl_docs/tree/main/BL602_DS/en | ||
|
|
||
| .. _Bouffalo Lab Development Zone: | ||
| https://dev.bouffalolab.com/home?id=guest | ||
|
|
||
| .. _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 | ||
Uh oh!
There was an error while loading. Please reload this page.