Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docker build instructions #252

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
22 changes: 22 additions & 0 deletions src/nrf52840/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,28 @@ After a successful build, the `elf` files can be found in `<path-to-ot-nrf528xx>
$ arm-none-eabi-objcopy -O ihex build/bin/ot-cli-ftd ot-cli-ftd.hex
```

### Building using Docker

Alternatively, you can build using a Docker image instead of nRF Command Line Tools.

This can be useful in case of CI/CD builds or to build locally without installing the dependencies.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is CI/CD in this case? Do the abbreviations need to be opened?

Are there downsides? For example, is the user foregoing all the support options (USB CDC ACM support, Bootloader support, and so on)?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant to say when building in a pipeline in the cloud, most of the time the build agent will run some generic OS and the build agent can be instructed to run our pipeline script in a specific container image.

In this case, building through the docker image can help better control the build environment over time and give better odds of a build not failing if the cloud provider updates the VM environment.

I don't know of any downsides but my tests were limited to the sample build I provided as an example in the PR description.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, that sounds good and doesn't necessitate any more clarification, I think.


Example for the nRF52840 dongle:

```bash
cd <path-to-ot-nrf528xx>
docker run --rm -u $(id -u):$(id -g) -v $(pwd):/workdir/project coderbyheart/fw-nrfconnect-nrf-docker:v1.8-branch ./script/build nrf52840 USB_trans -DOT_BOOTLOADER=USB -DOT_THREAD_VERSION=1.2
```

After a successful build, the `elf` files can be converted through the same container image.

For example:

```bash
cd <path-to-ot-nrf528xx>
docker run --rm -u $(id -u):$(id -g) -v $(pwd):/workdir/project coderbyheart/fw-nrfconnect-nrf-docker:v1.8-branch arm-none-eabi-objcopy -O ihex build/bin/ot-rcp build/bin/ot-rcp.hex
```

### USB CDC ACM support

You can build the libraries with support for the native USB CDC ACM as a serial transport. To do so, build the firmware with the following parameter:
Expand Down