Skip to content

Commit

Permalink
update - see revision.md
Browse files Browse the repository at this point in the history
  • Loading branch information
duff2013 committed Feb 8, 2019
1 parent 5239b5a commit 6105971
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ulptool v2.1.0
ulptool v2.2.0
==================
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.

Expand Down
4 changes: 2 additions & 2 deletions platform.local.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version=1.0.1
version=2.1.0

## paths
compiler.ulp.path={runtime.tools.ulptool.path}/esp32ulp-elf-binutils/bin/
Expand All @@ -14,4 +14,4 @@ compiler.s.cmd=python "{tools.ulptool.path}{tools.ulptool.cmd}"
compiler.c.elf.extra_flags="-L{build.path}/sketch/" -T ulp_main.ld "{build.path}/sketch/ulp_main.bin.bin.o"

## Compile s (ulp) files
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}"
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}"
5 changes: 5 additions & 0 deletions revisions.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
><b>Updated (2/8/19 v2.2.0)</b><br>
* Fixed compiling of non ulp projects.<br>
* Changed example file name from README.ino to ulp_README.ino.<br>
* All files versions numbers match the global version now.<br>
><b>Updated (2/5/19 v2.1.0)</b><br>
* Now compiles for archived cores. i.e esp32 cores v1.0.0 and v1.0.1<br>
* Changed install procedure, hopefully easier.<br>
Expand Down
18 changes: 12 additions & 6 deletions src/esp32ulp_build_recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.

# version 2.1.2
# version 2.2.0
import os
import sys
import glob
Expand Down Expand Up @@ -89,14 +89,19 @@ def main(argv):

if not ulp_files:
sys.stdout.write('No ULP Assembly File(s) Detected...\r')
with open('ulp_main.ld',"w") as fld:
fld.close()
try:
with open('tmp.s',"w") as ulp: pass
ulp_files.append('tmp.s')
build_ulp(bpath, ppath, xpath, upath, tpath, ulp_files, board_options, False)
os.remove('tmp.s')
except Exception as e:
print e
else:
build_ulp(bpath, ppath, xpath, upath, tpath, ulp_files, board_options)
build_ulp(bpath, ppath, xpath, upath, tpath, ulp_files, board_options, True)
sys.exit(0)


def build_ulp(build_path, platform_path, xtensa_path, ulp_path, tool_path, ulp_sfiles, board_options):
def build_ulp(build_path, platform_path, xtensa_path, ulp_path, tool_path, ulp_sfiles, board_options, has_s_file):
console_string = 'ULP Assembly File(s) Detected: ' + ', '.join(ulp_sfiles) + '\r'

cmds = gen_cmds(os.path.join(platform_path, 'tools'))
Expand Down Expand Up @@ -189,7 +194,8 @@ def build_ulp(build_path, platform_path, xtensa_path, ulp_path, tool_path, ulp_s
console_string += cmd[0] + '\r'

## print outputs or errors to the console
print console_string
if has_s_file:
print console_string

return 0

Expand Down
File renamed without changes.

0 comments on commit 6105971

Please sign in to comment.