# RISC-V GAP

Configuration

  platform = `riscv_gap`

GreenWaves GAP8 IoT application processor enables the cost-effective development, deployment and autonomous operation of intelligent sensing devices that capture, analyze, classify and act on the fusion of rich data sources such as images, sounds or vibrations.

For more detailed information please visit vendor site.

Contents

- Configuration

- Examples

- Debugging

- Stable and upstream versions

- Packages

- Frameworks

- Boards

## Configuration

- Drivers

- AutoTiler

- Running modes

  - Run from RAM

  - Run from RAM (without any bridge interaction)

  - Flash and run from RAM

  - Flash and run from Flash

  - Run from Flash

  - Run from Flash (without any bridge interaction)

- Uploading files to HyperFlash

### Drivers

See “Drivers” section for FTDI Chip debug probe.

### AutoTiler

You need GAP8 AutoTiler library, please request it via support@greenwaves-technologies.com

Put a library somewhere on a disk and add this folder to library path using build_flags in “platformio.ini” (Project Configuration File). For example,

>     [env:gapuino]
>     platform = riscv_gap
>     board = gapuino
>     framework = ...
>     build_flags = -L/path/to/libtile/folder

### Running modes

GAPuino supports 2 main modes:

1. Running from RAM, `boot_mode=jtag`

2. Running from HyperFlash, `boot_mode=jtag_hyper`

A running process can be controlled through the internal upload commands:

- `load`, @TODO

- `reqloop`, @TODO

- `ioloop`, @TODO

- `start`, @TODO

- `wait`, @TODO

You can configure “boot mode” and list of upload commands using “platformio.ini” (Project Configuration File). Default values are:

- `board_upload.boot_mode = jtag`

- `board_upload.commands = load reqloop ioloop start wait`

#### Run from RAM

This is a default behavior when you run “Upload” task in PlatformIO IDE or use PlatformIO Core (CLI) and `platformio run --target` command with `upload` target.

#### Run from RAM (without any bridge interaction)

- Configure build environment using “platformio.ini” (Project Configuration File) as described below

      [env:gapuino]
      platform = riscv_gap
      board = gapuino
      framework = ...
      board_upload.commands = load start

- Run “Upload” task in PlatformIO IDE or use PlatformIO Core (CLI) and `platformio run --target` command with `upload` target.

#### Flash and run from RAM

The same as Uploading files to HyperFlash.

#### Flash and run from Flash

- Configure build environment using “platformio.ini” (Project Configuration File) as described below

      [env:gapuino]
      platform = riscv_gap
      board = gapuino
      framework = ...
      board_upload.boot_mode = jtag_hyper
      board_upload.commands = reqloop ioloop start wait

- Perform Uploading files to HyperFlash.

#### Run from Flash

Note

You have to perform Uploading files to HyperFlash before.

- Configure build environment using “platformio.ini” (Project Configuration File) as described below

      [env:gapuino]
      platform = riscv_gap
      board = gapuino
      framework = ...
      board_upload.boot_mode = jtag_hyper
      board_upload.commands = reqloop ioloop start wait

- Run “Upload” task in PlatformIO IDE or use PlatformIO Core (CLI) and `platformio run --target` command with `upload` target.

#### Run from Flash (without any bridge interaction)

Note

You have to perform Uploading files to HyperFlash before.

- Configure build environment using “platformio.ini” (Project Configuration File) as described below

      [env:gapuino]
      platform = riscv_gap
      board = gapuino
      framework = ...
      board_upload.boot_mode = jtag_hyper
      board_upload.commands = start

- Run “Upload” task in PlatformIO IDE or use PlatformIO Core (CLI) and `platformio run --target` command with `upload` target.

### Uploading files to HyperFlash

1. Create new project using PlatformIO IDE or initialize project using PlatformIO Core (CLI) and platformio project init (if you have not initialized it yet)

2. Create `data` folder (it should be on the same level as `src` folder) and put files here. Also, you can specify own location for data_dir

