Yotta and CMAKE not build


Looked on the internet a lot but not found any solutions.

I’m currently following this tutorial https://docs.mbed.com/docs/getting-started-mbed-os/en/latest/FirstProjectmbedOS/
to create just a blinking program for LED1 with yotta.

But when I yotta build, I have the following error:

rotor# yt build
info: generate for target: stm32f411re-nucleo-gcc 0.1.1 at /home/rotor/Documents/mbed/blinky/yotta_targets/stm32f411re-nucleo-gcc
CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
error: command ['cmake', '-D', 'CMAKE_BUILD_TYPE=RelWithDebInfo', '-G', 'Ninja', '.'] failed

Sorry for the ‘noob’ question but can’t really find a solution :frowning:

Hi Nicolas,

No problem, thanks for raising the issue!

It looks like you don’t have “ninja” installed (which is the make tool that yotta uses internally, to track what needs to be rebuilt, and to run the build commands in parallel).

It looks like you’re using linux – you can install ninja on most linux platforms with sudo apt-get install ninja-build (for ubuntu/debian) or sudo yum install ninja-build (for red hat & similar).

After installing, you’ll need to run yotta clean before building again.

Hope that clears things up, let us know if you continue to experience any problems!


After a yaourt -S ninja I can perform a yt build but now I have a new error…

 yt build
info: generate for target: stm32f411re-nucleo-gcc 0.1.1 at /home/rotor/Documents/mbed/blinky/yotta_targets/stm32f411re-nucleo-gcc
GCC version is: arm-none-eabi-g++ (Arch Repository) 5.3.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO

CMake Warning at /home/rotor/Documents/mbed/blinky/yotta_modules/uvisor-lib/source/CMakeLists.txt:43 (message):

           * WARNING (uvisor-lib): unsupported platform; your code will still
           *                       work but no security feature is provided;
           *                       UVISOR_DISABLED is set by default

suppressing warnings from mbed-hal-st-stm32cubef4
-- Configuring done
-- Generating done
-- Build files have been written to: /home/rotor/Documents/mbed/blinky/build/stm32f411re-nucleo-gcc
[4/151] Building CXX object ym/uvisor-lib/source/CMakeFiles/uvisor-lib.dir/unsupported.cpp.o
FAILED: /usr/bin/arm-none-eabi-g++   -Igenerated/include -I/home/rotor/Documents/mbed/blinky -I/home/rotor/Documents/mbed/blinky/yotta_modules/mbed-drivers -I/home/rotor/Documents/mbed/blinky/yotta_modules/mbed-hal -I/home/rotor/Documents/mbed/blinky/yotta_modules/cmsis-core -I/home/rotor/Documents/mbed/blinky/yotta_modules/ualloc -I/home/rotor/Documents/mbed/blinky/yotta_modules/minar -I/home/rotor/Documents/mbed/blinky/yotta_modules/core-util -I/home/rotor/Documents/mbed/blinky/yotta_modules/compiler-polyfill -I/home/rotor/Documents/mbed/blinky/yotta_modules/mbed-hal-st -I/home/rotor/Documents/mbed/blinky/yotta_modules/mbed-hal-st-stm32f4 -I/home/rotor/Documents/mbed/blinky/yotta_modules/uvisor-lib -I/home/rotor/Documents/mbed/blinky/yotta_modules/mbed-hal-st-stm32cubef4 -I/home/rotor/Documents/mbed/blinky/yotta_modules/cmsis-core-st -I/home/rotor/Documents/mbed/blinky/yotta_modules/cmsis-core-stm32f4 -I/home/rotor/Documents/mbed/blinky/yotta_modules/dlmalloc -I/home/rotor/Documents/mbed/blinky/yotta_modules/minar-platform -I/home/rotor/Documents/mbed/blinky/yotta_modules/minar-platform-mbed -I/home/rotor/Documents/mbed/blinky/yotta_modules/cmsis-core/cmsis-core -I/home/rotor/Documents/mbed/blinky/yotta_modules/cmsis-core-stm32f4/cmsis-core-stm32f4 -I/home/rotor/Documents/mbed/blinky/yotta_modules/mbed-hal-st-stm32f4/mbed-hal-st-stm32f4 -I/home/rotor/Documents/mbed/blinky/yotta_modules/mbed-hal-st-stm32cubef4/mbed-hal-st-stm32cubef4 -I/home/rotor/Documents/mbed/blinky/yotta_modules/mbed-hal/mbed-hal -I/home/rotor/Documents/mbed/blinky/yotta_modules/mbed-drivers/mbed -fno-exceptions -fno-unwind-tables -ffunction-sections -fdata-sections -Wall -Wextra -fno-rtti -fno-threadsafe-statics -mcpu=cortex-m4 -mthumb -D__thumb2__ -Os -g -gdwarf-3 -DNDEBUG   -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -DMBED_OPERATORS -DTARGET_STM32F411RE_NUCLEO -DTARGET_STM32F411RE -DTARGET_STM32F4 -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -include "/home/rotor/Documents/mbed/blinky/build/stm32f411re-nucleo-gcc/yotta_config.h" -MMD -MT ym/uvisor-lib/source/CMakeFiles/uvisor-lib.dir/unsupported.cpp.o -MF ym/uvisor-lib/source/CMakeFiles/uvisor-lib.dir/unsupported.cpp.o.d -o ym/uvisor-lib/source/CMakeFiles/uvisor-lib.dir/unsupported.cpp.o -c /home/rotor/Documents/mbed/blinky/yotta_modules/uvisor-lib/source/unsupported.cpp
In file included from /home/rotor/Documents/mbed/blinky/yotta_modules/cmsis-core-stm32f4/cmsis-core-stm32f4/cmsis.h:35:0,
                 from /home/rotor/Documents/mbed/blinky/yotta_modules/cmsis-core/cmsis-core/cmsis_nvic.h:35,
                 from /home/rotor/Documents/mbed/blinky/yotta_modules/uvisor-lib/uvisor-lib/uvisor-lib.h:23,
                 from /home/rotor/Documents/mbed/blinky/yotta_modules/uvisor-lib/source/unsupported.cpp:17:
