Skip to content

Commit 2c856b8

Browse files
committed
update - see revision.md
1 parent e4927d8 commit 2c856b8

33 files changed

+68
-361
lines changed

README.md

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,30 @@
1-
ulptool v2.0.0
1+
ulptool v2.1.0
22
==================
3-
4-
This guide explains how to setup Arduino to use ULP coprocessor assembly files for your esp32 projects using the preferred method of the board manager to install the esp32 core. **The old method of manually installing the esp32 core is no longer supported**. Currently the how-to is only geared for MacOS and has not been tested with Windows or Linux at this time. Python 2.7 is required and python3 will not currently work. Being beta many things could go wrong so let me know if you encounter any issues.
3+
This guide explains how to setup Arduino to use ULP coprocessor assembly files for your esp32 projects. This guide assumes you installed the esp32 core with the preferred method of the board manager.
54

65
Typically in Arduino you can compile assembly files using the '.S' extension. Using the ESP32 Arduino core framework these files would correspond to the Xtensa processors whose toolchain is incompatible with the ULP coprocessor. Luckily, Arduino provides a fairly easy albeit not that flexible build framework using series of recipes. This guide extends those esp32 recipes for building the ULP assembly files. We will use the '.s' extensions for ULP assembly files which Arduino will let you create. Remember thats a lower case 's'. I tried to keep the ulp build process the same as the esp-if framework with only a few small modifications the user needs to do in order to compile in Arduino.
76

8-
Setup Steps:
7+
Manual Setup Steps:
98
============
10-
1. Download the latest release of this repository and unpack-> 'arduino_ulp'. https://github.com/duff2013/arduino_ulp/releases/latest
9+
1. Download the latest release of this repository and unpack-> 'ulptool'. https://github.com/duff2013/ulptool/releases/latest
1110

12-
2. Download the latest pre-compiled binutils-esp32ulp toolchain for Mac/Linux/Windows: https://github.com/espressif/binutils-esp32ulp/releases/latest
11+
2. Download and unpack the latest pre-compiled binutils-esp32ulp toolchain for Mac/Linux/Windows: https://github.com/espressif/binutils-esp32ulp/releases/latest
1312

14-
3. Find your Arduino-esp32 core directory which Arduino IDE uses:
13+
3. Find your Arduino-esp32 core directory which Arduino IDE uses:
1514

1615
Typically (Mac OS) -> ~/Library/Arduino15/packages/esp32
17-
16+
1817
Typically (Windows) -> C:\Users\<USERNAME>\AppData\Local\Arduino15\packages\esp32
19-
18+
2019
Typically (Linux) ->?
21-
4. In the 'arduino_ulp' release you downloaded and unpacked, copy the folder 'ulp' to **.../esp32/hardware/esp32/1.0.0/tools/sdk/include/** replacing the existing folder named 'ulp', "1.0.0" is the version number of the core you installed, change version number accordingly.
2220

23-
5. In the 'arduino_ulp' repository folder you downloaded and unpacked, copy the file 'platform.txt' to **.../esp32/hardware/esp32/1.0.0/** replacing the one you have. If you want, just remain the old "platform.txt" so you can revert back. Remember "1.0.0" has to match your version.
21+
4. Move the **ulptool** folder you downloaded and unpacked to the tools folder here -> **.../esp32/tools/**.
2422

25-
6. In the 'arduino_ulp' release you downloaded, copy the 'ulp_example' folder to where Arduino saves your sketches.
23+
5. Copy the 'platform.local.txt' file to **.../esp32/hardware/esp32/1.0.0/**. Remember **1.0.0** has to match your esp32 core version.
2624

27-
7. Create a new folder named exactly 'binutils' in directory **.../esp32/tools/**
25+
6. In the **ulptool** release you downloaded, move or copy the **.../esp32/tools/ulptool/src/ulp_examples** folder to where Arduino saves your sketches.
2826

29-
8. Unpack and copy the folder of the pre-compiled binutils-esp32ulp toolchain you downloaded to **.../esp32/tools/binutils/**
27+
7. Move **esp32ulp-elf-binutils** folder you downloaded and unpacked to -> **.../esp32/tools/ulptool/src/**.
3028

3129
Thats it, you now have all the files in place, lets look at very simple example to get you compiling ulp assembly code!
3230

@@ -80,7 +78,7 @@ count:
8078
.global entry
8179
entry:
8280
move r3, count
83-
ld r0, r3, 0
81+
ld r0, r3, 0
8482
add r0, r0, 1
8583
st r0, r3, 0
8684
halt

platform.local.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
version=1.0.1
2+
3+
## paths
4+
compiler.ulp.path={runtime.tools.ulptool.path}/esp32ulp-elf-binutils/bin/
5+
tools.ulptool.path={runtime.tools.ulptool.path}/
6+
7+
## tool name
8+
tools.ulptool.cmd=esp32ulp_build_recipe.py
9+
10+
## ulp build tool
11+
compiler.s.cmd=python "{tools.ulptool.path}{tools.ulptool.cmd}"
12+
13+
## ulp_main.ld file address
14+
compiler.c.elf.extra_flags="-L{build.path}/sketch/" -T ulp_main.ld "{build.path}/sketch/ulp_main.bin.bin.o"
15+
16+
## Compile s (ulp) files
17+
recipe.hooks.core.postbuild.01.pattern={compiler.s.cmd} {compiler.cpreprocessor.flags} -b {build.path} -p {runtime.platform.path} -u {compiler.ulp.path} -x {compiler.path} -t {tools.ulptool.path} --DF_CPU={build.f_cpu} --DARDUINO={runtime.ide.version} --DARDUINO_={build.board} --DARDUINO_ARCH_={build.arch} --DARDUINO_BOARD="{build.board}" --DARDUINO_VARIANT="{build.variant}"

platform.txt

Lines changed: 0 additions & 117 deletions
This file was deleted.

revisions.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
><b>Updated (2/5/19 v2.1.0)</b><br>
2+
* Now compiles for archived cores. i.e esp32 cores v1.0.0 and v1.0.1<br>
3+
* Changed install procedure, hopefully easier.<br>
4+
* Now use platform.local.txt, no need for user to edit platform.txt anymore.<br>
5+
* Cleaned up prints in Windows<br>
6+
17
><b>Updated (1/8/19 v2.0.0)</b><br>
28
* Updated to use the esp32 core installed by the Arduino board manager now since its the preferred way to install now.<br>
39
File renamed without changes.

0 commit comments

Comments
 (0)