PlatformIO Community

STSTM32 platform with Mbed framework build failing

I’m trying to re-build some binaries of a project that I know compile successfully, but ever since a few days ago, the build is failing. I’m using the Mbed framework with an STM32 board, and a particular line of code is failing during compile.

C:\Users<my username>.platformio\packages\framework-mbed@6.60600.210128\connectivity\nanostack\sal-stack-nanostack\source\Security\protocols\eap_tls_sec_prot\radius_eap_tls_sec_prot.c:589:1: fatal error: opening dependency
file .pio\build\pcb_f446ve_debug\FrameworkMbedconnectivity\nanostack\sal-stack-nanostack\source\Security\protocols\eap_tls_sec_prot\radius_eap_tls_sec_prot.d: No such file or directory

I’m looking in the folder, and indeed it’s not there. But why isn’t the compiler building that file for this particular code-base?

I’ve tried a few things to:

  • re-installing PlatformIO from scratch,
  • tried alternate platform versions platform=ststm32@, tried V13, 12 and 11.
  • I also tried alternate platform_packages versions in my platformio.ini file. Even though some of the older platform versions had their own matching versions.
  • deleting both the .vscode and .pio folders in project to force it to re-build those
  • deleting the packages/framework-mbed folders, so that PIO re-downloads them from scratch. Having tried different versions, I had 5 of them.

Working with a freshly created project does not repeat the same error but the code referenced is a part of the Mbed framework, not my code.

Oddly enough, this is only happening on my Windows 10 machine, but not on my Ubuntu machine with the same configuration and same exact code base. On Ubuntu, it compiles just fine with the latest version of ststm32 platform and framework (and quicker too).

I’m not sure what else I can try to troubleshoot this issue? The only thing I can think of, is I recently made some changes to my standard C++ environment, so maybe it’s affected some of the default compiler choices in PIO? I can’t think why because it’s a totally different toolchain…

Okay so I figured it out. This had something to do with the folder it was in. I moved it to another folder and now it compiles fine. My theory is that it had to do with really long file paths causing issues. Might not be a bug necessarily as I know Windows has a few issues with long folder paths too.

That’s also my impression with any error that has “No such file or directory” in it with the file actually existing: Filepath too long.

Out of curiosity, do you think this a long file path issue caused by PIO or Windows?

Well if the framework (mbed-os) is layed out that way to have this deep folder structure, PlatformIO doesn’t really have a choice but to use these long filenames. Windows not liking them due to the legacy limitation is the bad thing.

On a sidenote, I’ve had the “Long NTFS paths” option turned on in Windows for a very long time (and also re-enabled them in recent builds), but it doesn’t seem to have helped much :frowning: Maybe you have better luck.