Hi.
I recently reinstall my windows, then PlatformIO.
The first time I’ve done it, it work out of the box. This time I am unable to build my sketch. Console return:
Executing task in folder 200812-053037-due: c:\Users\[myuser]\OneDrive\Documents\PlatformIO\Projects\200812-053037-due\platformio.exe run <
The terminal process failed to launch: Path to shell executable "c:\Users\<[myuser]\OneDrive\Documents\PlatformIO\Projects\200812-053037-due\platformio.exe" does not exist.
I tried with import a project and create a new one with the same resutl.
win10 home, 120.2212.31.0
vs Code 1.48.0
PlatformIO core 4.3.4 home 3.2.3
I might be making this up, but I’m sure I read (or dreamt!) that the one-drive folder was causing problems.
Can you (humour me!) and create a new folder elsewhere, say c:\users\YOUR_NAME\temp for example, and copy the one-drive based project, in its entirety, into the new folder. Open the project there and try to build it in the new location.
If that works, then you might want to create a new folder for PlatformIO projects, and configure that as the new default location.
Are you using VSCode or Atom to build projects? Or the command line?
If using the editor, open a terminal from within the editor, with the project open which doesn’t compile, and try these commands:
pio run pio run --target upload
They will compile the project first. If that works, the second command will attempt to upload it. Assuming these work, then the problem is in the VSCode or Atom editor. Perhaps uninstalling and reinstalling PlatformIO will help?
It is most probable that onedire cause the problem. I already add another but that I cannot open file via path user/documents, I add to sue use/onedrive/documents (on this tread: cant acces documents).
I tried to remove all onedrive with win10Debloater, no success.
also tried to put the folder outside onedrive folder, and also tried it with terminal pio run:
pio : The term 'pio' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ pio run --target upload
+ ~~~
+ CategoryInfo : ObjectNotFound: (pio:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Was that terminal the one inside VSCode, or outside it? Inside gives access to the pio command, outside needs either the PlatformIO-core installing, or, you need to install the commands from within VSCode itself, where there is an option to do so.
Please try the pio commands from the terminal inside VSCode. Terminal->New Terminal from the menubar, or, CTRL+SHIFT+# in the editor itself. Thanks.
You’re not imagining things - or if you are, we bother are! OneDrive is a pain in the at times - and not just because it is hard to remove cleanly.
@djnitrof I would try changing the default shell in VSCode back to the command prompt (as it is currently powershell) and see if that makes any difference to the pio commands being recognised.
If it was inside VSCode, then you should have the pio command available. It sounds to me like your reinstall failed somewhere. Let’s see if we can install the shell commands:
Please follow those instructions and add the PlatformIO folder to your path, then start a new commandline (windows key, R, type cmd, click ok) then cd to your source folder and try pio run again.
This is outside the editor this time please. If you still get unrecognised command errors then PlatformIO is most likely a failed install - as far as I can see.
been able to run PIO, but it fail to compile, seem that it cannot see correctly the include path again. even if I change it to add onedrive in platformio.ini file.
I’m surprised that it compiles with the Arduino to be honest. That error message implies that the code has a variable named select compiled in the same unit/file/header with a different data type. If I do this:
void setup() {
int fred;
char *fred;
}
The compiler complains. Not quite in the same manner though, so maybe there’s something else afoot!
Would you mind zipping up your latest PlatformIO version of the sketch and sending it to me directly please? Assuming there’s nothing confidential in it of course. I’d need the whole lot please.
One thing about lib_extra_dirs, the docs state that this This is a not direct path to a library with source code. It should be a path to storage that contains libraries grouped by folders. For example, D:\PlatformIO\extra\libraries but not D:\PlatformIO\extra\libraries\FooLibrary .
So if your version of FooLibrary has it’s source code in the folder ~/OneDrive/Documents/Arduino/libraries then that’s fine, but if the code for the library is in the ~/OneDrive/Documents/Arduino/libraries folder itself, the it’s not going to work.
Actually, does Windows recognise the use of ~ as the current user’s home directory these days? And does it recognise forward slashes in the Linux manner as directory separators? Perhaps you need to set this instead:
not so sensible program, but large one… with 5 of my libraries…
But investigating a little more, starting with a new compiling sketch, I tried to add one by one libraries, by now it seem to be ADC_Sampler that is not compiling.
I got only warning, but it still fail…
\OneDrive\Documents\Arduino\libraries\ADC_Sampler\src/ADC_Sampler.h:60:13: warning: 'void enableChX(uint8_t)' defined but not used [-Wunused-function]
static void enableChX(uint8_t pin){
^~~~~~~~~
Linking .pio\build\due\firmware.elf
.pio\build\due\libbba\libADC_Sampler.a(ADC_Sampler.cpp.o): In function `_GLOBAL__sub_I__ZN17ADC_Sampler_class11numChannelsE':
ADC_Sampler.cpp:(.text.startup._GLOBAL__sub_I__ZN17ADC_Sampler_class11numChannelsE+0x18): undefined reference to `ADC_sequencer_size'
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\due\firmware.elf] Error 1
oups… did see that… to small text. I forgot an extern declaration…
I think I will try to add in the new project section per section the old code to see if I can find witch par is buggy…
[UPDATE] It seems that PIO compiler is very much more sensible that arduino one…
Going step by step, there was the select variable that put as redefine in another symbole, that was part of the SAM core, is was not causing problem before, but changin name fix that.
Also, PIO is very much more sensible to declaration order, I add to change order of many declaration and add some prototype to make it compile.
I’m afraid you have exhausted my knowlege of Windows and PlatformIO if so. Sorry. I do not understand how or why it works in command line mode but not from the editor itself. Weird.
Hi,
I also have had a similair problem. Re install did not solve it.
When compiling the simple Arduino blink example I got
" The terminal process failed to launch: Path to shell executable “c:\Users\name\Documents\PlatformIO\Projects\test6\pio.exe” does not exist. "
Very easy to solve however. In directory “C:\Users\name.platformio\penv\Scripts” I copied
“platformio.exe” to a new file “pio.exe”.
Realy very odd. On two other win10 computers platformio worked fine after installation without problems…
win 10 home (2020-04-23)
ver 1909
OS version 18363.1256
vs Code 1.52.1
PlatformIO core 5.0.4 home 3.3.1