/home/rotor/Documents/mbed/blinky/yotta_modules/cmsis-core-stm32f4/cmsis-core-stm32f4/stm32f4xx.h:154:3: error: #error "Please select first the target STM32F4xx device used in your application (in stm32f4xx.h file)"
  #error "Please select first the target STM32F4xx device used in your application (in stm32f4xx.h file)"
In file included from /home/rotor/Documents/mbed/blinky/yotta_modules/cmsis-core-stm32f4/cmsis-core-stm32f4/stm32f4xx.h:213:0,
                 from /home/rotor/Documents/mbed/blinky/yotta_modules/cmsis-core-stm32f4/cmsis-core-stm32f4/cmsis.h:35,
                 from /home/rotor/Documents/mbed/blinky/yotta_modules/cmsis-core/cmsis-core/cmsis_nvic.h:35,
                 from /home/rotor/Documents/mbed/blinky/yotta_modules/uvisor-lib/uvisor-lib/uvisor-lib.h:23,
                 from /home/rotor/Documents/mbed/blinky/yotta_modules/uvisor-lib/source/unsupported.cpp:17:
/home/rotor/Documents/mbed/blinky/yotta_modules/mbed-hal-st-stm32cubef4/mbed-hal-st-stm32cubef4/stm32f4xx_hal.h:48:32: fatal error: stm32f4xx_hal_conf.h: No such file or directory
compilation terminated.
[4/151] Building C object ym/dlmalloc/source/CMakeFiles/dl...nts/mbed/blinky/yotta_modules/dlmalloc/source/dlmalloc.c.o
ninja: build stopped: subcommand failed.
error: command ['ninja'] failed

I’m really new to mbed, (a lot of arduino & c/c++) so sorry but don’t really understand everything !
I’m trying to do this tutorial

Lookgs like uvisor is not enabled but at this point is it really important ?

ualloc is buggy too ?

Thanks for the answer !

Hi, I need some more info - what is your target? Because #error "Please select first the target STM32F4xx device used in your application (in stm32f4xx.h file)" this is an error you are getting.

From the first code snippet, stm32f411re-nucleo-gcc is your target? I don’t think that one is fully supported. I can’t locate github repository to check now. It is pushed to yotta though. I’ll try to find out more about this target

cc @bcostm

Hi, Here is a screenshot of searching for my board NUCLEO-F411RE: http://i.imgur.com/n9IR8Yd.png
The thing I find strange is the result says gcc but I’m programming in cpp so need g++ right ?

It’s not official supported target, this was done by a community.

Look at https://github.com/rosterloh/target-st-stm32f411re-nucleo, this is the source for the published target. You can find under the user name, hal implementation for f411.

Okay thanks, I’ll have a look. But now I use the web IDE as it do the job well finally. Is there a reason where I should use yotta instead ?

Thanks for your help

I had to manually install cmake version 3.5.2 in Ubuntu 12.04. I ran the .sh file but it still didn’t work. I installed it into /usr/bin. Then it said cmake was missing the share files so I copied the share folder from the cmake tar file into usr/bin and then it finally worked. This seems a little undercooked.

Thanks for the feedback !

But now I use platformIO as it is a all-in-one package to manage and help you code for mbed and other plateforms like arduino.
It have an integration with many IDE ilke CLion, Atom etc… :slight_smile:

I have same problem as earlier reply expect that I am using Windows7:

I have installed:
pip 7.0.1
python 2.7.10
ninja 1.5.3
cmake 3.6.0-rc1

what should I do to solve that error?