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.
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