PlatformIO

Can anybody offer some pointers / help?

I am trying to compile V1CNC_Ramps-2.0.7.2-src using Visual Studio / PlatformIO

I have had success a couple of weeks ago but now the build keeps falling over. I am familiar with Arduino IDE but VS is new to me and on steep learning curve.

The Terminal output is posted below…any suggestions welcomed.

Executing task: C:\Users\men8i.platformio\penv\Scripts\pio.exe run <

Processing mega2560 (platform: atmelavr; board: megaatmega2560; framework: arduino)

Verbose mode can be enabled via -v, --verbose option
‘CC’ is not recognized as an internal or external command,
operable program or batch file.
CalledProcessError: Command ‘CC -D__MARLIN_FIRMWARE__ -D__MARLIN_DEPS__ -w -dM -E -x c++ buildroot/share/PlatformIO/scripts/common-dependencies.h’ returned non-zero exit status 1.:
File “C:\users\men8i.platformio\penv\lib\site-packages\platformio\builder\main.py”, line 175:
env.SConscript(item, exports=“env”)
File “C:\Users\men8i.platformio\packages\tool-scons\scons-local-4.1.0\SCons\Script\SConscript.py”, line 591:
return _SConscript(self.fs, *files, **subst_kw)
File “C:\Users\men8i.platformio\packages\tool-scons\scons-local-4.1.0\SCons\Script\SConscript.py”, line 280:
exec(compile(scriptdata, scriptname, ‘exec’), call_stack[-1].globals)
File “C:\Marlin_V1CNC_Ramps\Marlin_V1CNC_Ramps_2.0.7.2_509-src\Marlin\buildroot\share\PlatformIO\scripts\common-dependencies.py”, line 286:
apply_features_config()
File “C:\Marlin_V1CNC_Ramps\Marlin_V1CNC_Ramps_2.0.7.2_509-src\Marlin\buildroot\share\PlatformIO\scripts\common-dependencies.py”, line 118:
if not env.MarlinFeatureIsEnabled(feature):
File “C:\Users\men8i.platformio\packages\tool-scons\scons-local-4.1.0\SCons\Util.py”, line 658:
return self.method(*nargs, **kwargs)
File “C:\Marlin_V1CNC_Ramps\Marlin_V1CNC_Ramps_2.0.7.2_509-src\Marlin\buildroot\share\PlatformIO\scripts\common-dependencies.py”, line 262:
load_marlin_features()
File “C:\Marlin_V1CNC_Ramps\Marlin_V1CNC_Ramps_2.0.7.2_509-src\Marlin\buildroot\share\PlatformIO\scripts\common-dependencies.py”, line 250:
define_list = subprocess.check_output(cmd, shell=True).splitlines()
File “C:\Users\men8i.platformio\python3\lib\subprocess.py”, line 411:
**kwargs).stdout
File “C:\Users\men8i.platformio\python3\lib\subprocess.py”, line 512:
output=stdout, stderr=stderr)
================================================================================================== [FAILED] Took 0.99 seconds ==================================================================================================

Environment Status Duration


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

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

Just noticed in the debug console under “Problems”

#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (C:\Marlin\Marlin\src\MarlinCore.cpp).

Not sure what it is getting at?

I really have no idea what your message means…except it can’t run some scripts, but you could try performing a clean. In the blue bar at the bottom, select the dustbin, after that look in your project/Marlin for the .pio folder and delete everything inside that folder. After that try your build again.

Thanks @dart1280

Given that a try with no success.

Might try a completely fresh install of VS on a separate computer.

Vscode is capable of building generic c++. But Marlin isn’t written for a generic c++ environment. It has to be compiled for the arduino mega, using platformio tools. It looks to me like you’ve got the wrong build button, and you need to open the project with the platformio tools and use the platform build button.

In case you weren’t aware, the MarlinBuilder releases includes a build hex file. If you aren’t making changes, you can flash that directly using xloader. You should also be able to use the arduino ide (for now) with our marlin zips (because we remove a bunch from hal).

Thanks @jeffeb3
I had a suspicion that this is what the hex file was for. I would like to be able to tweak the config files so will persist with getting the build to work (again…it has worked previously which is bugging me!)

I am using the build tool as shown below

Could this be the issue…
image

Yeah. That could be it. Install whatever it asks you to.

Just managed a successful build on a clean install of VS on a separate laptop…it was also asking for Git to be Downloaded but the build was successful without it.

I tried a fresh install on my main laptop but there must be some config files that aren’t purged during the uninstall/install process.

Going to see if I can work out as wont have access to the other laptop long term.

Resolved

Cleared out the contents of the following folders which are located in C:\Users[useraccountname]

Not sure what was in there causing the issue but all is well with the world now!

3 Likes

Having a time of it getting Platformio to compile and upload the latest builds offered up as well. I have apparently missed out on the simple elegance of this alternative so far. How did you come to identify the above as requiring cleansing? Is it still working correctly if you try to compile and upload today?

I kept at it and somehow I was able to get Arduino IDE to compile and load. No magic. Just kept trying until Arduino IDE locked up then stopped and shut everything down and started again. Not hooked up to anything so I don’t know if it works or not.

Would also like to be able to use Platformio if I can understand where I’m going astray.

Arduino ide is going to be broken soon. The marlin devs seem to just not want to fight with it anymore. Platform definitely works, but it is much more powerful, so there are many ways it can go wrong.

So we’re trying to make it easier to get started without either. On boards like the skr, you can flash from the sd card. On the rambos, there is xloader to flash the hex file. Neither need to be compiled, because we have them premade for many situations in MarlinBuilder releases.

2 Likes