Pine64 BL602 IoT SDK modded for the articles...
- "PineDio LoRa Gateway: Testing The Prototype"
- "Build a Linux Driver for PineDio LoRa SX1262 USB Adapter"
- "Monitor IoT Devices in The Things Network with Prometheus and Grafana"
- "CBOR Payload Formatter for The Things Network"
- "Internal Temperature Sensor on BL602"
- "Internal Temperature Sensor on BL602"
- "IoT Digital Twin with Roblox and The Things Network"
- "Encode Sensor Data with CBOR on BL602"
- "Grafana Data Source for The Things Network"
- "The Things Network on PineDio Stack BL604 RISC-V Board"
- "LoRaWAN on PineDio Stack BL604 RISC-V Board"
- "Rust on RISC-V BL602: Rhai Scripting"
- "PineDio Stack BL604 RISC-V Board: Testing The Prototype"
- "Rust on RISC-V BL602: Simulated with WebAssembly"
- "Rust on RISC-V BL602: Is It Sunny?"
- "Reverse Engineering WiFi on RISC-V BL602"
- "Machine Learning on RISC-V BL602 with TensorFlow Lite"
- "BL602 Bootloader"
- "Simulate RISC-V BL602 with WebAssembly, uLisp and Blockly"
- "uLisp and Blockly on PineCone BL602 RISC-V Board"
- "Run Rust RISC-V Firmware with BL602 IoT SDK"
- "PineCone BL602 RISC-V Board Receives LoRa Packets"
- "RAKwireless WisBlock talks LoRa with PineCone BL602 RISC-V Board"
- "Connect PineCone BL602 to LoRa Transceiver"
- "The RISC-V BL602 Book"
- "PineCone BL602 Talks UART to Grove E-Ink Display"
- "PineCone BL602 Blasting Pixels to ST7789 Display with LVGL Library"
- "PineCone BL602 talks SPI too!"
- "PineCone BL602 talks to I2C Sensors"
- "Mynewt GPIO ported to PineCone BL602 RISC-V Board"
- "Control PineCone BL602 RGB LED with GPIO and PWM"
- "Flashing Firmware to PineCone BL602"
- "Debug Rust on PineCone BL602 with VSCode and GDB"
- "Porting Mynewt to PineCone BL602"
- "Connect PineCone BL602 to OpenOCD"
- "Quick Peek of PineCone BL602 RISC-V Evaluation Board"
- Capture built firmware from GitHub Actions Workflow as Artifacts
- "jtag" branch contains a modified Hello World app that remaps the JTAG port: sdk_app_helloworld
- Modified PWM Demo Firmware that runs without Device Tree: sdk_app_pwm
- "i2c" branch contains a modified I2C Demo Firmware that uses the Low Level I2C HAL: sdk_app_i2c
- New SPI Firmware that uses the SPI HAL: sdk_app_spi_demo
- New Firmware for ST7789 SPI Display + LVGL Graphics Library: sdk_app_st7789
- New Firmware for Grove E-Ink Display with UART Interface: sdk_app_uart_eink
- New Firmware that transmits and receives LoRa packets: sdk_app_lora
- New Firmware for LoRa Ping: sdk_app_loraping
- New Library for NimBLE and SX1276: nimble-porting-layer and lora-sx1276
- New LoRaWAN Driver and Firmware: lorawan and sdk_app_lorawan
- New Driver for LoRa SX1262: lora-sx1262
- New Rust Library and Firmware: rust-app and sdk_app_rust
- New Blinky Firmware: sdk_app_blinky
- New uLisp Library and Firmware: ulisp-bl602 and sdk_app_ulisp
- New TensorFlow Lite Library and Firmware: tflite-bl602 and sdk_app_tflite
- New ADC Firmware: sdk_app_adc, sdk_app_adc2, sdk_app_rust_adc and sdk_app_rust_gpio
- New PineDio Stack BL604 Blinky Firmware: pinedio_blinky
- New PineDio Stack ST7789 Firmware: pinedio_st7789, pinedio_st7789_bitbang
- New CBOR Firmware: pinedio_cbor
- New Internal Temperature Sensor Firmware: pinedio_tsen
- New PineDio Stack LoRaWAN Firmware: pinedio_lorawan
Join us on Discord, Telegram, Matrix
This repository contains the Pine64 fork of Bouffalo Lab's SDK for their BL602
Wi-Fi/BLE Combo RISC-V SoC. Documentation, including upstream documentation,
translations, mirrored technical documentation, and original reverse engineered
documentation is at bl602-docs, which
is cloned as a submodule of this repository at docs
. Use git submodule
update --init
to initialize the submodule.
This repository is the central focus of Pine64's Nutcracker Challenge. The main task is to reverse engineer the following files:
This is being done at bl602-re.
You can find a lot of documentation on PINE64 Documentation Website and PINE64 Documentation Repository, where you can find Datasheets, Reference Manuals and various other documentation materials.
In order to build sample apps, you need to set a few environment variables:
export BL60X_SDK_PATH=/path/to/this/repo export CONFIG_CHIP_NAME=BL602
In order to build all sample apps simply call make, for example:
make
To only build the sample app of interest, go to the directory of the app, then call make, for example:
cd customer_app/bl602_boot2 make
make CONFIG_TOOLPREFIX=riscv64-linux-gnu-
if you wish to bypass the bundled cross-compiler and using your distribution's own cross-compiler.
There is a linker script (written in python) at image_conf/flash_build.py. To run this, you need to specify the application and the target, for example:
python3 flash_build.py bl602_boot2 bl602
Note: If you decide to copy any project outside of the customer_app folder, you will need to define a few variables in order to compile it:
export BL60X_SDK_PATH=/path/to/this/repo export CONFIG_CHIP_NAME=bl602
To set up a development environment in Docker, and do a full build of all the example projects, using the bundled toolchain:
docker build -t bl602sdk -f Dockerfile.bundled docker run -t -i --rm bl602sdk # make
BL602 is a 32-bit RISC-V based combo chipset supporting Wi-Fi and BLE (Bluetooth Low Energy). The chip is made by Nanjing-based Bouffalo Lab for ultra-low-power applications. In terms of price range and feature set, the chip is competing against Espressif ESP8266. The RISC-V core is based on SiFive E24.
At the moment there are mainly three development boards:
- PineCone: USB-C evaluation board by Pine64 (datasheet here), RGB LED, CH340N USB-to-UART chip
- Doi.am DT-BL10: micro USB
- Official BL EVB (Sipeed early adopter program): mini USB, FTDI chip?
Bouffalo Lab BL602 | Espressif ESP8266 | |
---|---|---|
Architecture | 32-bit RISC-V (SiFive E24) @192MHz (dynamic @1-192MHz) L1 cache FPU |
32-bit Xtensa @80MHz (and 160MHz) |
Memory | 276KB SRAM 128KB ROM 1 Kb eFuse optional embdedded flash XIP QSPI flash support |
32 KiB instruction RAM 32 KiB instruction cache RAM 80 KiB user-data RAM 16 KiB ETS system-data RAM No programmable ROM QSPI flash support (up to 16 MB) |
Wi-Fi | 802.11 b/g/n @2.4GHz WPS/WEP/WPA/WPA2/WPA3 |
802.11 b/g/n @2.4GHz WEP/WPA/WPA2 |
Bluetooth | LE 5.0 | NONE |
GPIO | x16 | x16 |
SDIO | x1 2.0 slave | x1 v2.0 slave |
SPI | x1 | x2 |
UART | x2 | x1.5 (One Tx only) |
I2C | x1 | x1 (software implemented) |
I2S | NONE | x1 (with DMA) |
PWM channels | x5 | x4 |
ADC | 12-bit | 10-bit (SAR) |
DAC | 10-bit | NONE |
Analog Comparator | x2 | NONE |
DMA | x4 | with I2S |
Timer | RTC (up to 1 year) x2 32-bit general-purpose |
x1 hardware x1 software (no interrupt gen. on sw. timer) |
IR Remote Control | x1 | x1 |
Debug | JTAG support | ? |