Can't return to platformIO after pioarduino installation

Hello,

I posted here recently Configuring FreeRTOS - #5 by maxgerhardt and followed the advice I was promptly given by a kind moderator. After attempting to set up working with pioarduino I installed the extension. After doing so, it apperas that the compiler has changed from the formatting in the terminal. Furthermore, it looks like a new version of espidf is being used since code that was valid before the change is apparently no longer valid.

When I boot into platformIO, pioarduino shows up - despite being uninstalled - in the splash screen. Uninstalling both and restarting and reinstalling yields nothing. I am also getting issues with platformIO install, it is periodically complaining about an inability to find ‘C:/Users/<MYUSER>.vscode/blah blah’ notice that it has missed the path delimiter between the username and the hidden vscode folder. This shows up as an error in installation suggesting that perhaps some of pio’s internals are misusing python’s path libraries perhaps?

I am very confused and work has ground to a complete halt. I’d appreciate any help on this

The advice was about to use pioarduino’s espressif32-platform, not about installing the extension.

It might be a bit confusing as there is the pioarduino espressif32-platform and the VS Code extension.

Both extensions (PlatformIO / pioarduino) can not be installed at the same time.

This is a bit unclear. What changed exactly?

This is also unclear. What do you mean with “boot into PlatformIO” and what spash screen are you refering to? Do you mean when you start VS Code?

Please be more precies about this. What is the exact error message?

Here is the way to go:

  • Remove either the pioarduino extension or the PlatformIO extension and keep the other. If you want to use PlatformIO’s registry, keep PlatformIO.
  • Close VS-Code
  • Delete C:\Users\<username>\.platformio
  • Restart VS-Code and wait until the extension finished reinstallnig missing files

To use pioarduino’s espressif32-platform in a project, edit the platformio.ini and change the platform setting to a pioarduino version.
If you want to use PlatformIO’s espressif32-platform, simply specify the version to be used.
See this list GitHub - sivar2311/platform-espressif32-versions: A list of espressif32-platform versions for PlatformIO / pioarduino

I am aware of the difference I was, however, under the impression that one was an add on to the other and since it was recommended I chose to install. Initially, this caused no issues. In order to fix the compilatioN I had to cobble together some fixxes from some googling as you can see in the thread. I am sure you can appreciate, as somehow who is new to the field, it is kinda difficult to parse what to do with the tooling. Docs aren’t the best in many embedded tools to put it lightly and the thread shows an example of following the recommended examples and things not working. Sometimes, you gotta work off a hunch and in the process I thought that some magic of pioarduino might solve the build system headaches. Sorry if this sounds a bit like a rant, hahaha!

The format of error messages have changed quite considerably. I can’t provide examples of older ones since I can’t get them back but I am now getting (embarassed to give such a crude description) more ANSI terminal colouring with purples and blued. This suggests to me that perhaps the compiler being used has changed or is at least still configured as pioarduino configured it - the compiler hcosen in my platformIO.ini haven’t changed.

Also, there are new errors. I won’t list them here since there are now a lot, but crucially, on this commit everything was compiling just fine before this unfortunate experiment. Here is an example:

error: invalid conversion from ‘void ()(void)’ to ‘TimerCallbackFunction_t’ {aka ‘void ()(tmrTimerControl)’} [-fpermissive]
57 | periodicTasksCaller);
| ^~~~~~~~~~~~~~~~~~~
| |
| void ()(void)

this leads me to believe that the version of espidf being used is incorrect since this worked previously and now does not.

Yes, I mean when I start VSCode and platformIO UI opens with the home screen that normally includes community news.

I have now tried to follow your instructions with deleting .platformIO in user home and reinstalling. Same results:
Unable to read file 'c:\Users\MYNAME.vscode\extensions\platformio.platformio-ide-3.3.4-win32-x64\package.json' (Error: Unable to resolve nonexistent file 'c:\Users\MYNAME.vscode\extensions\platformio.platformio-ide-3.3.4-win32-x64\package.json')

Notably, there is no path delimiter between MYNAME and the .vscode so of course this is wrong, which suggests something in the source code might be getting corrupted….? Anyway, it now fails to install altogether.

