ARM mbed: Compilation of project with long file paths not possible
See original GitHub issueWhat kind of issue is this?
- PlatformIO Core. If you’ve found a bug, please provide an information below.
Configuration
Operating system: Windows 10 x64
PlatformIO Version (platformio --version
): 4.0.1b3
Description of problem
When compiling the sample project given below, compilation fails as soon as the first source file of an external library or the main project is compiled. The occurring error is
arm-none-eabi-g++: error: CreateProcess: No such file or directory
Which might hint at file path length problems (see https://github.com/MarlinFirmware/Marlin/issues/7967).
Steps to Reproduce
- Import the sample project given below
- Before compiling, execute
git config --system core.longpaths true
, otherwise th git clone will fail due to overlong filepaths - Compile on Windows 10
- Observer error message
Actual Results
Processing nucleo_l152re (platform: ststm32; board: nucleo_l152re; framework: mbed)
CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/nucleo_l152re.html
PLATFORM: ST STM32 5.5.0 > ST Nucleo L152RE
HARDWARE: STM32L152RET6 32MHz, 80KB RAM, 512KB Flash
DEBUG: Current (stlink) On-board (stlink) External (blackmagic, jlink)
PACKAGES: toolchain-gccarmnoneeabi 1.70201.0 (7.2.1), framework-mbed 5.51204.190701 (5.12.4)
Collecting mbed sources...
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 1 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <ArduinoCore-nRF528x-mbedos> #a4b622b [git+https://github.com/arduino/ArduinoCore-nRF528x-mbedos.git] (C:\Users\Maxi\Documents\stackoverflow_testing\.pio\libdeps\nucleo_l152re\ArduinoCore-nRF528x-mbedos)
arm-none-eabi-g++ -o .pio\build\nucleo_l152re\src\main_esp.o -c -std=gnu++98 -fno-rtti [...] @"C:\Users\Maxi\Documents\stackoverflow_testing\.pio\build\nucleo_l152re\longcmd-7828fe635133cd1a11dd36e80ff553da" src\main_esp.cpp
arm-none-eabi-g++: error: CreateProcess: No such file or directory
Expected Results
Compilation success.
If problems with PlatformIO Build System:
The content of platformio.ini
:
[env:nucleo_l152re]
platform = ststm32
board = nucleo_l152re
framework = mbed
build_flags = -D PIO_FRAMEWORK_MBED_RTOS_PRESENT
lib_deps = https://github.com/arduino/ArduinoCore-nRF528x-mbedos.git
Source file to reproduce issue:
// Arduino code
#include "Arduino.h"
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
Serial.begin(115200);
Serial.println("Welcome to Arduino on Mbed OS");
}
void loop() {
digitalWrite(LED_BUILTIN, HIGH);
Serial.println("LED is now on!");
delay(1000);
digitalWrite(LED_BUILTIN, LOW);
Serial.println("LED is now off!");
delay(1000);
}
// Mbed OS code
int main() {
setup();
while (1) loop();
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:14 (9 by maintainers)
Top Results From Across the Web
CLI documentation is very incomplete - Mbed
I'm getting started using the mbed-cli, and it seems like either this is a very primitive tool, or else there's just no documentation...
Read more >Solved: Cannot do "mbed new ." again after an error
1. You must re-run "mbed new ." with every new project, instead of just putting it in one place. If you need to...
Read more >MBED_ARM_PATH set as environment variable but doesn't ...
and so on. So MBED_ARM_PATH is not valid. Nevertheless compilation works fine. What is the problem?? path · compilation · mbed.
Read more >mbed-cli 1.8.3 - PyPI
Arm Mbed CLI is the name of the Arm Mbed command-line tool, ... Add your main.cpp file and other project files to the...
Read more >CMake cygwin paths not found by GCC ARM compiler (Mbed ...
Mbed exports the project for CMake, which I am able to compile using the commands described in Working version without CLion below. See...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@valeros Another example of this problem has popped up in https://community.platformio.org/t/avr-g-error-createprocess-no-such-file-or-directory/12046/13?u=maxgerhardt, where compilation of a PlatformIO provided example project fails (https://github.com/platformio/platform-nordicnrf52/tree/master/examples/mbed-ble-thermometer).
I am able to reproduce that error
And again the long command has 32720 bytes
However the longcommand is also full of include directories for components not used in the project or thohse who would not appear during a real mbed-os build. It seems the generating code just recursively adds all folder paths to the list, while only excluding some? This code would need a rework if not even PIO’s example projects can be compiled…
@prostoAlexandr It’s a known issue, try to use
packages_dir
option so the include paths will be shorter, for example: