Skip to content

Commit 5c47f4f

Browse files
committed
Docker docs updates
1 parent ed81c4f commit 5c47f4f

File tree

3 files changed

+35
-3
lines changed

3 files changed

+35
-3
lines changed

docs/firmware_compile.md

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Fork a copy of RTK Everywhere
5757
</figcaption>
5858
</figure>
5959

60-
Clone your fork to your local machine, make changes, and send us a Pull Request. This is exactly what the SparkFun Team do when developing the code.
60+
Clone your fork to your local machine, make changes, and send us a Pull Request. This is exactly what the SparkFun Team do when developing the code. Please use the `release_candidate` branch for any such changes. We are very unlikely to merge anything directly into `main`, unless it is (e.g.) docs corrections or improvements.
6161

6262
If you don't want to do either of those, you can simply Download a Zip copy of the repo instead. You will receive a complete copy as a Zip file. You can do this from the green **Code** button, or click on the icon below to download a copy of the main (released) branch:
6363

@@ -67,7 +67,7 @@ For the real Wild West experience, you can also download a copy of the `release_
6767

6868
[![Download ZIP - release candidate](./img/CompileSource/Download_Zip.png)](https://github.com/sparkfun/SparkFun_RTK_Everywhere_Firmware/archive/refs/heads/release_candidate.zip "Download ZIP (release_candidate branch)")
6969

70-
### Running the Dockerfile to compile the firmware
70+
### Running the Dockerfile to create an Image
7171

7272
* Make sure you have Docker Desktop running
7373
* Open a Command Prompt and `cd` into the SparkFun_RTK_Everywhere_Firmware folder
@@ -107,12 +107,44 @@ docker build -t rtk_everywhere_firmware .
107107
docker build -t rtk_everywhere_firmware --progress=plain .
108108
```
109109

110-
* If you rebuild completely from scratch, use:
110+
* If you rebuild the image completely from scratch, without using the cache, use:
111111

112112
```
113113
docker build -t rtk_everywhere_firmware --progress=plain --no-cache .
114114
```
115115

116+
### Compile the firmware by running the Image
117+
118+
In Docker Desktop, in the Images tab, you should now be able to see an Image named `rtk_everywhere_firmware`. We now need to Run that image to compile the firmware. Click the triangular Run icon under Actions.
119+
120+
![Docker image ready to run](./img/CompileSource/Docker_Image.png)
121+
122+
Running the Image will create a Container for the arduino-cli code compilation. The Container name is random, because we didn't define one in the **Optional settings**. It is running the final line of the Dockerfile `CMD arduino-cli compile ...`. Let it run. As the compilation progresses, you will see messages appear in the Logs tab. When the compilation is complete, the Container will stop and you should see:
123+
124+
![Container code compilation is complete](./img/CompileSource/Container_compilation_complete.png)
125+
126+
You can recompile your code at any time by running the image again. (You don't need to recreate the image each time - unless you've changed the Dockerfile.)
127+
128+
Make a note of the container name. We will need it to extract the firmware binary from the container. In the above screenshot, the container is called **reverent_jackson**
129+
130+
In the Command Prompt, type the following (replace **reverent_jackson** with your container name):
131+
132+
```
133+
docker cp reverent_jackson:/work/RTK_Everywhere/build/esp32.esp32.esp32/RTK_Everywhere.ino.bin .
134+
```
135+
136+
Hey presto! A file called `RTK_Everywhere.ino.bin` appears in the current directory. That's the firmware binary we are going to upload to the ESP32.
137+
138+
If the need the `.elf` file so you can debug code crashes with me-no-dev's [ESP ExceptionDecoder](https://github.com/me-no-dev/EspExceptionDecoder):
139+
140+
```
141+
docker cp reverent_jackson:/work/RTK_Everywhere/build/esp32.esp32.esp32/RTK_Everywhere.ino.elf .
142+
```
143+
144+
If you want the files to appear in a more convenient directory, replace the single `.` with a folder path.
145+
146+
The Container compilation is fast, taking around 2 minutes 20 seconds for a full compile. Running the same `arduino-cli compile` command directly in a Command Prompt takes around 3 minutes.
147+
116148
## Compiling on Windows (Deprecated)
117149

118150
The SparkFun RTK Everywhere Firmware is compiled using Arduino CLI (currently [v1.0.4](https://github.com/arduino/arduino-cli/releases)). To compile:
135 KB
Loading
108 KB
Loading

0 commit comments

Comments
 (0)