Skip to content

Latest commit

 

History

History
246 lines (187 loc) · 10.1 KB

README.md

File metadata and controls

246 lines (187 loc) · 10.1 KB

ulptool-pio

This is a fork of duff2013/ulptool, with a thin and ugly wrapper for PlatformIO.

Since, as of writing this, PIO does not support ESP32 ULP under framework=arduino (issue), I wrote this wrapper which integrates ulptool into PIO's build pipelines.

PRs are welcome.

Install

To use this wrapper in your PIO project, first add the following lines into your platformio.ini.

lib_deps =
  https://github.com/likeablob/ulptool-pio

extra_scripts =
  pre:/$PROJECT_LIBDEPS_DIR/$PIOENV/ulptool-pio/pre_extra_script_ulptool.py
  post:/$PROJECT_LIBDEPS_DIR/$PIOENV/ulptool-pio/post_extra_script_ulptool.py

Then put your ULP asm *.s (Note it's not *.S) into ulp/. You can even use *.c thanks to ulpcc. See the original doc below for details.
There are also a couple of example PIO projects available under ./examples.

$ mkdir ulp
$ code ulp/my_ulp_code.s

Finally build the project twice. The first run is for letting PIO to fetch the dependency and will be ended in failure because of missing extra_scripts. But you can safely ignore the errors. The subsequent runs will be fine.

$ pio run || pio run

That's it. Have a fun! :D

$ pio run -t upload

Thoughts and ideas

  • Talking about the other options, it's possible to use ULP with framework=espidf. The framework also has the Arduino-compat layer. (see