Skip to content

Latest commit

 

History

History
79 lines (52 loc) · 3.54 KB

README.md

File metadata and controls

79 lines (52 loc) · 3.54 KB

Adamant Environment Setup

Below is the procedure for creating the Adamant build environment for the Example Project. Adamant requires quite a few dependencies. To make this easy to manage, a pre-built Docker image is provided to get you started with minimal fuss. This image is based on the Adamant base Docker image, but adds a few tools specific for the Raspberry Pi Pico.

Note, the following has been tested successfully on MacOS, Ubuntu Linux, and Windows with Git for Windows and WSL. If you cannot get things working on your machine, please submit an issue or a fix via pull request.

Creating the Environment

This procedure is used to create a new Docker container that hosts the Adamant build environment. This is only meant to be run once. If you have already created the container, proceed to the next section to start the container.

  1. Start by downloading Docker Desktop.
  2. Next, clone both the Adamant and Example repositories.
$ git clone https://github.com/lasp/adamant_example.git
$ git clone https://github.com/lasp/adamant.git
  1. Next, tell Docker to create a new container from the pre-built image. This make take a few minutes and ~3 GB of disk space. By default the container created is named adamant_example_container. To change this, or the image that the container uses, modify docker-compose.yml before running the commands below.
$ cd adamant_example/docker
$ ./adamant_env.sh start
  1. Finally, you can log into the container by running.
$ ./adamant_env.sh login

The first time you log in, the environment will be set up automatically. This can take a few minutes. Note that the adamant_example/ and adamant/ directories on your host will be shared with the new Docker container at ~/adamant_example/ and ~/adamant/. This allows you to modify files on your host and compile those same files on the container.

Starting and Stopping the Container

Once you have created a container using the section above, you can stop it by running.

$ ./adamant_env.sh stop

To start the container up again, run:

$ ./adamant_env.sh start

Running the Example Project

To build and run the example project (for Linux) we need to first log in to the container.

$ ./adamant_env.sh login

From within the container run:

user@1234$ cd ~/adamant_example/src/assembly/linux/main
user@1234$ redo run

Building the Docker Image from Scratch

The procedures above use the pre-built Docker image. You can recreate this image locally using the provided Dockerfile. If you have not already, clone the Example repository.

$ git clone https://github.com/lasp/adamant_example.git

Next, you can create the Docker image by running:

$ cd adamant_example/docker
$ ./adamant_env.sh build

This may take several minutes to complete. By default, the image created is named ghcr.io/lasp/adamant_example:latest. To change this, modify docker-compose.yml before running ./adamant_env.sh build.