Difference between revisions of "PineCone"

From PINE64
Jump to navigation Jump to search
m (Fxc moved page Nutcracker to Pinenut)
(Add article "Apache NuttX OS on RISC-V BL602 and BL604")
 
(29 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{Note|Page under construction, information subject to change.}}
 
 
[[File:Pine64_BL602_EVB_photo-3-small.jpg|thumb|PineCone BL602 EVB (Evaluation Board)]]
 
[[File:Pine64_BL602_EVB_photo-3-small.jpg|thumb|PineCone BL602 EVB (Evaluation Board)]]
 +
 +
The '''PineCone''' is a BL602 evaluation board, which was developed with the goal to challenge the open source community to achieve blob-free and free and open source WiFi and Bluetooth, see the [https://www.pine64.org/2020/10/28/nutcracker-challenge-blob-free-wifi-ble/ Nutcracker Challenge].
  
 
== BL602 Specifications ==
 
== BL602 Specifications ==
Line 76: Line 77:
 
* [https://files.pine64.org/doc/Pinenut/NUT-01S%20GPIO%20Definition%20ver%201.0.pdf Pinenut-01S GPIO Definition ver 1.0]
 
* [https://files.pine64.org/doc/Pinenut/NUT-01S%20GPIO%20Definition%20ver%201.0.pdf Pinenut-01S GPIO Definition ver 1.0]
 
* [https://files.pine64.org/doc/Pinenut/USB%20Adapter%20for%20Pinenut-01S%20Schematic%20V1.0.pdf USB Programmer adapter for Pinenut-01S schematic ver 1.0]
 
* [https://files.pine64.org/doc/Pinenut/USB%20Adapter%20for%20Pinenut-01S%20Schematic%20V1.0.pdf USB Programmer adapter for Pinenut-01S schematic ver 1.0]
 +
* The default firmware runs the UART at 2000000 bps.  It will accept input whilst regularly outputting:<code><br/>proc_hellow_entry: RISC-V rv32imafc<br/>cur key status:1</code>
  
 
== Pinenut-12S Module information ==
 
== Pinenut-12S Module information ==
Line 96: Line 98:
  
 
== Loading code ==
 
== Loading code ==
To load code, you must move the jumper to the edge closest to the board, press reset, load the code, move the jumper back toward the center of the board, and press reset again.
+
To load code, you must move the jumper to the position closest to the edge, press reset, load the code, move the jumper back toward the center of the board, and press reset again.
  
 
There are currently a number of loaders in progress, each with differing degrees of completeness and success on various operating systems.
 
There are currently a number of loaders in progress, each with differing degrees of completeness and success on various operating systems.
Line 103: Line 105:
 
* [https://github.com/bouffalolab/BLOpenFlasher BLOpenFlasher] is a WIP, written in go, by Bouffalo Labs to provide source for a flash utility.
 
* [https://github.com/bouffalolab/BLOpenFlasher BLOpenFlasher] is a WIP, written in go, by Bouffalo Labs to provide source for a flash utility.
 
* [https://github.com/renzenicolai/bl602tool bl602tool] is a Python utility in development.
 
* [https://github.com/renzenicolai/bl602tool bl602tool] is a Python utility in development.
* [https://pypi.org/project/bflb-eflash-loader/ Bouffalo's Python Flash Loader] is a new (Dec 20) flash loader by the makers of the chip.
+
* <del>[https://pypi.org/project/bflb-eflash-loader/ Bouffalo's Python Flash Loader] is a new (Dec 20) flash loader by the makers of the chip.</del>
* [https://pypi.org/project/bflb-image-build/ Bouffalo's image build] smooshes code and adds headers for downloads.
+
* <del>[https://pypi.org/project/bflb-image-build/ Bouffalo's image build] smooshes code and adds headers for downloads.</del>
 +
* [https://pypi.org/project/bflb-mcu-tool/ Bouffalo's MCU tool] (Mar 2021) Python image tool replaced both of the above. Now combined with eflash loader, deals with partitions, DTS, signing, fuses etc.
 
* [https://github.com/spacemeowx2/blflash blflash serial flasher] BL602 serial flasher, inspired by BLOpenFlasher
 
* [https://github.com/spacemeowx2/blflash blflash serial flasher] BL602 serial flasher, inspired by BLOpenFlasher
  
Line 135: Line 138:
 
* [https://lupyuen.github.io/articles/lora Connect PineCone BL602 to LoRa Transceiver by Lup Yuen]
 
* [https://lupyuen.github.io/articles/lora Connect PineCone BL602 to LoRa Transceiver by Lup Yuen]
 
* [https://lupyuen.github.io/articles/wisblock RAKwireless WisBlock talks LoRa with PineCone BL602 RISC-V Board by Lup Yuen]
 
* [https://lupyuen.github.io/articles/wisblock RAKwireless WisBlock talks LoRa with PineCone BL602 RISC-V Board by Lup Yuen]
 +
* [https://lupyuen.github.io/articles/lora2 PineCone BL602 RISC-V Board Receives LoRa Packets by Lup Yuen]
 +
* [https://lupyuen.github.io/articles/rust Run Rust RISC-V Firmware with BL602 IoT SDK by Lup Yuen]
 +
* [https://lupyuen.github.io/articles/lorawan PineCone BL602 Talks LoRaWAN by Lup Yuen]
 +
* [https://lupyuen.github.io/articles/lisp uLisp and Blockly on PineCone BL602 RISC-V Board by Lup Yuen]
 +
* [https://lupyuen.github.io/articles/wasm Simulate RISC-V BL602 with WebAssembly, uLisp and Blockly by Lup Yuen]
 +
* [https://lupyuen.github.io/articles/boot BL602 Bootloader by Lup Yuen]
 +
* [https://lupyuen.github.io/articles/tflite Machine Learning on RISC-V BL602 with TensorFlow Lite by Lup Yuen]
 +
* [https://lupyuen.github.io/articles/wifi Reverse Engineering WiFi on RISC-V BL602 by Lup Yuen]
 +
* [https://lupyuen.github.io/articles/adc Rust on RISC-V BL602: Is It Sunny? by Lup Yuen]
 +
* [https://lupyuen.github.io/articles/rustsim Rust on RISC-V BL602: Simulated with WebAssembly by Lup Yuen]
 +
* [https://lupyuen.github.io/articles/pinedio PineDio Stack BL604 RISC-V Board: Testing The Prototype by Lup Yuen]
 +
* [https://lupyuen.github.io/articles/rhai Rust on RISC-V BL602: Rhai Scripting by Lup Yuen]
 +
* [https://lupyuen.github.io/articles/lorawan2 LoRaWAN on PineDio Stack BL604 RISC-V Board by Lup Yuen]
 +
* [https://lupyuen.github.io/articles/ttn The Things Network on PineDio Stack BL604 RISC-V Board by Lup Yuen]
 +
* [https://lupyuen.github.io/articles/cbor Encode Sensor Data with CBOR on BL602 by Lup Yuen]
 +
* [https://lupyuen.github.io/articles/roblox IoT Digital Twin with Roblox and The Things Network by Lup Yuen]
 +
* [https://lupyuen.github.io/articles/tsen Internal Temperature Sensor on BL602 by Lup Yuen]
 +
* [https://lupyuen.github.io/articles/payload CBOR Payload Formatter for The Things Network by Lup Yuen]
 +
* [https://lupyuen.github.io/articles/prometheus Monitor IoT Devices in The Things Network with Prometheus and Grafana by Lup Yuen]
 +
* [https://lupyuen.github.io/articles/nuttx Apache NuttX OS on RISC-V BL602 and BL604 by Lup Yuen]
  
 
[[Category:Nutcracker]]
 
[[Category:Nutcracker]]

Latest revision as of 14:28, 24 November 2021

PineCone BL602 EVB (Evaluation Board)

The PineCone is a BL602 evaluation board, which was developed with the goal to challenge the open source community to achieve blob-free and free and open source WiFi and Bluetooth, see the Nutcracker Challenge.

BL602 Specifications

  • CPU: 32-bit RV32IMAFC RISC-V “SiFive E24 Core”
  • Memory:
    • 128KB ROM
    • 276KB SRAM
    • 1Kb eFuse
    • 2MB Embedded Flash
  • Security:
    • Secure boot
    • Secure debug
    • AES 128/192/256
    • SHA-1/224/256
    • TRNG (True Random Number Generator)
    • PKA (Public Key Accelerator)
  • Wireless:
    • Wi-Fi 802.11 b/g/n
    • Bluetooth® Low Energy 5.0
    • Wi-Fi Fast connection with BLE assistance
    • Wi-Fi and BLE coexistence
    • Wi-Fi Security WPS/WEP/WPA/WPA2/WPA3
    • STA, SoftAP and sniffer modes
    • Multi-Cloud connectivity
    • 2.4 GHz RF transceiver
    • Integrated RF balun, PA/LNA
  • Package Type:
    • 32 pin QFN 4mm x 4mm
  • JTAG support (See below for BL602 impact)

BL602 Block Diagram.jpg

JTAG

Default JTAG pins
GPIO Pin JTAG Pin
GPIO17 TDI
GPIO11 TDO
GPIO12 TMS
GPIO14 TCK

BL602 multiplexes four GPIO pins to provide the familiar JTAG lines. See the accompanying table for the default pin mappings.

These are the default JTAG pins in use after a cold boot. However, many pieces of software, including the demo that's installed by default on new PineCones, remap these pins to other functions. You cannot use the default wiring for JTAG while such software is running. This issue is especially prevalent on the PineCone because three of the default JTAG pins are connected to the onboard RGB LED. Nothing about the LED itself interferes with JTAG, but any program that uses the LED will necessarily remap some of the default JTAG pins to be GPIO.

The MaskROM download mode that the BL602 enters when you tie GPIO8 high does not remap the default JTAG pins, and so you can and should use that mode while checking basic functionality of your JTAG adapter.

Note that, just as software can remap the default JTAG pins to be something else, it can also remap other pins to be JTAG. Control over this is quite granular, with 5-6 candidate pins for each individual JTAG signal that can be mapped independently of one another. LEE Lup Yuen has written some sample code showing how to remap the JTAG pins so that your software can use the LED without giving up support for debugging.

Pine64 USB JTAG Adapter information and schematics

PineCone BL602 EVB information and schematics

  • Approximate dimensions: 26mm x 43mm
  • Board layout:

PADI-II EVB.png

  • PineCone BL602 EVB schematic ver 1.1
    • Note: In PineCone revision 1.1 ("BL62B_EVB V1.1" silkscreened on back of board), CC1 and CC2 share one 5.1KΩ resistor. This means the board will fail to power when you use an e-marked USB-C cable like the one that comes with Apple chargers. See this article for details of why this happens. The next schematic design will give each line its own 5.1KΩ resistor as per the USB-C specification.
  • The board uses a CH340 Serial/USB adapter. This chip is commonly used in Arduino-class development boards. It is a full speed (12Mbps) USB interface and has vendor ID 0x1a86 with product ID 0x7523.
  • The GPIO pins (11, 12, 14, 17) plus the nearby RESET, POWER, and GND pins are all located on one side of the board, on J1 to provide JTAG connection.

Pinenut-01S Module information and schematics

Pinenut-01S PCB-Front.pngPinenut-01S PCB-Back.png

Pinenut-12S Module information

NUT-12S module-front.jpgNUT-12S module-back.jpg


Datasheets for components and peripherals

Misc notes

Planned to be available in at least three form factors:

  • NUT-01S -> ESP-01S
  • NUT-12S -> ESP-12S
  • NUT-15 -> RTL8723/AMPAK

Loading code

To load code, you must move the jumper to the position closest to the edge, press reset, load the code, move the jumper back toward the center of the board, and press reset again.

There are currently a number of loaders in progress, each with differing degrees of completeness and success on various operating systems.

  • In the build tree, there is BLFlashCube for Windows, which is a proprietary GUI for flashing images. Linux and macOS binaries are available via Bouffalo Lab's developer portal.
  • bl60x-flash is in Python and has been reported successful on MacOS catalina (10.15.6) by Punnerud and madushan1000.
  • BLOpenFlasher is a WIP, written in go, by Bouffalo Labs to provide source for a flash utility.
  • bl602tool is a Python utility in development.
  • Bouffalo's Python Flash Loader is a new (Dec 20) flash loader by the makers of the chip.
  • Bouffalo's image build smooshes code and adds headers for downloads.
  • Bouffalo's MCU tool (Mar 2021) Python image tool replaced both of the above. Now combined with eflash loader, deals with partitions, DTS, signing, fuses etc.
  • blflash serial flasher BL602 serial flasher, inspired by BLOpenFlasher

Development efforts

Articles and Blogs