Skip to content

Commit 6cd81a6

Browse files
committed
loaders/esp: add readme to document how to build the stubs
1 parent eeb0d52 commit 6cd81a6

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# ESP32 Stubs
2+
3+
These are small bits of code that run on the ESP32 to facilitate OpenOCD operation on the chip. The generated `.inc` files in these directories are included in the final `openocd` binary, but these `.inc` files need to be generated separately.
4+
5+
## Building Stubs
6+
7+
The stubs use a specific build of ESP-IDF. Look at at the `stub_flasher_image.h` file for the `ESP32*_STUB_BUILD_IDF_REV` comment to find the ESP-IDF SHA that you need to use to build the stub. The process for each chip (e.g. esp32, esp32s3, etc) is roughly the same, though the stubs may use different versions of IDF. The process is:
8+
9+
1. Download the git repo for the ESP-IDF version.
10+
```bash
11+
git clone https://github.com/espressif/esp-idf.git
12+
```
13+
14+
2. Checkout the right version of ESP-IDF based on the comment in `stub_flasher_image.h` for your target chip (e.g. `036bd3eb26` from `esp32s3/stub_flasher_image.h`)
15+
```bash
16+
cd esp-idf
17+
git checkout 036bd3eb26 # or whatever the SHA is
18+
git submodule update --init --recursive
19+
```
20+
21+
3. Set up the ESP-IDF environment
22+
```bash
23+
./install.sh
24+
source export.sh
25+
```
26+
27+
4. Go back to your `openocd-esp32` directory and build the stub for your target chip
28+
```bash
29+
cd ../openocd-esp32/contrib/loaders/flash/esp/esp32s3
30+
```
31+
32+
5. Build the stub
33+
```bash
34+
make
35+
```
36+
37+
6. Now you can go through the normal OpenOCD build process, and the stub will be included in the final binary.

0 commit comments

Comments
 (0)