Page 1 of 1

ESP-IDF v3.3 Doesn't seem to work with ULP

Posted: Mon Sep 09, 2019 6:12 am
by wevets
Hi,
I’ve been trying to get a ULP project running for a while and have failed to get a build to get past the ULP assemply step.
So I cloned one of the examples on github, at https://github.com/krzychb/ulp-loop. This sample does not require any external hardware so I thought it would be the ideal sample to test my build setup. I would have expected it to build without error. I installed ESP-IDF v3.3 a few days ago after it was labeled ‘stable’ as well at the ULP build tools, v2.28.51-esp-20190801 (which I’m guessing was released on 9/1/2019, which would make it about a week old), set up the PATH and COMPONENT_PATH environment variables to point to the right directories etc. That turned out to be a problem as many if not all the tools in that ULP tools update had new file names. For instance, ‘esp32ulp-elf-as.exe’ was now ‘esp32s2ulp-elf-as.exe’. Necessary files were not found with the new file names. It’s nice to see you planning for the new chip, but this update just does not work with the idf v3.3 tools. The error messages are pretty weird too. So I installed the previous release of ULP tools, and the only other one I could find on githum, v2.28.51-esp32ulp-20180809 with the expectation that all would be well.
Without modifying krzychb’s ulp-loop or its make files in any way, It fails to build in exactly the same way with exactly the same error messages as my project. (My main component in C, consisting of several files but without ULP hooks, compiles and runs without error.)
Below are excerpts from a log of my build run with https://github.com/krzychb/ulp-loop. This time the build failed in a new way at the same place.

After running ‘make menuconfig’, I get:

Code: Select all

GENCONFIG
/bin/sh: esp32ulp-elf-as: command not found
Building ULP app ulp_main
ULP assembler version:
WARNING: ULP assembler version  is not supported.
Expected to see version: 2.28.51.20170517
Please check ESP-IDF ULP setup instructions and update the toolchain, or proceed at your own risk.
App "ulp-example" version: 67e0e1e
I cannot find a /bin/sh directory anywhere in the msys32 directory tree with the ESP_IDF and ULP tool chains installed per directions. Further, there is a warning that assembler version 2.28.51.20170517 was expected, a version more than a year older than oldest version that I can find on github.
When I continue the build to see what will happen, I get:

Code: Select all

$ make app
Toolchain path: /opt/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc
Toolchain version: crosstool-ng-1.22.0-80-g6c4433a5
Compiler version: 5.2.0
CC build/app_trace/app_trace.o
CC build/app_trace/host_file_io.o
.
. a lot more apparently successful compiles… until...
.

Code: Select all

CC build/lwip/port/esp32/netif/wlanif.o
CC build/lwip/port/esp32/debug/lwip_debug.o
AR build/lwip/liblwip.a
/bin/sh: esp32ulp-elf-as: command not found
Building ULP app ulp_main
ULP assembler version:
WARNING: ULP assembler version  is not supported.
Expected to see version: 2.28.51.20170517
Please check ESP-IDF ULP setup instructions and update the toolchain, or proceed at your own risk.
CPP main/ulp/loop_blink.S
ULP_AS build/main/loop_blink.ulp.o
make[1]: esp32ulp-elf-as: Command not found
make[1]: *** [/home/Steve/esp/esp-idf/components/ulp/component_ulp_common.mk:54: loop_blink.ulp.o] Error 127
make: *** [c:/msys32/home/Steve/esp/esp-idf/make/project.mk:552: component-main-build] Error 2
The call to esp32ulp-elf-as looks like the call to assemble the ULP component, and esp32ulp-elf-as.exe is not found. Could that also be the result of changes in file names or directory structure from the previous 2017 version of the ULP build tools? It appears that making sure that the ULP capability fell through the cracks in the release of the stable v3.3. Or am I doing something wrong. I would expect that a ULP example on github would build and run without error, so it's quite possible that, being new to this, I've missed something along the way. If so, can you shed some light on this for me?

Re: ESP-IDF v3.3 Doesn't seem to work with ULP

Posted: Mon Sep 09, 2019 7:08 am
by WiFive
esp32ulp and esp32s2ulp are two different toolchains for two different chips. Make sure you download esp32ulp and add the path to the bin/ directory of the toolchain to the PATH environment variable

Re: ESP-IDF v3.3 Doesn't seem to work with ULP

