Skip to content

Commit 0bfa305

Browse files
committed
Switch to new esp32ulp tool (binutils-gdb vs binutils-esp32ulp)
Espressif has switched from the binutils-esp32ulp repo (the original fork of binutils to support their microcontrollers) to their new repo binutils-gdb. (see espressif/esp-idf@a9bd454) The ESP-IDF also uses the esp32ulp assembler/linker from the new repo now. The main difference is that this is now the officially maintained implementation. The other difference is that there are now not different binaries for each esp32 variant, but one set of binaries. To select which esp32 variant to target, the esp32ulp-elf-as binary now accepts the --mcpu argument, for example --mcpu=esp32s2. The default is still the original esp32, so omitting the argument means one effected selected --mcpu=esp32. Note: Because Espressif provides pre-built binaries we are no longer building esp32ulp, but simply downloading the binaries and using those.
1 parent 05fdeb3 commit 0bfa305

File tree

1 file changed

+26
-20
lines changed

1 file changed

+26
-20
lines changed

.github/workflows/run_tests.yaml

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -40,25 +40,32 @@ jobs:
4040
test $(micropython -c 'print("test")') = "test"
4141
popd
4242
43-
- name: Build binutils-esp32ulp
44-
id: build_binutils
43+
- name: Fetch binutils-esp32ulp
44+
id: fetch_binutils
4545
run: |
46-
echo "Building binutils-esp32ulp"
47-
# building requires an older version of gcc
48-
sudo apt-get install -y gcc-7 g++-7
49-
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 7
50-
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 7
51-
git clone --depth 1 https://github.com/espressif/binutils-esp32ulp.git
52-
pushd binutils-esp32ulp
53-
git describe --always --tags
54-
./configure --target=esp32ulp-elf --prefix=$PWD/dist --disable-doc --disable-gdb --disable-libdecnumber --disable-readline --disable-sim
55-
echo "MAKEINFO = :" >> Makefile
56-
make
57-
make install-strip
58-
export PATH=$PATH:$PWD/dist/bin
59-
echo "bin_dir=$PWD/dist/bin" >> $GITHUB_OUTPUT
46+
echo "Fetching URL of pre-built esp32ulp-elf binaries"
47+
## URL to pre-built binaries is published in esp-idf
48+
IDFVER=v5.0.1
49+
curl -s \
50+
-o tools.json \
51+
https://raw.githubusercontent.com/espressif/esp-idf/$IDFVER/tools/tools.json
52+
URL=$(<tools.json jq -r '
53+
.tools[]
54+
| select(.name == "esp32ulp-elf").versions[]
55+
| select(.status == "recommended")
56+
| .["linux-amd64"]
57+
| .url
58+
// empty
59+
')
60+
61+
echo "Downloading esp32ulp-elf from $URL"
62+
curl -sL \
63+
-o /tmp/esp32ulp-elf.tar.gz \
64+
$URL
65+
tar xfvz /tmp/esp32ulp-elf.tar.gz esp32ulp-elf/bin
66+
export PATH=$PATH:$PWD/esp32ulp-elf/bin
67+
echo "bin_dir=$PWD/esp32ulp-elf/bin" >> $GITHUB_OUTPUT
6068
esp32ulp-elf-as --version | grep 'esp32ulp-elf' > /dev/null
61-
popd
6269
6370
###### Run tests ######
6471

@@ -73,15 +80,14 @@ jobs:
7380
id: compat_tests
7481
run: |
7582
export PATH=$PATH:${{ steps.build_micropython.outputs.bin_dir }}
76-
export PATH=$PATH:${{ steps.build_binutils.outputs.bin_dir }}
83+
export PATH=$PATH:${{ steps.fetch_binutils.outputs.bin_dir }}
7784
cd tests
7885
./01_compat_tests.sh
7986
8087
- name: Run compat tests with RTC macros
8188
id: compat_rtc_tests
8289
run: |
8390
export PATH=$PATH:${{ steps.build_micropython.outputs.bin_dir }}
84-
export PATH=$PATH:${{ steps.build_binutils.outputs.bin_dir }}
91+
export PATH=$PATH:${{ steps.fetch_binutils.outputs.bin_dir }}
8592
cd tests
86-
ln -s ../binutils-esp32ulp # already cloned earlier. reuse.
8793
./02_compat_rtc_tests.sh

0 commit comments

Comments
 (0)