Just to be 100% clear, have followed this and yielding the same results. To be clear also, I am choosing in your instruction to keep platformIO and remove the other. Even with pioarduino gone and the .platformIO dir gone, it makes no difference and I am back to the same errors

The changed Error message may come from a newer tool-chain.

Can you check the installed Espressif32 platform version(s)?

This seems to be a python print error when it comes to print windows path names. The “\” seems to get truncated if it is followed by a “.”. The same would happen in when you print a windows path using printf in your sketch. So this is probably just a formatting issue.

I’m more concerned about the missing file. I think this is a leftover from an old or broken installation.

Try to open a new VS Code window using a new profile. Then install PlatformIO extension to this profile.

pio platform list
WARNING: This command is deprecated and will be removed in the next releases.Please use pio pkg list instead.
Platforms└── espressif32 @ 6.12.0 (required: platformio/espressif32)

Thanks for the input again. I have now done this, and the nwe profile appears to get further. The installation works but then compiling is a serious problem with errors in the espidf framework, here is an example error: (sorry for the formatting I must be missing the obvious way to format code blocks)



C:\Users\MYNAME\.platformio\packages\framework-espidf\components\bootloader\subproject\main\bootloader_start.c:16:10: fatal error: bootloader_init.h: No such file or directory

*******************************************************************************
* Looking for bootloader_init.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:bootloader_init.h"
* Web  > 
*
*******************************************************************************

 #include "bootloader_init.h"
          ^~~~~~~~~~~~~~~~~~~
compilation terminated.
Compiling .pio\build\esp32dev\bootloader\bootloader_support\src\bootloader_clock_init.c.o
*** [.pio\build\esp32dev\bootloader\main\bootloader_start.c.o] Error 1
C:\Users\MYNAME\.platformio\packages\framework-espidf\components\bootloader_support\src\bootloader_common.c:28:10: fatal error: bootloader_flash_priv.h: No such file or directory

Ok, that proves that there are some (broken) leftovers in your VS Code setup.

Unfortunaltey, I don’t know much about esp-idf projects. I’m more the Arduino guy :wink:
But maybe you can share the project or a minimal example to reproduce (via github?).
It is difficult to “debug” just by having the error messages without the context (code / project).

See How to post logs and code in PlatformIO Community Forum

Ok, is there a nuclear option that I can purge the entire system of this? I appreciate your input and help and this obviously isn’t directed at yourself but to be honest the frustration of trying to work with platformIO is just something staggering.

Just want to say that I appreciate the help nonetheless.

Unfortunately I can’t, it occurs no matter what I do now - i.e. even basic arduino set up projects - and the project iself is company related and not shareable.

Is there absolutely anything else I can do?

This seems more related to VS Code than to PlatformIO.
The question is how to clean out everyhting PlatformIO related from VS Code. This is beyond my scope, but maybe there is a VS Code guru here on the forum.

Everything is fine. I’m just a normal PlatformIO user who is trying to help.
I’m not related to PlatformIO and I’m not a developer of PlatformIO.

I was afraid of that. That’s why I asked about a minimal example to reproduce the error.

If arduino is fine for you let’s try a very basic sketch. Does it compile for you, or do you get some errors? (If so, please post the error log)

platformio.ini

[env:esp32dev]
platform = espressif32 @ 6.12.0
board = esp32dev
framework = arduino

main.cpp

#include <Arduino.h>

void setup() {
    Serial.begin(115200);
}

void loop() {
    Serial.println("Hello World");
    delay(1000);
}

Very frustratingly, the issue now appears to be fixed, I am honestly not really sure what I did. Sorry for this to be such a let down after all your efforts. It just appears to be working. it is possible it was related to a caching issue with .pio in the project, but I am convinced that clearing the cache was done several times….so maybe somehow there was some kinda error with this? When I went over my list of things to try in the hope of fixing it in desperation for what felt like the 20th time, it suddenly started working and compiling completely after running the pio run -t clean.

Thank you for all of your help, I appreciate it and wish I could leave a more definitive answer here for other users

1 Like