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