Skip to content
This repository has been archived by the owner on Jul 3, 2024. It is now read-only.

feature: Remote Containers #593

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
FROM ubuntu:20.04

ARG USER

ARG TOOL_FOLDER

ENV TOOL_FOLDER ${TOOL_FOLDER:-/home/${USER}/sifive-tools}

RUN apt update
RUN export DEBIAN_FRONTEND=noninteractive && apt install -y locales sudo screen

ENV ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8

RUN export DEBIAN_FRONTEND=noninteractive \
&& apt install -y nano git bash-completion bc curl python3 python3-pip python3-venv

RUN useradd -m -s /bin/bash ${USER} \
&& passwd -d ${USER} \
&& usermod -aG sudo ${USER}

USER ${USER}

RUN mkdir ${TOOL_FOLDER}

RUN curl https://static.dev.sifive.com/dev-tools/riscv-openocd-0.10.0-2020.04.6-x86_64-linux-ubuntu14.tar.gz -o ${TOOL_FOLDER}/openocd.tar.gz \
&& tar -zxvf ${TOOL_FOLDER}/openocd.tar.gz -C ${TOOL_FOLDER} --one-top-level=openocd --strip-components=1

RUN curl https://static.dev.sifive.com/dev-tools/riscv64-unknown-elf-gcc-8.3.0-2020.04.0-x86_64-linux-ubuntu14.tar.gz -o ${TOOL_FOLDER}/gnu-tools.tar.gz \
&& tar -zxvf ${TOOL_FOLDER}/gnu-tools.tar.gz -C ${TOOL_FOLDER} --one-top-level=gnu-tools --strip-components=1

RUN curl https://static.dev.sifive.com/dev-tools/freedom-tools/v2020.08/riscv-qemu-5.1.0-2020.08.1-x86_64-linux-ubuntu14.tar.gz -o ${TOOL_FOLDER}/riscv-qemu.tar.gz \
&& tar -zxvf ${TOOL_FOLDER}/riscv-qemu.tar.gz -C ${TOOL_FOLDER} --one-top-level=riscv-qemu --strip-components=1

ENV RISCV_OPENOCD_PATH ${TOOL_FOLDER}/openocd
ENV RISCV_PATH ${TOOL_FOLDER}/gnu-tools

ENV PATH=$PATH:RISCV_OPENOCD_PATH/bin:${RISCV_PATH}/bin:${TOOL_FOLDER}/riscv-qemu/bin
25 changes: 25 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.158.0/containers/ubuntu
{
"name": "Ubuntu",
"build": {
"dockerfile": "Dockerfile",
"args": {
"USER": "${localEnv:USER}"
}
},

"runArgs": ["--privileged", "-v/dev/bus/usb:/dev/bus/usb"],

// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-vscode.cpptools"
],

"remoteUser": "${localEnv:USER}"
}
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,31 @@ make [PROGRAM=hello] [TARGET=sifive-hifive1] [INCLUDE_METAL_SOURCES=1] STANDALON

Run `make help` for more commands.

### Remote Container

You can use the remote container to do your programming your board.

The Remote Container would have all the required Software installed except the Segger Jlink Software (needed for sifive-revb).

You would have to get it from here: https://www.segger.com/downloads/jlink/JLink_Linux_x86_64.deb (Link is for debian based systems)

### Connect to Segger JLink devices using JLinkEXE ###

Run JlinkExe
```
JLinkExe
```

connect via USB:
```
usb
```

select device:
```
device [FE310]
```

### For More Information ###

Documentation, Forums, and much more available at
Expand Down