1

I made project like tutorial https://blog.jetbrains.com/clion/2019/02/clion-2019-1-eap-clion-for-embedded-development-part-iii/?gclid=CjwKCAjwhOD0BRAQEiwAK7JHmKUzvoJnORtCn3YxpsSb00Ep_dE0gNQOytiXVgFj6EXOjyCAIH9XTBoCngQQAvD_BwE&gclsrc=aw.ds

I get arm toolchain from https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads

Add bin folder to PATH by .bashrc. Console command runs good:

$ arm-none-eabi-gcc
arm-none-eabi-gcc: fatal error: no input files

After make project in Clion with STM32CubeMX cmake not configure:

-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- The ASM compiler identification is unknown
-- Found assembler: arm-none-eabi-gcc
CMake Error at CMakeLists.txt:34 (PROJECT):
  The CMAKE_C_COMPILER:

    arm-none-eabi-gcc

  is not a full path and was not found in the PATH.

  Tell CMake where to find the compiler by setting either the environment
  variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
  the compiler, or to the compiler name if it is in the PATH.

But bin folder already in PATH!!!

Clion see compilers if install toolchail by pacman or copy all content of bin folder to /usr/bin/, but not found other files like nano.specs, nosys.specs, stdint.h and other includes.

I don't know how point Clion and CubeMX right path to toolchain.

2 Answers2

0

It seems that your cmake cannot find C/C++ compiler. In CLion Toolchain setting you can specify paths to compiler (arm-none-eabi-gcc and arm-none-eabi-g++ in your case) or just pass them to CMkae via CMAKE_C_COMPILER and CMAKE_CXX_COMPILER defines.

Maxim Banaev
  • 886
  • 1
  • 9
  • 22
  • There is no effect to specify path in toolchain setting! Define CMAKE_C_COMPILER and CMAKE_CXX_COMPILER defines by by STM32CubeMX. If define CMAKE_C_COMPILER and CMAKE_CXX_COMPILER in environment of clion there is no effect too. – Tarletsky Andrey Apr 18 '20 at 16:08
0

I also encountered this issue. I found that the reason is that Clion only uses the system environment variables at the time it was launched. The problem is most likely that you added ARM-related environment variables after Clion was launched, and the subsequent terminals used the environment variables from the launch.

The solution is to restart Clion.

zanpoc
  • 1