3. Run “Upload File System image” task in PlatformIO IDE or use PlatformIO Core (CLI) and `platformio run --target` command with `uploadfs` target.

Examples:

- PULP OS File System

## Examples

Examples are listed from RISC-V GAP development platform repository:

- gapuino-mbed-os-irq

- gapuino-mbed-autotiler-cifar10

- gapuino-mbed-driver-hyper-flash

- gapuino-pulp-os-i2c-eeprom

- gapuino-mbed-events-queue

- gapuino-pulp-os-kernel-dma

- gapuino-mbed-driver-hyper-rtc-alarm

- gapuino-mbed-fft2d

- gapuino-pulp-os-autotiler-bilinear-resize

- gapuino-mbed-matadd

- gapuino-mbed-features-cluster-dma

- gapuino-mbed-features-filesystem

- gapuino-pulp-os-filesystem

- gapuino-mbed-os-memory-pool

- gapuino-pulp-os-autotiler-cifar10

- gapuino-mbed-driver-cpp-raw-serial

- gapuino-pulp-os-hello-world

## Debugging

PIO Unified Debugger - “1-click” solution for debugging with a zero configuration.

- Tools & Debug Probes

  - On-Board Debug Tools

### Tools & Debug Probes

Supported debugging tools are listed in “Debug” column. For more detailed information, please scroll table by horizontal. You can switch between debugging Tools & Debug Probes using debug_tool option in “platformio.ini” (Project Configuration File).

Warning

You will need to install debug tool drivers depending on your system. Please click on compatible debug tool below for the further instructions.

#### On-Board Debug Tools

Boards listed below have on-board debug probe and ARE READY for debugging! You do not need to use/buy external debug probe.

Name | MCU | Frequency | Flash | RAM
--- | --- | --- | --- | ---
GAPuino GAP8 | GAP8 | 250MHz | 64MB | 8MB

## Stable and upstream versions

You can switch between stable releases of RISC-V GAP development platform and the latest upstream version using platform option in “platformio.ini” (Project Configuration File) as described below.

### Stable

    ; Latest stable version
    [env:latest_stable]
    platform = riscv_gap
    board = ...

    ; Custom stable version
    [env:custom_stable]
    platform = riscv_gap@x.y.z
    board = ...

### Upstream

    [env:upstream_develop]
    platform = https://github.com/pioplus/platform-riscv_gap.git
    board = ...

## Packages

Name | Description
--- | ---
framework-gap_sdk | The GAP8 SDK allows you to compile and execute applications on the GAP8 IoT Application Processor.
tool-pulp_tools | Top project for building PULP development tools
toolchain-riscv-pulp | RISC-V GCC toolchain for PULP platform

Warning

Linux Users:

> - Install “udev” rules 99-platformio-udev.rules

> - Raspberry Pi users, please read this article Enable serial port on Raspberry Pi.

Windows Users:

> Please check that you have a correctly installed USB driver from board manufacturer

## Frameworks

Name | Description
--- | ---

Mbed

The mbed framework The mbed SDK has been designed to provide enough hardware abstraction to be intuitive and concise, yet powerful enough to build complex projects. It is built on the low-level ARM CMSIS APIs, allowing you to code down to the metal if needed. In addition to RTOS, USB and Networking libraries, a cookbook of hundreds of reusable peripheral and module libraries have been built on top of the SDK by the mbed Developer Community.

PULP OS | PULP is a silicon-proven Parallel Ultra Low Power platform targeting high energy efficiencies. The platform is organized in clusters of RISC-V cores that share a tightly-coupled data memory.

## Boards

Note

- You can list pre-configured boards by platformio boards command or PlatformIO Boards Explorer

- For more detailed `board` information please scroll the tables below by horizontally.

### GreenWaves Technologies

Name | Debug | MCU | Frequency | Flash | RAM
--- | --- | --- | --- | --- | ---
GAPuino GAP8 | On-board | GAP8 | 250MHz | 64MB | 8MB