Gap Toolchain and SDK

Gap Toolchain installation

Ubuntu version: 22.04.4

Download precompile toolchain (for ubuntu 20)

Open new terminal to create new directory:

Setup path:

nano ~/.profile

Add command below to profile

if [ -d "/opt/riscv_gap" ] ; then
    PATH="/opt/riscv_gap:$PATH"
fi

Invoke command below to take effect

source ~/.profile

Open new terminal to install toolchain

Clone gap toolchain

git clone https://github.com/GreenWaves-Technologies/gap_gnu_toolchain.git

In folder, delete README.md and install.sh

Change name folder to riscv_gap. Then copy it to /opt/

sudo cp -r riscv_gap /opt/

Open bashrc

nano .bashrc

Add command below to that file

export GAP_RISCV_GCC_TOOLCHAIN="/opt/riscv_gap"

Run this code to take effect

source .bashrc

Gap SDK installation

Open new terminal to install gap sdk

Clone gap sdk repository

git clone https://github.com/GreenWaves-Technologies/gap_sdk.git

cd gap_sdk

Our modules (gapy runner) require a few additional Python packages that you can install with this command from GAP SDK root folder:

pip3 install -r requirements.txt

pip3 install -r doc/requirements.txt

Invoke the command below and select board GAPUINO_V3

source sourceme.sh

Then build GVSOC

make gvsoc

When you’re asked to enter email in the first time, press Enter. Then fill out your information

Enter your first name: <your name>
Enter your last name: <your last name>
Enter your company name: <your school>
Enter your country: Viet Nam
Enter your email address: <your school email address>

Then you will receive an email with an url. Copy that url to Enter your email url:

Press arrow down to read the agreements. Then press y to agree and wait …..

From now then

Note

Must select board before run any project

You can either source sourceme.sh in the root sdk folder and then select the right board from the list, or directly source the board config.

source sourceme.sh

Can choose either board 3 or 4

After selecting the right board, go to project and run command below to build project

make clean all run platform=gvsoc

Run make help to get other commands

=================== GAP SDK ===================

Main targets:
- clean       : clean the SDK
- all         : build the whole SDK with all tools
- minimal     : get latest sources for all rtos and libs
- gvsoc       : build GVSOC simulation platform
- openocd.all : build OpenOCD tools to run simulation on boards
- nntool      : build nntool

Depends on what you need, build the SDK accordingly

make <target>

Example

Run helloworld example

cd gap_sdk/examples/gap8/basic/helloworld

make clean all run platform=gvsoc
../../_images/gaptesthello.png

Issues

make: Nothing to be done for ‘all’

Solution: sudo make clean

References

[1]. Gap toolchain installation precompile ubuntu 20

[2]. Gap sdk installation

[3]. Gap8 manual