ULP FSM assembly build support #39
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With embuild 0.28.1, this code is just "convenience", i.e. it can be coded outside of embuild itself, but it might be annoying to repeat this code block in all binary crates that need to build their own one for or two ULP FSM assembly files.
And the code block is not so trivial, and not so small either (250 LOCs).
Note that while the
ulp_fsmmodule is a sub-module ofespidf, it does not really require anything from theespidf"native" build facilities. I.e. it does not use cmake, nor does build the ESP-IDF.With that said:
esp-idf-sys- either with PIO or natively - basically access to the ULP GCC toolchain as well as various ESP-DIF include directoriesesp-idf-sys. However in that case, the user has to manually put (or supply a path var to) the Espressif GCC ULP toolchain, as well as a path to a valid ESP-IDF SDK. The latter is necessary because ULP assembly files can contain macros, which in turn use a very small, ulp-specific set of headers inside ESP-IDF. Primarily for easier access to the RTC registers on the chip, as the ULP might read/write data through them (as in RTC pins, ADC and RTC I2C).Here's a sample binary crate
build.rsfile, which utilizes this code: