Newcomer can't get VS Code to run

Thanks Peter - will try immediately!

1 Like

Had it uninstalled( -f not valid code ??). Re-installed it - same problem! If you can read German - thats what it said to me:
[28.11.2020, 11:52:11] Die Konfiguration mit compilerPath “arm-none-eabi-gcc” kann nicht aufgelöst werden. Stattdessen wird “cl.exe” verwendet.
If you need translation - let me know

PlatformIO should generate the c_cpp_properties.json for you, but for the value compilerPath, PlatformIO will use the full path to the executable… something like C:\Users\<user>\.platformio\packages\toolchain-gccarmnoneeabi\bin\arm-none-eabi-gcc. If it just writes arm-none-eabi-gcc, it won’t find the binary and will attempt to switch to… the Microsoft C compiler? And that’s completely wrong.

Were you able to test a simple test project as per Newcomer can't get VS Code to run - #32 by maxgerhardt?

Have you tried the project task Default → Miscellaneous → Rebuild IntelliSense Index? Does the `c_cpp_properties now look more sane?

Do you have any other extensions installed besides Python, Jupyter and PlatformIO that might interfere?

Also, this is “just” IntelliSense. Does the project build? If the project doesn’t build, an error must first be searched for there. The c_cpp_properties.json and Microsoft IntelliSense is all separate from PlatformIO, just PlatformIO builds the firmware, not the Microsoft C/C++ extension.

Hi Max,
question for me (… the blind!) is, where do I have to define the path! Because up to now I have not defined this path at all! Can you give me some advice, where to do it?
Seems to me that this is the main problem left.

Sorry, didn’t answer your questions in total:
I have no other software you mentioned, except Visual Basic.
Related to … able to test a simple test project …, I understand your detailed recipe you have given earlier - this worked only once for me.
To try “project task” - unfortunately not enough kowledge on my side to run this!

Can you show a screenshot of what VSCode looks like with the error message that you get when compiling the minimal example above?

The docs show the location of the project tasks window in the PIO sidebar and I noted down the path to the task.

grafik

ll try my best and come back later (~ 1h)

I hope, this can tell you something:!


While doing the pio platform update, I noted that first it comes up with an error in case of "gccarmnoneeabi, and then it seems to install the correct version!? Do I understand that correct?

So this is the build-result and following (…as far as I understand - an automaticly generated file) the c_ccp_properties.json with the path error.


Next I willtry to fiddle out, whats it about “project task”.
Thanks again for your patience and effort!

It seems to me that A.) Some extension is overriding the c_cpp_properties and B.) You are pushing the wrong build button. “Executing task: C/C++…” shows that PlatformIO is not executed here at all. Otherwise it would say something like > Executing task in folder STM32Test: C:\Users\Max\AppData\Local\Programs\Python\Python38\Scripts\pio.exe run <

Please click on the Extension button on the left and screenshot that to show all the extensions.

Further show how you start the build. It must be either by the “Build” button in the taskbar or explicit in the PIO extension toolbar

grafik

Just for short: I did the Project task as given in your advice and rebuild Intellisense:

> Executing task in folder Marlin-2.0.7.2-SKR-E3-DIP: C:\Users\elli\.platformio\penv\Scripts\pio.exe init --ide vscode <


The current working directory C:\A-Marlin\BIGTREETECH-SKR-E3-DIP-V1.0-master\Firmware\Marlin-2.0.7.2-SKR-E3-DIP will be used for the project.


The next files/directories have been created in C:\A-Marlin\BIGTREETECH-SKR-E3-DIP-V1.0-master\Firmware\Marlin-2.0.7.2-SKR-E3-DIP
include - Put project header files here
lib - Put here project specific (private) libraries
src - Put project source files here
platformio.ini - Project Configuration File
Error: Processing STM32F103RC_btt_USB (platform: ststm32@~6.1; board: genericSTM32F103RC; framework: arduino)
--------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
Der Befehl "CC" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
CalledProcessError: Command 'CC -DTARGET_STM32F1 -D__MARLIN_FIRMWARE__ -DHAVE_SW_SERIAL -DTONE_CHANNEL=4 -DDEBUG_LEVEL=0 -DSS_TIMER=4 -DUSE_USB_COMPOSITE -D__MARLIN_DEPS__ -w -dM -E -x c++ buildroot/share/PlatformIO/scripts/common-dependencies.h' returned non-zero exit status 1.:
  File "C:\users\elli\.platformio\penv\lib\site-packages\platformio\builder\main.py", line 168:
    env.SConscript(item, exports="env")
  File "C:\Users\elli\.platformio\packages\tool-scons\scons-local-4.0.1\SCons\Script\SConscript.py", line 598:
    return _SConscript(self.fs, *files, **subst_kw)
  File "C:\Users\elli\.platformio\packages\tool-scons\scons-local-4.0.1\SCons\Script\SConscript.py", line 287:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "C:\A-Marlin\BIGTREETECH-SKR-E3-DIP-V1.0-master\Firmware\Marlin-2.0.7.2-SKR-E3-DIP\buildroot\share\PlatformIO\scripts\common-dependencies.py", line 286:
    apply_features_config()
  File "C:\A-Marlin\BIGTREETECH-SKR-E3-DIP-V1.0-master\Firmware\Marlin-2.0.7.2-SKR-E3-DIP\buildroot\share\PlatformIO\scripts\common-dependencies.py", line 118:
    if not env.MarlinFeatureIsEnabled(feature):
  File "C:\Users\elli\.platformio\packages\tool-scons\scons-local-4.0.1\SCons\Environment.py", line 219:
    return self.method(*nargs, **kwargs)
  File "C:\A-Marlin\BIGTREETECH-SKR-E3-DIP-V1.0-master\Firmware\Marlin-2.0.7.2-SKR-E3-DIP\buildroot\share\PlatformIO\scripts\common-dependencies.py", line 262:
    load_marlin_features()
  File "C:\A-Marlin\BIGTREETECH-SKR-E3-DIP-V1.0-master\Firmware\Marlin-2.0.7.2-SKR-E3-DIP\buildroot\share\PlatformIO\scripts\common-dependencies.py", line 250:
    define_list = subprocess.check_output(cmd, shell=True).splitlines()
  File "C:\Users\elli\.platformio\python3\lib\subprocess.py", line 411:
    **kwargs).stdout
  File "C:\Users\elli\.platformio\python3\lib\subprocess.py", line 512:
    output=stdout, stderr=stderr)
================================================================= [FAILED] Took 1.42 seconds =================================================================
Environment          Status    Duration
-------------------  --------  ------------
STM32F103RC_btt_USB  FAILED    00:00:01.415
=========================================================== 1 failed, 0 succeeded in 00:00:01.415 =========================================================== 

The terminal process "C:\Users\elli\.platformio\penv\Scripts\pio.exe 'init', '--ide', 'vscode'" terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it.

Wow, what kind of software is this to have several ways to build (…says the blind) !

Well that’s not normal. As said above, I’ve never seen that before in a normal installation.

Again, what’s the list extensions? Mines:

grafik

This is my list!
By the way - what I marked red - this is the usual build- button?

Remove the “C++ Intellisense” extension by austin. It is known to conflict PlatformIO. Restart VSCode after. Rebuild the IntelliSense after. Rebuild the project.

Will do! Thanks so far! Will tell you!

Have done all this so far!
Following is the error-message:

Executing task in folder Marlin-2.0.7.2-SKR-E3-DIP: C:\Users\elli.platformio\penv\Scripts\pio.exe run <

Processing STM32F103RC_btt_USB (platform: ststm32@~6.1; board: genericSTM32F103RC; framework: arduino)
--------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via -v, --verbose option
Der Befehl “CC” ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
CalledProcessError: Command ‘CC -DTARGET_STM32F1 -D__MARLIN_FIRMWARE__ -DHAVE_SW_SERIAL -DTONE_CHANNEL=4 -DDEBUG_LEVEL=0 -DSS_TIMER=4 -DUSE_USB_COMPOSITE -D__MARLIN_DEPS__ -w -dM -E -x c++ buildroot/share/PlatformIO/scripts/common-dependencies.h’ returned non-zero exit status 1.:
File “C:\users\elli.platformio\penv\lib\site-packages\platformio\builder\main.py”, line 168:
env.SConscript(item, exports=“env”)
File “C:\Users\elli.platformio\packages\tool-scons\scons-local-4.0.1\SCons\Script\SConscript.py”, line 598:
return _SConscript(self.fs, *files, **subst_kw)
File “C:\Users\elli.platformio\packages\tool-scons\scons-local-4.0.1\SCons\Script\SConscript.py”, line 287:
exec(compile(scriptdata, scriptname, ‘exec’), call_stack[-1].globals)
File “C:\A-Marlin\BIGTREETECH-SKR-E3-DIP-V1.0-master\Firmware\Marlin-2.0.7.2-SKR-E3-DIP\buildroot\share\PlatformIO\scripts\common-dependencies.py”, line 286:
apply_features_config()
File “C:\A-Marlin\BIGTREETECH-SKR-E3-DIP-V1.0-master\Firmware\Marlin-2.0.7.2-SKR-E3-DIP\buildroot\share\PlatformIO\scripts\common-dependencies.py”, line 118:
if not env.MarlinFeatureIsEnabled(feature):
File “C:\Users\elli.platformio\packages\tool-scons\scons-local-4.0.1\SCons\Environment.py”, line 219:
return self.method(*nargs, **kwargs)
File “C:\A-Marlin\BIGTREETECH-SKR-E3-DIP-V1.0-master\Firmware\Marlin-2.0.7.2-SKR-E3-DIP\buildroot\share\PlatformIO\scripts\common-dependencies.py”, line 262:
load_marlin_features()
File “C:\A-Marlin\BIGTREETECH-SKR-E3-DIP-V1.0-master\Firmware\Marlin-2.0.7.2-SKR-E3-DIP\buildroot\share\PlatformIO\scripts\common-dependencies.py”, line 250:
define_list = subprocess.check_output(cmd, shell=True).splitlines()
File “C:\Users\elli.platformio\python3\lib\subprocess.py”, line 411:
**kwargs).stdout
File “C:\Users\elli.platformio\python3\lib\subprocess.py”, line 512:
output=stdout, stderr=stderr)
================================================================= [FAILED] Took 2.05 seconds =================================================================
Environment Status Duration


STM32F103RC_btt_USB FAILED 00:00:02.049
=========================================================== 1 failed, 0 succeeded in 00:00:02.049 ===========================================================
The terminal process “C:\Users\elli.platformio\penv\Scripts\pio.exe ‘run’” terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it.

What makes me wonder is the point after closing VSCode and restarting, VSCode immediately says that it cant resolve arm-none-eabi-gcc and will take another compiler (?) instead.
You don’t see any way to repair the missing path for this lib, or whatever this is, so that the full path is shown, what you recommended?? Actually this is the only error shown in the c_cpp_properties file?

Can you show the list of extensions again?

Here it is:

This looks good now. Try removing the old Marlin folder, downloading it fresh, and re-opening it in VSCode via PIO Home’s “Open Project” folder. Maybe the austin C++ extension has meddled with this project too much.

1 Like

OK! will do! At least on my side PlatformIO needs quite some time to get things together (…showing the clock!). When Im finished, I will come back to you!
Thanks again for your patience!
Regards
Hans

1 Like

Hi Max,
while waiting for all the stuff to be put together, one question to better understand VSCode and PlatformIO:
I can open a folder outside of PlatformIO (explorer…) and have all the BTT-Marlin version as well as all the printer-specific files like the configs. Also I have a platformio.ini where the full path to the BTT-software is specified, the board and so on.
Then I can start with PlatformIO a new project. This gives me the lineup of the Project name as well as an include-folder and others and an additional platformio.ini in the folder with the project name!
The first platformio.ini is pointing to the “basic” BTT definitions for a specific printer (e.g. Ender 3 in my case with a special DIP-Board).
What is the correct way to set it up??
I did right now the following:
I upgraded, updated and installed the platform ststm32 with platformio cli.
Then I opened the BTT-folder with the explorer and had the BTT-stuff listed.
Then I opened with PlatformIO a new project and have the project-folder behind the BTT-Stuff.
Basic question - is this the right wayor do I something wrong?