Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob

Solve ModusToolbox Compilation Error: No Such File or Directory

Solve ModusToolbox Compilation Error: No Such File or Directory

Charles_Lai
Moderator
Moderator
Moderator
500 replies posted 250 solutions authored 250 sign-ins

Compiling a project in ModusToolbox could sometimes run into the error: No such file or directory. If you confirm the file does exist and you are using Windows, then you might encounter the Path Length Limitation issue on Windows.

What is The Problem?

The error looks like this:

Linking output file mtb-example-ml-gesture-classification.elf
arm-none-eabi-g++.exe: error: ../mtb_shared/ml-tflite-micro/release-v2.0.0/COMPONENT_ML_TFLM_INTERPRETER/COMPONENT_CM4/COMPONENT_IFX_CMSIS_NN/COMPONENT_HARDFP/TOOLCHAIN_GCC_ARM/libtensorflow-microlite.a: No such file or directory

The key point is that the file path is noticeably long, especially since it contains relative pathnames "..", which is inflated by its parent path finally.

According to Windows Documentation: Maximum Path Length Limitation,  the maximum length for a path on Windows is 260 characters by default. But it's usually short for ModusToolbox build system. If 260 characters are exceeded, the file system will reject the path, resulting in the error: No file or directory.

How to Solve the Problem?

According to the Windows Documentation, You need to run the following command in PowerShell (or the equivalent way documented in that article):

New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" `
-Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force

Then reboot to see if the problem disappears.

0 Likes
638 Views