PlatformIO IDE fails with ULP examples

Hi,
I have a problem getting the ULP examples to work. I know this functionality is new and on development but I know it works outside of PlatformIO and I need it to get working as implied by [Valerii Koval] in issue #95.
I will add at the end of the post the system description so I do not clog the start of this post.
I have to be honest that I am not familiar to python and javascript so if you can bare in mind that you have to explain in simple terms to get me understand :slight_smile:

I have been searching this community and google for almost a week trying to solve my problem.
I have tried almost every tip given by many, including [ivankravets] and I have reached a dead-end.
Installed and reinstalled vscode 3 times with full clean.
Installed and reinstalled from inside vscode, PlatformIO many more times.
Installed binutils-esp32ulp-win32-2.28.51-esp32ulp-20180809.zip
Added to my W10 PATH environment this two paths so PowerShell can execute the required commands:

-C:\Users\Thomas Magdahl\.platformio\penv\Scripts
-C:\Users\Thomas Magdahl\.platformio\esp32ulp-elf-binutils\bin

Was able to run “pio update” successfully while in this ULP example directory

-D:\Data\Devlp\PlatformIO\Projects\Examples\espidf-ulp-adc

But when running “platformio run” I got stuck. It runs but fails with the message:

_____________________________________________________________________________________
_____________________________________________________________________________________
PS D:\Data\Devlp\PlatformIO\Projects\Examples\espidf-ulp-adc> platformio run
Processing esp32dev (platform: espressif32; board: esp32dev; framework: espidf)
---------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 1.9.0 > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES: toolchain-xtensa32 2.50200.80 (5.2.0), toolchain-esp32ulp 1.22851.190618 (2.28.51), framework-espidf 3.30202.190627 (3.2.2), tool-esptoolpy 1.20600.0 (2.6.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 0 compatible libraries
Scanning dependencies...
No dependencies
Preprocessing .pio\build\esp32dev\ulp_app\adc.ulp.pS
xtensa-esp32-elf-gcc: error: Magdahl\.platformio\packages\framework-espidf\components\soc\esp32\include: No such file or directory
Compiling .pio\build\esp32dev\bootloader\bootloader_support\src\flash_qio_mode.o
Compiling .pio\build\esp32dev\bootloader\bootloader_support\src\secure_boot.o
*** [.pio\build\esp32dev\ulp_app\adc.ulp.pS] Error 1
Compiling .pio\build\esp32dev\bootloader\bootloader_support\src\secure_boot_signatures.o
=================================================== [ERROR] Took 8.21 seconds ===================================================
PS D:\Data\Devlp\PlatformIO\Projects\Examples\espidf-ulp-adc>
_____________________________________________________________________________________
_____________________________________________________________________________________

Followed almost any suggestion I was able to understand.
For the regular examples like blinking a led and Bluetooth Low Energy, my projects work fine and have worked since the first install. Love at the first sight as all the previous Espressif installations (native windows/Oracle VB + Ubuntu) kept on failing at different stages (spaces in the path, environment variables like ESP-IDF not working as expected, incompatible versions of python and 20 more issues I do not recall at the point I got sick of it :slight_smile: ).
I am able to run (compile and load) my BLE server in my ESP32 DevKitV1 and my MIT APP Inventor code on my android phone is getting and modifying characteristics like a charm.
Of course now that I have figured out how to use BLE (being my application a low power one) I need to add ULP to the rest of the time when bluetooth is not required.
I have seen similar post with slightly different flavors and nothing discussed there could help me to overcome the problem which of course might be something stupid I am doing or that I forgot something.
Any help would be appreciated.

I am using an MSI laptop i5 2,5GHz 8GB RAM with W10 64 bit.
Visual Studio Code
Version: 1.36.1 (user setup)
Commit: 2213894ea0415ee8c85c5eea0d0ff81ecc191529
Date: 2019-07-08T22:59:35.033Z
Electron: 4.2.5
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Windows_NT x64 10.0.17134
PlatformIO IDE 1.8.0

At the start of the post where I indicate the two additions to the PATH variable, a backslash is missing before “.platformio” and after my name, but they are there in the environment variable (I did a copy paste). Not sure when it happened but it might be in this editor. Will try it right now to check what happens after I post.
C:\Users\Thomas Magdahl.platformio\penv\Scripts
Regards
Thomas

Not reproducable for me. When I download platform-espressif32/examples/espidf-ulp-adc at develop · platformio/platform-espressif32 · GitHub and compile it I get the expected

Processing esp32dev (platform: espressif32; board: esp32dev; framework: espidf)
-----------------------------------------------------------------------------------------------------------------------
PackageManager: Installing toolchain-esp32ulp @ ~1.22851.190618
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
toolchain-esp32ulp @ 1.22851.190618 has been successfully installed!
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 1.9.0 > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES: toolchain-xtensa32 2.50200.80 (5.2.0), toolchain-esp32ulp 1.22851.190618 (2.28.51), framework-espidf 3.30202.190627 (3.2.2), tool-esptoolpy 1.20600.0 (2.6.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 0 compatible libraries
Scanning dependencies...
No dependencies
[...]
DATA:    [          ]   4.2% (used 13832 bytes from 327680 bytes)
PROGRAM: [==        ]  17.1% (used 178965 bytes from 1048576 bytes)
 [SUCCESS] Took 226.75 seconds 

I do however see that you have a space in your username folder, which has led to problems before. I’m not sure if they’re the culprit now.

Can you just create a new windows user without spaces, install PlatformIO in there and retry compilation? Should rule this error out really quickly.

Hi maxgerhardt,
You nailed it!
That was the whole issue. Now it is working!

So you can have a laugh I will be very honest in the next lines.
After your reply I started an answer with an argument why I considered it a waste of time to try it, but then I deleted it and decided to do it to prove you wrong (moronic behaviour of mine :slight_smile: ).

My skeptisism was related to the fact that the same PATH was used in my working examples and due to the fact that PalatformIO (in those working examples) was able to overcome the “spaces in folder names” issue I had with the native espressif toolset, I was almost sure it would be a waste of time. My only doubt was that maybe new tools come into play when dealing with ULP related assembler and code.

Well thanks again for taking your time to help me with this issue.

Regards

Thomas Magdahl

1 Like

This issue is now tracked in ULP compilation fails when path contains space · Issue #208 · platformio/platform-espressif32 · GitHub and should be fixed soon accordingly.

1 Like

Wow that extremely quick by @valeros, fixed in Handle spaces in paths when compiling for ULP // Resolve #208 · platformio/platform-espressif32@2c1b430 · GitHub. @tmagdahl, could you please use your old Windows user again, but in the project’s platformio.ini use

platform = https://github.com/platformio/platform-espressif32.git#develop

instead of the normal platform and retry?

2 Likes

Hi maxgerhardt,

I tried with the old Windows user (the one with a space in the name) and it solved the problem. My first naive thought was that as a side effect, a space in the path would be no longer an issue after the first successful compilation, but I was not correct. Resetting to “platform = espressif32” generates the same problem originally reported, so I think I have to stick to this “platform = GitHub - platformio/platform-espressif32: Espressif 32: development platform for PlatformIO” for now.

On all the trials I made on both users, on a couple of occasions everything had to be recompiled (long 5:45 minutes), but now I think it was related to touching or modifying platform.ini or that git detected a new esp32env folder update?

Anyway, thanks for all your help and if you need any other test, please tell me.
Regards

Thomas Magdahl

p.s. Assuming the post has been solved, I have no idea how it gets flaged or closed.
The other thing I do not understand is why my post has a grey font and all others are black?

1 Like

Great to hear that it’s resolved correctly. The fix will be included in the next release version, whatever comes after the current 1.9.0 verison (releases). By using the git link as the platform = option you essentially say that you want the current bleeding edge development branch version. When a new version is released, just update platforms (pio platform update) and then you can say platform = espressif32 (or more safely by semantic versioning, platform = espressif32 > 1.9.0) and it should work without having to have the bleeding edge version.

Also I marked a response above as the solution so the topic is resolved.

1 Like