Posted: Mon Sep 09, 2019 4:18 pm
by wevets
Please read my full post. I explain that I've done all that you suggest already. I'm using v2.28.51-esp32ulp-20180809. Interestingly, the instructions on setting up the ULP in the "read the docs" for v3.3 stable (https://docs.espressif.com/projects/esp ... s/ulp.html) say to download the latest version of the ULP tools, which comes up as v2.28.51-esp-20190801, but as you mention, this provides ULP support for the ESP32s2. I followed the directions verbatim, including adding the path to the ULP tool set bin directory as called for in the directions, and got no joy.
I worked through that.
The only other set of ULP tools that I can find is v2.28.51-esp32ulp-20180809, seemingly a year older and which I then expected to work. However, the warnings I got during my next build attempt, say this version is not supported, pointing instead to a tool set apparently released in 2017.
Again, please read my full post with the error messages. They are cut-and-paste from my build log.

Re: ESP-IDF v3.3 Doesn't seem to work with ULP

Posted: Mon Sep 09, 2019 7:28 pm
by WiFive
toolchains.png
toolchains.png (222.15 KiB) Viewed 7078 times
If it is in path it shouldn't say

Code: Select all

esp32ulp-elf-as: command not found
what is value of PATH?

Re: ESP-IDF v3.3 Doesn't seem to work with ULP

Posted: Mon Sep 09, 2019 8:46 pm
by wevets
Thank you for the correction. I wondered about the two zip files, but missed that one included 's2' in the title while the other didn't. I downloaded and installed the correct file... and got exactly the same result.
As you suggested, I checked where I add the path to the ULP tool set, and I've got that right, as verified when I run 'echo $PATH'.

Then I wondered about the warning and the final abort message:

Code: Select all

WARNING: ULP assembler version  is not supported.
Expected to see version: 2.28.51.20170517
Please check ESP-IDF ULP setup instructions and update the toolchain, or proceed at your own risk.
CPP main/ulp/loop_blink.S
ULP_AS build/main/loop_blink.ulp.o
make[1]: esp32ulp-elf-as: Command not found
make[1]: *** [/home/Steve/esp/esp-idf/components/ulp/component_ulp_common.mk:54: loop_blink.ulp.o] Error 127
make: *** [c:/msys32/home/Steve/esp/esp-idf/make/project.mk:552: component-main-build] Error 2
I wondered where the error message saying that neither of the ULP tool sets currently available on github were supported. (I've tried them both) So, thinking that 20170517 was a pretty rare number, just for grins I grep'ed for it from the 'esp' directory above 'esp-idf' and got:

Code: Select all

Steve@SteveDesktop01 MINGW32 ~/esp
$ grep -r "20170517"
esp-idf/components/expat/expat/testdata/largefiles/wordnet_glossary-20010201.rdf:<rdf:Description rdf:about="&a;201705170"
esp-idf/components/ulp/toolchain_ulp_version.mk:SUPPORTED_ULP_ASSEMBLER_VERSION = 2.28.51.20170517
Could it be that some older version of the ULP make support somehow got into the v3.3 stable release and is causing my assemblies to belch? (The compiles go just fine.)

Re: ESP-IDF v3.3 Doesn't seem to work with ULP - Bug in ESP-IDF v3.3

Posted: Mon Sep 09, 2019 11:38 pm
by wevets
At the end of my last post, I speculated that the ULP make system in esp-idf v3.3 wasn't working, although I always keep in mind that it might be something I missed or am doing wrong.

I did some grepping and guessing based on the error and abort messages I was seeing when I tried to build a sample ULP app I pulled from github on v3.3 that should have built without error. The make system said it expected to see and supported only assembler version 2.28.51.20170517.

When I grep'ed for 20170517 (how many of those strings could there be?) I got these two lines:

Code: Select all

esp-idf/components/expat/expat/testdata/largefiles/wordnet_glossary-20010201.rdf:<rdf:Description rdf:about="&a;201705170"
esp-idf/components/ulp/toolchain_ulp_version.mk:SUPPORTED_ULP_ASSEMBLER_VERSION = 2.28.51.20170517
Suspicious, but not conclusive.

I hadn't deleted my esp-idf v3.2 directory tree. So I did some tree renaming, copied the latest assembler version, v2.28.51-esp-20190801, into my v3.2 tree at the same place as in my v3.3 tree, fixed the path directives so everything pointed where it needed to just as in my v3.3 tree, and ran a build. The github sample built without error under v3.2.

The only variable at this point is esp-idf v3.3. Its make system for the ULP is broken as it only supports the old and unavailable assembler version 2.28.51.20170517. See the error messages in my previous posts.

For the time being I'll revert to developing under v3.2.

I have a couple of new questions:
1. How do I find out when v3.3 is fixed so I can re-install and start using it again? I like to stay with the latest stable version.
2. Is this the best channel for reporting a bug or is there another channel that you'd prefer?
3. I see a little green triangle with what looks like a little thunderbolt in it at the upper right corner of my name to the right of my posts. What does that mean?

Thanks.

Re: ESP-IDF v3.3 Doesn't seem to work with ULP

Posted: Tue Sep 10, 2019 1:40 am
by WiFive
The version mismatch is just a warning, it shouldn't cause a fatal problem. The actual problem is

Code: Select all

make[1]: esp32ulp-elf-as: Command not found
and if it is definitely in your PATH then when make invokes it, PATH must not be available to the subprocess for some reason.

1. GitHub notifications
2. GitHub issues once you are sure it is a bug in esp-idf
3. Your online status

Re: ESP-IDF v3.3 Doesn't seem to work with ULP

Posted: Tue Sep 10, 2019 4:15 am
by wevets
Thank you for staying with me through this process. I have things working now. Yeah, there was a two-character error in my path statement that kept the UPL tools from being seen, just as you said. And thanks for your answers to my questions.

wevets