You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NOTE: the below instructions are for Jade developers with access to Jade development boards or for those wanting to build and flash their own esp32 consumer devices - eg. M5Stack or TTGO T-Display boards.
4
-
They are not for updating the firmware of an official Blockstream Jade hw unit - these can only be updated in-app, or using the 'update_jade_fw.py' script - see FWUPDATE.md
3
+
NOTE: The below instructions are for Jade developers with access to Jade development boards or for those wanting to build and flash their own esp32/esp32s3 consumer devices - e.g. M5Stack or TTGO T-Display boards.
4
+
They are not for updating the firmware of an official Blockstream Jade HW unit - these can only be updated in-app, or using the 'update_jade_fw.py' script - see FWUPDATE.md
5
5
6
6
* DO NOT ATTEMPT THE BELOW WITH BLOCKSTREAM OFFICIAL BLOCKSTREAM JADE HW UNITS
7
7
8
-
To build you can use the docker image (see Dockerfile) or install the esp-idf toolchain and repo following the commands in this readme.
8
+
To build you can use the docker image (see Dockerfile) or install the esp-idf toolchain and repository following the commands below.
9
9
10
10
# DIY Hardware & Programming Notes
11
-
For information about suitable DIY hardware, as well as suggested configuration profiles and notes on secure boot.
12
-
[DIY Guide](./diy/)
11
+
For information about suitable DIY hardware, as well as suggested configuration profiles and notes on secure boot,
12
+
see [DIY Guide](./diy/)
13
13
14
-
# Use docker
14
+
# Build dependencies
15
15
16
-
If you are on MacOS, you are better off setting up the environment locally (see next step) than trying to get access to your device from the docker container. For more, see [this article](https://dev.to/rubberduck/using-usb-with-docker-for-mac-3fdd).
16
+
Cmake and ninja are needed to build the firmware.
17
17
18
-
Note the supplied docker-compose.yml assumes the Jade device is at /dev/ttyUSB0, but note that it may instead be /dev/ttyACM0 (or either with some other trailing number) or some other path as appropriate for the host operating system.
18
+
On Debian based distributions, install with with:
19
19
20
-
Note the below instructions assume an original Jade v1.0 hardware with a true wheel.
21
-
When using the later Jade v1.1 hw revision with a rocker/jog-wheel, use 'configs/sdkconfig_jade_v1_1.defaults' in place of 'configs/sdkconfig_jade.defaults'.
Set up the idf environmental and make the `idf.py` command available:
49
52
50
53
```
51
54
. $HOME/esp/esp-idf/export.sh
52
55
```
53
56
54
-
On MacOS: You will need cmake and ninja on your system for this step (`brew install cmake ninja`).
57
+
# Devices
55
58
56
-
If you encounter Python dependencies issue, make sure to use a recent Python version (e.g. Python 3.11) as the current system version which is used by the install script.
57
-
58
-
# Build dependencies
59
+
There are currently three Jade device targets:
60
+
- jade: The original Jade 1.0 with a selection wheel.
61
+
- jade_v1_1: Jade 1.1, which has a rocker/jog-wheel in place of the selection wheel.
62
+
- jade_v2: Jade Plus, with a larger screen and left/right selection buttons in place of a wheel or rocker.
59
63
60
-
Cmake and ninja are needed to build the firmware, you can install them on debian based distros with:
61
-
62
-
```
63
-
sudo apt install cmake ninja-build
64
-
```
64
+
Change `jade` in any calls to the `switch_to.sh` script below to the
65
+
appropriate device you wish to target from the list above.
65
66
66
67
# Serial port
67
68
68
-
In order to have permissions using serial port to load firmware, your user should be in `dialout` group on debian
69
-
based distros, other distros can use a different group name, you can figure out by checking the group of the serial
70
-
port 'file' using `ls -l` command:
69
+
The serial port pseudo-tty file for Jade access via USB is usually `/dev/ttyACM0` or `/dev/ttyUSB0`, or `/dev/cu.SLAB_USBtoUART` on MacOS. Note that the supplied docker-compose.yml assumes the Jade device is at /dev/ttyUSB0.
71
70
72
-
(serial port is usually `/dev/ttyACM0` or `/dev/ttyUSB0`)
71
+
In order to have permission to use USB to install firmware, your user should be in `dialout` group on Debian
72
+
based distributions. Other distributions may use a different group name: Check the group of the serial
73
+
port pseudo-tty file using `ls -l` command to determine the required group, e.g:
If you flash multiple devices or make changes to the original config file that you used, make sure to delete the `sdkconfig` file that gets created from `sdkconfig.defaults`. Otherwise, your changes will not get picked up when building and re-flashing the firmware.
124
+
To build the firmware, run:
125
+
126
+
```
127
+
idf.py all
128
+
```
129
+
130
+
To flash the resulting build to your device, run:
111
131
112
-
Some hardware configurations (eg: M5StickC-Plus) may not support the default baud rate and won't be detected, so you can force a specific baud rate for flash/monitor by using the `-b` argument.
132
+
```
133
+
idf.py flash [monitor]
134
+
```
135
+
136
+
Some hardware configurations (e.g. M5StickC-Plus) may not support the default baud
137
+
rate and so won't be detected. If this occurs you can force a specific baud rate
138
+
for flash/monitor by using the `-b` argument, e.g:
113
139
114
-
_For example, the last line of the above code block would change be:_
115
140
```
116
141
idf.py -b 115200 flash monitor
117
142
```
118
143
119
-
# Build configurations
144
+
If you have errors relating to unknown bytes when flashing, place your device
145
+
into download mode. This is device specific, for Jade development devices,
146
+
turn off the device, then hold the select and power buttons for 10 seconds.
147
+
Note the device screen will stay blank when in download mode.
148
+
149
+
If you switch between JTAG and non-JTAG builds in particular, you will need to
150
+
flash from download mode.
120
151
121
-
There are various build configurations used by the CI in the configs/ directory, which may be required for specific builds eg. without BLE radio, with the screen enabled (or disabled, as with the CI tests), or for specific hardware (eg. the m5-fire).
152
+
If you flash multiple device types, or make changes to the sdkconfig.config file,
153
+
delete the `sdkconfig` file that gets created from `sdkconfig.defaults` between
154
+
builds. Otherwise, your changes will not get picked up when re-building/flashing
155
+
the firmware.
122
156
123
-
The menuconfig tool can also be used to adjust the build settings.
157
+
# Build customization
158
+
159
+
Beyond the build configurations in the `configs/` directory, you can edit the config
160
+
manually with the `menuconfig` tool:
124
161
125
162
```
126
163
idf.py menuconfig
127
164
```
165
+
128
166
Note: for any but the simplest CI-like build with no GUI, no camera, no user-interaction etc. it is recommended that PSRAM is available and enabled. ( Component Config -> ESP-32 specific -> Support external SPI connected RAM )
129
167
130
168
# Run the tests
131
169
132
-
Virtualenv and bluez-tools are required, you can install them on debian based distros with:
170
+
Virtualenv and bluez-tools are required, you can install them on Debian based distributions with:
133
171
134
172
```
135
173
sudo apt install virtualenv bluez-tools
@@ -149,51 +187,83 @@ python test_jade.py
149
187
deactivate
150
188
```
151
189
190
+
Note that the tests require a CI build; this is a configuration that automatically
191
+
accepts the default action without requiring user interaction. This is enabled using
192
+
the `--ci` argument to `switch_to.sh` or by setting `CONFIG_DEBUG_UNATTENDED_CI=y`
193
+
in sdkconfig.defaults.
194
+
195
+
Debug support is also required to expose debug functions for testing. Use `--debug`
196
+
or set `CONFIG_DEBUG_MODE=y` to enable this.
197
+
198
+
# Use docker
199
+
200
+
If you are on MacOS, you are better off setting up the environment locally as detailed above, rather than trying to get access to your device from the docker container. For more, see [this article](https://dev.to/rubberduck/using-usb-with-docker-for-mac-3fdd).
201
+
202
+
The supplied docker-compose.yml assumes the Jade device is at /dev/ttyUSB0, but note that it may instead be e.g. /dev/ttyACM0 (or have another numeric suffix or path depending on the host operating system).
203
+
204
+
The build steps within docker are the same as detailed above, e.g:
docker run --rm -p 30121:30121 -p 30122:30122 -it jade-qemu-web
168
238
```
169
239
170
-
Alternatively, to run the qemu emulator with display and camera support is to run
240
+
Alternatively, to run the qemu emulator with display and camera support, run:
241
+
171
242
```
172
-
main/qemu/run_emulator.sh
243
+
main/qemu/run_emulator.sh [--larger-display]
173
244
```
174
245
175
-
Then you will be able to open the browser and point it to 'http://localhost:30122' to interface with the emulated Jade.
246
+
Open a web browser and point it to 'http://localhost:30122' to interface with the emulated Jade.
176
247
177
248
Note that the ```run_emulator.sh``` command will launch a docker image so it will only work on Linux.
178
-
You can also optionally pass the flag ```--larger-display``` to run the emulator with a bigger display.
179
249
180
250
Otherwise if you don't need the display or want to run with gdb, follow the below steps.
181
251
182
-
Run these commands inside the jade source repo root directory, it will enter a docker container:
252
+
Run these commands inside the jade source repository root directory to enter a docker container:
183
253
184
254
```
185
255
DOCKER_BUILDKIT=1 docker build . -t testjadeqemu
186
256
docker run -v ${PWD}:/jade -p 30121:30121 -it testjadeqemu bash
187
257
```
188
258
189
-
Note: You can skip the build step if you want by fetching the prebuilt image and running with
259
+
Note: You can skip the build step if you want by fetching the pre-built image and running with
190
260
191
261
```
192
262
docker pull blockstream/verde
193
263
docker run -v ${PWD}:/jade -p 30121:30121 -it blockstream/verde bash
194
264
```
195
265
196
-
Now inside the container
266
+
Inside the container, run:
197
267
198
268
```
199
269
. /root/esp/esp-idf/export.sh
@@ -227,16 +297,22 @@ See [REPRODUCIBLE.md](./REPRODUCIBLE.md) for instructions on locally reproducing
227
297
228
298
# DIY
229
299
230
-
Seen working on M5 Stack gray/black/FIRE, M5 Stick Plus, Core 2, Core S3, LilyGO T-Display, T-DisplayS3, RPI Zero + display shield (via QEMU), Desktop via Qemu (browser for display/webcam)
300
+
Seen working on M5 Stack gray/black/FIRE, M5 Stick Plus, Core 2, Core S3, LilyGO T-Display, T-DisplayS3, RPI Zero + display shield (via QEMU), and Desktop via Qemu (browser for display/webcam).
231
301
232
302
# Client
233
303
234
-
A python client is available to communicate with genuine or diy Jade units:
304
+
A python client is available to communicate with genuine or DIY Jade units:
305
+
235
306
```
236
307
pip install jade-client
237
308
```
238
-
This installs the `jadepy` directory from this repo. See [jade-client-requirements.txt](./jade-client-requirements.txt) and [jade-client-requirements.txt.asc](./jade-client-requirements.txt.asc)
309
+
310
+
This installs the `jadepy` directory from this repository. See [jade-client-requirements.txt](./jade-client-requirements.txt) and [jade-client-requirements.txt.asc](./jade-client-requirements.txt.asc)
311
+
312
+
# Firmware development
313
+
314
+
See [libjade](./libjade/README.md) For a local build setup that allows for initial feature development and debugging off-device.
239
315
240
316
# License
241
317
242
-
The collection is subject to gpl3 but individual source components can be used under their specific licenses.
318
+
The collection is subject to GPL3 but individual source components can be used under their specific licenses.
0 commit comments