Help compiling Marlin 2 .0.x for the first time

Hi,

I am new to compiling firmware with PlatformIO
I am under Windows 10 and the last version of Visual Studio, PlatformIO, Marlin auto Build.

Thanks a lot for your help :slight_smile:

Robert

Every time I receive this kind of error:

Windows PowerShell
Copyright (C) Microsoft Corporation. Tous droits réservés.

Testez le nouveau systĂšme multiplateforme PowerShell https://aka.ms/pscore6

PS C:\Users\Robert\Desktop\skr12> platformio run -e STM32F103RC_btt
Processing STM32F103RC_btt (platform: ststm32@~10.0; board: genericSTM32F103RC; framework: arduino)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
'"CC"' n'est pas reconnu en tant que commande interne
ou externe, un programme ex‚cutable ou un fichier de commandes.
CalledProcessError: Command '"CC" -DTARGET_STM32F1 -D__MARLIN_FIRMWARE__ -DARDUINO_ARCH_STM32 -DDEBUG_LEVEL=0 -DSS_TIMER=4 -D__MARLIN_DEPS__ -w -dM -E -x c++ buildroot/share/PlatformIO/scripts/common-dependencies.h' returned non-zero exit status 1.:
  File "C:\Users\Robert\.platformio\penv\lib\site-packages\platformio\builder\main.py", line 168:
    env.SConscript(item, exports="env")
  File "C:\Users\Robert\.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\Robert\Desktop\skr12\buildroot\share\PlatformIO\scripts\common-dependencies.py", line 327:
    apply_features_config()
  File "C:\Users\Robert\Desktop\skr12\buildroot\share\PlatformIO\scripts\common-dependencies.py", line 141:
    if not env.MarlinFeatureIsEnabled(feature):
  File "C:\Users\Robert\.platformio\packages\tool-scons\scons-local-4.0.1\SCons\Environment.py", line 219:
    return self.method(*nargs, **kwargs)
  File "C:\Users\Robert\Desktop\skr12\buildroot\share\PlatformIO\scripts\common-dependencies.py", line 292:
    load_marlin_features()
  File "C:\Users\Robert\Desktop\skr12\buildroot\share\PlatformIO\scripts\common-dependencies.py", line 280:
    define_list = subprocess.check_output(cmd, shell=True).splitlines()
  File "C:\Users\Robert\.platformio\python3\lib\subprocess.py", line 411:
    **kwargs).stdout
  File "C:\Users\Robert\.platformio\python3\lib\subprocess.py", line 512:
    output=stdout, stderr=stderr)
============================================================================== [FAILED] Took 0.75 seconds ==============================================================================
Environment      Status    Duration
---------------  --------  ------------
STM32F103RC_btt  FAILED    00:00:00.747

Visual Studio or Visual Studio Code?

Is this the latest Marlin version, downloaded recently from GitHub - MarlinFirmware/Marlin: Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.?

What’s the output of pio system info in a PIO CLI?

Thanks for your answer,

Robert

  1. It’s Visual Studio Code
  2. It’s the last version of Marlin, 2.0.7.2
PS C:\Users\Robert\Desktop\skr12> pio system info
--------------------------  -------------------------------------------------------
PlatformIO Core             5.0.4
Python                      3.7.7-final.0
System Type                 windows_amd64
Platform                    Windows-10
File System Encoding        utf-8
Locale Encoding             cp1252
PlatformIO Core Directory   C:\Users\Robert\.platformio
PlatformIO Core Executable  C:\Users\Robert\.platformio\penv\Scripts\platformio.exe
Python Executable           c:\users\robert\.platformio\penv\scripts\python.exe
Global Libraries            0
Development Platforms       2
Tools & Toolchains          11
--------------------------  -------------------------------------------------------

It is known that this bug appears for some users ([BUG] 'CC' is not recognized as an internal or external command · Issue #20671 · MarlinFirmware/Marlin · GitHub).

The Marlin devs (and me) are desperately trying to track down why this happens because it works on our computers.

Does the file C:\Users\Robert\.platformio\packages\toolchain-gccarmnoneeabi\bin\arm-none-eabi-gcc.exe exist?

Have you tried removing the .pio folder in the Marlin project folder and retry building?

Have you tried removing all folders C:\Users\Robert\.platformio\packages\toolchain-gccarmnoneeabi* (there might be multiple ones) and retry building?

If that fails, please do as described in Issues building with fresh marlin firmware and PlatformIO 2.2.1 - #25 by maxgerhardt but in the [env:STM32F103RC_btt] section instead of the mega2560 one.

Logs can be posted here in Markdown code format (tripple-backquote block).

  1. Does the file C:\Users\Robert\.platformio\packages\toolchain-gccarmnoneeabi\bin\arm-none-eabi-gcc.exe exist? NO

  2. I removed all folders from .platformio

  3. Reinstall platformIO

  4. Retry the compilation and received this message:

Windows PowerShell
Copyright (C) Microsoft Corporation. Tous droits réservés.

Testez le nouveau systĂšme multiplateforme PowerShell Install PowerShell on Windows, Linux, and macOS - PowerShell | Microsoft Learn

PS C:\Users\Robert\Desktop\skr12> platformio run -e STM32F103RC_btt
Processing STM32F103RC_btt (platform: ststm32@~10.0; board: genericSTM32F103RC; framework: arduino)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------C:\Users\Robert.platformio\python3\python.exe: can’t open file ‘C:\Users\Robert.platformio\packages\tool-scons\scons.py’: [Errno 2] No such file or directory
============================================================================== [FAILED] Took 0.08 seconds ==============================================================================
Environment Status Duration


STM32F103RC_btt FAILED 00:00:00.078
======================================================================== 1 failed, 0 succeeded in 00:00:00.078 ========================================================================
PS C:\Users\Robert\Desktop\skr12> echo “done” >D:\Temp\ipc
PS C:\Users\Robert\Desktop\skr12>

and scons.py exist and I can open it with notepad+
!!!

I shall try an installation on my old laptop ( Macpro)
The problem is , maybe, linked at my old Windows 10 installation


Very weird if the file is there. Do you have some antivirus enabled on your system that could interfere? Can you temporarily disable it?

Also you can remove all folders within C:\Users\Robert\.platformio\packages\ and rebuild the project, and it should cleanly redownload all packages.

You can maybe also try the marlin version downloadable at https://github.com/MarlinFirmware/Marlin/archive/bugfix-2.0.x.zip for the bugfix-2.0.x branch, that may have a fixed script.

Hi,

This morning, I tried the compilation on my old Macbook( 10years); and it work perfectly!!!

The problem is certainly with my Windows 10 installation, :frowning:
The next step will be : a Windows reinstallation from scratch( but not for today
)

A great “THANKS” for your support, and for me this case is closed.

Robert