cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeIDE sample program compiling error

nh7
Associate

Hi,

I try to compile "OpenAMP_TTY_echo_CM33_NonSecure" sample program as suggested here:

https://wiki.st.com/stm32mpu/wiki/Getting_started/STM32MP2_boards/STM32MP257x-DK/Develop_on_Arm_Cortex-M33/Modify,_rebuild_and_reload_the_firmware

Compiling does not work, I get error message:

 

0:43:14 **** Build of configuration CA35TDCID_m33_ns_sign for project OpenAMP_TTY_echo_CM33_NonSecure ****

make -j16 all

cmake -S ../../../../../../../../../Middlewares/Third_Party/OpenAMP/libmetal/ -B libmetal -G"Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=cmake/platforms/stm32mp-generic-gcc.cmake

CMake Error at CMakeLists.txt:1 (cmake_minimum_required):

-- Configuring incomplete, errors occurred!

Compatibility with CMake < 3.5 has been removed from CMake.

 

Update the VERSION argument <min> value. Or, use the <min>...<max> syntax

to tell CMake that the project requires at least <min> but has been updated

to work with policies introduced by <max> or earlier.

 

Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.

 

 

make[1]: *** [makefile:104: pre-build] Error 1

make: *** [makefile:72: all] Error 2

"make -j16 all" terminated with exit code 2. Build might be incomplete.

 

10:43:15 Build Failed. 2 errors, 0 warnings. (took 626ms)

 

-------------------

 

I have cmake 4.0.2 installed. I tried in Ubuntu and Windows, same error.

Can you please help?

 

 

2 REPLIES 2
HimanshuT
ST Employee

Hi @nh7 ,

You can add argument as  -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to the command as shown in the error or you can use cmake version 3.XX (For example 3.31.6).

 

mattewwade06
Associate

Thanks for sharing the detailed error log it definitely helps narrow things down. The issue seems to stem from a mismatch between the CMakeLists.txt in the OpenAMP project and the newer version of CMake you're using (v4.0.2). Some older CMake scripts expect backward compatibility, which is stricter in newer versions.

You could try one of the following:

  1. Edit the CMakeLists.txt file and update the cmake_minimum_required(VERSION ...) line to reflect your version e.g., cmake_minimum_required(VERSION 3.5...4.0).

  2. Add this to your build command:
    -DCMAKE_POLICY_VERSION_MINIMUM=3.5
    This might bypass the policy version check.

  3. Alternatively, if possible, try using an older version of CMake (e.g., 3.22) that's known to work with STM32CubeIDE and OpenAMP projects. Sometimes that's the quickest workaround.