Cannot find the mbed tools directory

Hello, I trying to compile project: https://github.com/ARM-software/ML-KWS-for-MCU/tree/master/Deployment, which was created by mbed. I worked with kws_realtime_test project for STM32F746NG board. I m trying to compile on Windows7 machine in command line.

I made step by step everything by the attached README.md file, from an above mentioned project.

When I call mbed deploy, than I get a warning message:

[mbed] WARNING: Cannot find the mbed tools directory in “D:\KWDetectOn746Dev_v00\Deploy\kws_realtime_test”

And when I try to compile than I get an error:

[mbed] ERROR: The mbed tools were not found in “D:\KWDetectOn746Dev_v00\Deploy\kws_realtime_test”.
You can run “mbed deploy” to install dependencies and tools.

On some forum I read, that I need to add mbed-os to my project
Link: warning The mbed tools were not found in .. - Question | Mbed

When I add that, I can deploy the project without any warning, but I have an error after compile:

Include
[ERROR] Library name ‘platform’ is not unique (defined in ‘D:\KWDetectOn746Dev_v00\Deploy\kws_realtime_test\mbed\65be27845400\TARGET_DISCO_F746NG\TOOLCHAIN_GCC_ARM\mbed_lib.json’ and ‘D:\KWDetectOn746Dev_v00\Deploy\kws_realtime_test\mbed-os\platform\mbed_lib.json’)
[mbed] Working path “”

I tried to remove one of .json files, and the compilation finally can start, but after 10% I get many compiler errors. My compiler cant compile source files from mbed-os directory. Im using GNU GCC compiler.

Part of error messages:

Compile [ 11.6%]: AUDIO_DISCO_F746NG.cpp
[Error] c++0x_warning.h@32,2: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
[Warning] Kernel.h@87,5: identifier ‘constexpr’ is a keyword in C++11 [-Wc++11-compat]
[Warning] mstd_new@43,1: identifier ‘noexcept’ is a keyword in C++11 [-Wc++11-compat]
[Warning] mstd_new@45,5: identifier ‘static_assert’ is a keyword in C++11 [-Wc++11-compat]
[Warning] mstd_type_traits@327,22: identifier ‘decltype’ is a keyword in C++11 [-Wc++11-compat]
[Warning] Callback.h@203,5: identifier ‘nullptr’ is a keyword in C++11 [-Wc++11-compat]
[Warning] Kernel.h@74,15: defaulted and deleted functions only available with ‘-std=c++11’ or ‘-std=gnu++11’
[Error] Kernel.h@76,11: expected nested-name-specifier before ‘duration’
[Error] Kernel.h@77,11: expected nested-name-specifier before ‘rep’
[Error] Kernel.h@78,11: expected nested-name-specifier before ‘period’
[Error] Kernel.h@80,11: expected nested-name-specifier before ‘time_point’
[Error] Kernel.h@87,12: ‘constexpr’ does not name a type
[Error] Kernel.h@88,12: ‘time_point’ does not name a type
[Error] Kernel.h@95,11: expected nested-name-specifier before ‘duration_u32’
[Error] Kernel.h@114,1: ‘constexpr’ does not name a type
[Error] Kernel.h@120,1: ‘constexpr’ does not name a type

  • So how can I compile that project?
  • Why I need mbed-os to my project? It is not mentioned in readme file. Is it not enough to install mbed-tools, and no whole mbed-os? I think my project do not use any OS functionality.

I 'm working on a compilation of a simple project few days, and is going to be a really nightmare for me.

Are there any simpler way to precompile this project?

Hello Béla,

The KWS project site suggests to create a simple KWS interface program by running the command:

mbed new kws_simple_test --mbedlib 

According to the mbed-cli documentation the --mbedlib option is used when creating a mbed os 2 program.

  • Unfortunately, ARM doesn’t support mbed os 2 anymore and the --mbedlib option has no effect. Consequently, no mbed library is downloaded to the kws_simple_test folder by such command. You have to do that manually from https://github.com/ARMmbed/mbed-dev. Copy the downloaded .zip file to the kws_simple_test folder and unzip. Then rename the mbed-dev-master folder to mbed and issue the mbed deploy command (from the kws_simple_test folder) to install the mbed tools into the mbed folder.

  • Another option is to create a mbed bare-metal project (mbed os 6 without os) rather than a mbed os 2. For more info have a look at https://os.mbed.com/docs/mbed-os/v6.1/bare-metal/index.html.

Best regards, Zoltán

1 Like

Hello Zoltán,

Mine main plan was to compile the: kws_realtime_test not the kws_simple_test.

But I tried to compile the kws_simple_test proj, too. After project creating with

mbed new kws_simple_test --mbedlib

this automatically downloads the mbed library, but I think it was not complete. When I compare it by a web resource: mbed - The official Mbed 2 C/C++ SDK provides the softwa… | Mbed, than I cant found the drivers, hal and platform folders and the mbed.h file, too. So I copy them manually, and than I can compile the project.

With the same method I can compile the realtime version, too.

With the downloaded mbed-dev library I cant compile the project, but it is already not important for me.

So thanks for help.

Hi Kiraly

The above is mbed2 as is mbed-dev!
Neither are supported any more. Mbed-os versions 5 and 6 are both still supported and on GitHub.

Regards
Anna

The mbed-os tools were not found
I have tried many times over many days installing and uninstalling over and over again.
I installed the v0.4.10 Windows CLI
I installed developer tools

c:\Users\jimfr\source\ATB-PoC\apps\mbed\mbed-os-example-blinky>mbed detect
[mbed] Working path “c:\Users\jimfr\source\ATB-PoC\apps\mbed\mbed-os-example-blinky” (library)
[mbed] Program path “c:\Users\jimfr\source\ATB-PoC\apps\mbed\mbed-os-example-blinky”
[mbed] WARNING: The mbed-os tools were not found in “c:\Users\jimfr\source\ATB-PoC\apps\mbed\mbed-os-example-blinky”.

c:\Users\jimfr\source\ATB-PoC\apps\mbed>mbed deploy
[mbed] Working path “c:\Users\jimfr\source\ATB-PoC\apps\mbed” (library)
[mbed] Program path “c:\Users\jimfr\source\ATB-PoC\apps\mbed”
[mbed] Updating library “ABEncoder\mbed-os” to rev #e917282d6072
[mbed] Updating library “mbed-os-example-blinky\mbed-os” to rev #d6784c3ee6ad (tags: mbed-os-6.6.0, mbed-os-6.6.0-rc1)
[mbed] WARNING: Cannot find the mbed tools directory in “c:\Users\jimfr\source\ATB-PoC\apps\mbed”

Tried removing and adding mbed-os
c:\Users\jimfr\source\ATB-PoC\apps\mbed\mbed-os-example-blinky>mbed remove mbed-os
[mbed] Working path “c:\Users\jimfr\source\ATB-PoC\apps\mbed\mbed-os-example-blinky” (library)
[mbed] Program path “c:\Users\jimfr\source\ATB-PoC\apps\mbed\mbed-os-example-blinky”
[mbed] Removing library “mbed-os” in “c:\Users\jimfr\source\ATB-PoC\apps\mbed\mbed-os-example-blinky\mbed-os”

c:\Users\jimfr\source\ATB-PoC\apps\mbed\mbed-os-example-blinky>mbed add mbed-os
[mbed] Working path “c:\Users\jimfr\source\ATB-PoC\apps\mbed\mbed-os-example-blinky” (library)
[mbed] Program path “c:\Users\jimfr\source\ATB-PoC\apps\mbed\mbed-os-example-blinky”
[mbed] Adding library “mbed-os” from “GitHub - ARMmbed/mbed-os: Arm Mbed OS is a platform operating system designed for the internet of things” at latest revision in the current branch
[mbed] Updating reference “mbed-os” → “GitHub - ARMmbed/mbed-os: Arm Mbed OS is a platform operating system designed for the internet of things
[mbed] WARNING: Cannot find the mbed tools directory in “c:\Users\jimfr\source\ATB-PoC\apps\mbed\mbed-os-example-blinky”

I’m so frustrated!
Please help.
Thank you.

Hi
did you run the windows installer found here : Install and set up - Build tools | Mbed OS 6 Documentation ? Did you also make sure you have the correct dependencies (such as Python version installed) ?

Regards
Anna

Hello Anna,

Thank you for your response.
Yes, I ran the Windows setup in the link below.
This is my Python version:

c:\Users\jimfr\source\ATB-PoC>py --version
Python 3.7.9

What else can I check?
I really appreciate your help.
I am very anxious to get mbed working.

Thank you,
Jim

Oh, and here is the mbed CLI version:

c:\Users\jimfr\source\ATB-PoC>mbed cli --version
1.8.3

Is that correct?

Thanks again,
Jim

I am unable to get mbed installed on my Windows 10. I can’t get past
WARNING: The mbed-os tools were not found

I describe below the steps I went through to install mbed.
I hope you can point out where I went wrong.
I would be very grateful for your help.

Thank you so much.

Jim Frandeen

I started here:

Installing Mbed CLI - Quick start | Mbed OS 6 Documentation

I downloaded and ran the Windows Installer for Mbed CLI :Mbed_installer_v0.4.10.exe

All options were checked(python, mbed, git-scm, mercurial, gcc) except mbed serial driver, which was greyed out.

Installation was successful.

C:\Users\jimfr>mbed --version

1.8.3

I tried the mbed detect command:

C:\Users\jimfr>mbed detect

[mbed] Working path “C:\Users\jimfr” (directory)

[mbed] Program path “C:\Users\jimfr”

[mbed] WARNING: The mbed-os tools were not found in “C:\Users\jimfr”.

Limited information will be shown about connected targets/boards

I went to the “Install and set up – Build tools | Mbed OS 6 Documentation”

I followed the instructions to download and install Python 3.7.x

I installed Python 3.8.7 (64-bit)

I checked Install Launcher and Add Python 3.8 to Path

I tried out the python commands in the Command window:

C:\Users\jimfr>python

Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32 bit (Intel)] on win32

Type “help”, “copyright”, “credits” or “license” for more information.

quit

Use quit() or Ctrl-Z plus Return to exit

quit()

C:\Users\jimfr>python3

‘python3’ is not recognized as an internal or external command,

operable program or batch file.

C:\Users\jimfr>py

Python 3.8.7 (tags/v3.8.7:6503f05, Dec 21 2020, 17:59:51) [MSC v.1928 64 bit (AMD64)] on win32

Type “help”, “copyright”, “credits” or “license” for more information.

quit()

I followed the instructions to install one of the supported compilers.

Install a compiler

Windows 32-bit Installer (Signed for Windows 10 and later) (Formerly SHA2 signed binary)

MD5: 41e9514904a1ee43d4f7882b47bc0294

C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2020-q4-major>

I tried mbed detect again:

C:\WINDOWS\system32>mbed detect

[mbed] Working path “C:\WINDOWS\system32” (directory)

[mbed] Program path “C:\WINDOWS\system32”

[mbed] WARNING: The mbed-os tools were not found in “C:\WINDOWS\system32”.

Limited information will be shown about connected targets/boards

C:\WINDOWS\system32>mbed config -G ARM_PATH “C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2020-q4-major”

[mbed] Working path “C:\WINDOWS\system32” (directory)

[mbed] Program path “C:\WINDOWS\system32”

[mbed] C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2020-q4-major now set as global ARM_PATH

C:\WINDOWS\system32>mbed detect

[mbed] Working path “C:\WINDOWS\system32” (directory)

[mbed] Program path “C:\WINDOWS\system32”

[mbed] WARNING: The mbed-os tools were not found in “C:\WINDOWS\system32”.

Limited information will be shown about connected targets/boards

Maybe I should have installed Python 32-bit instead of 64-bit.

I uninstalled Python 64-bit and installed Python 3.8.7 (32-bit)

Setup was successful.

I tried mbed detect again:

c:>mbed detect

[mbed] Working path "c:" (directory)

[mbed] Program path "c:"

[mbed] WARNING: The mbed-os tools were not found in "c:".

Limited information will be shown about connected targets/boards

Hi Jim

I think the commands you are trying to use are designed to be run from within an Mbed app or mbed-os itself. Try this:

mbed new test
cd test
mbed detect

Regards
Anna

Hi, I am facing a similar issue while compiling the KWS project. I reached to 98.5% and got error see below. Please let me know how to fix this problem. Thank you.
Project details: Hello Edge: Keyword spotting on Microcontrollers](https://arxiv.org/pdf/1711.07128.pdf
Board: STM32F746 Disco
mbed-cli v1.8.3 (download via windows installer)
python 2.7.x( download via windows installer)
using mbedOS libraries

Compile [ 98.3%]: arm_nn_softmax_common_s8.c
Compile [ 98.4%]: arm_softmax_u8.c
Compile [ 98.5%]: kws.cpp
[Error] arm_acle.h@48,49: invalid conversion from ‘const void*’ to ‘const int*’ [-fpermissive]
[Error] arm_acle.h@55,50: invalid conversion from ‘const void*’ to ‘const int*’ [-fpermissive]
[Error] arm_acle.h@62,49: invalid conversion from ‘void*’ to ‘int*’ [-fpermissive]
[Error] arm_acle.h@69,50: invalid conversion from ‘void*’ to ‘int*’ [-fpermissive]
[Error] arm_acle.h@100,50: invalid conversion from ‘const void*’ to ‘const int*’ [-fpermissive]
[Error] arm_acle.h@107,51: invalid conversion from ‘const void*’ to ‘const int*’ [-fpermissive]
[Error] arm_acle.h@114,50: invalid conversion from ‘void*’ to ‘int*’ [-fpermissive]
[Error] arm_acle.h@121,51: invalid conversion from ‘void*’ to ‘int*’ [-fpermissive]
[Error] nn.h@28,25: ‘q7_t’ has not been declared
[Error] nn.h@28,40: ‘q7_t’ has not been declared
[Error] kws.cpp@72,33: no matching function for call to ‘NN::run_nn(q7_t*&, q7_t*&)’
[Error] kws.cpp@74,47: ‘arm_softmax_q7’ was not declared in this scope
[ERROR] In file included from …/CMSIS-NN/Include/arm_nn_math_types.h:94:0,
from …/CMSIS-NN/Include/arm_nnfunctions.h:114,
from …/Source/NN/nn.h:22,
from …/Source\KWS\kws.h:23,
from …/Source\KWS\kws.cpp:24:
c:\program files (x86)\gnu tools arm embedded\6 2017-q2-update\lib\gcc\arm-none-eabi\6.3.1\include\arm_acle.h: In function ‘void __arm_ldc(unsigned int, unsigned int, const void*)’:
c:\program files (x86)\gnu tools arm embedded\6 2017-q2-update\lib\gcc\arm-none-eabi\6.3.1\include\arm_acle.h:48:49: error: invalid conversion from ‘const void*’ to ‘const int*’ [-fpermissive]
return __builtin_arm_ldc (__coproc, __CRd, __p);
^
: note: initializing argument 3 of ‘void __builtin_arm_ldc(unsigned int, unsigned int, const int*)’
c:\program files (x86)\gnu tools arm embedded\6 2017-q2-update\lib\gcc\arm-none-eabi\6.3.1\include\arm_acle.h: In function ‘void __arm_ldcl(unsigned int, unsigned int, const void*)’:
c:\program files (x86)\gnu tools arm embedded\6 2017-q2-update\lib\gcc\arm-none-eabi\6.3.1\include\arm_acle.h:55:50: error: invalid conversion from ‘const void*’ to ‘const int*’ [-fpermissive]
return __builtin_arm_ldcl (__coproc, __CRd, __p);
^
: note: initializing argument 3 of ‘void __builtin_arm_ldcl(unsigned int, unsigned int, const int*)’
c:\program files (x86)\gnu tools arm embedded\6 2017-q2-update\lib\gcc\arm-none-eabi\6.3.1\include\arm_acle.h: In function ‘void __arm_stc(unsigned int, unsigned int, void*)’:
c:\program files (x86)\gnu tools arm embedded\6 2017-q2-update\lib\gcc\arm-none-eabi\6.3.1\include\arm_acle.h:62:49: error: invalid conversion from ‘void*’ to ‘int*’ [-fpermissive]
return __builtin_arm_stc (__coproc, __CRd, __p);
^
: note: initializing argument 3 of ‘void __builtin_arm_stc(unsigned int, unsigned int, int*)’
c:\program files (x86)\gnu tools arm embedded\6 2017-q2-update\lib\gcc\arm-none-eabi\6.3.1\include\arm_acle.h: In function ‘void __arm_stcl(unsigned int, unsigned int, void*)’:
c:\program files (x86)\gnu tools arm embedded\6 2017-q2-update\lib\gcc\arm-none-eabi\6.3.1\include\arm_acle.h:69:50: error: invalid conversion from ‘void*’ to ‘int*’ [-fpermissive]
return __builtin_arm_stcl (__coproc, __CRd, __p);
^
: note: initializing argument 3 of ‘void __builtin_arm_stcl(unsigned int, unsigned int, int*)’
c:\program files (x86)\gnu tools arm embedded\6 2017-q2-update\lib\gcc\arm-none-eabi\6.3.1\include\arm_acle.h: In function ‘void __arm_ldc2(unsigned int, unsigned int, const void*)’:
c:\program files (x86)\gnu tools arm embedded\6 2017-q2-update\lib\gcc\arm-none-eabi\6.3.1\include\arm_acle.h:100:50: error: invalid conversion from ‘const void*’ to ‘const int*’ [-fpermissive]
return __builtin_arm_ldc2 (__coproc, __CRd, __p);
^
: note: initializing argument 3 of ‘void __builtin_arm_ldc2(unsigned int, unsigned int, const int*)’
c:\program files (x86)\gnu tools arm embedded\6 2017-q2-update\lib\gcc\arm-none-eabi\6.3.1\include\arm_acle.h: In function ‘void __arm_ldc2l(unsigned int, unsigned int, const void*)’:
c:\program files (x86)\gnu tools arm embedded\6 2017-q2-update\lib\gcc\arm-none-eabi\6.3.1\include\arm_acle.h:107:51: error: invalid conversion from ‘const void*’ to ‘const int*’ [-fpermissive]
return __builtin_arm_ldc2l (__coproc, __CRd, __p);
^
: note: initializing argument 3 of ‘void __builtin_arm_ldc2l(unsigned int, unsigned int, const int*)’
c:\program files (x86)\gnu tools arm embedded\6 2017-q2-update\lib\gcc\arm-none-eabi\6.3.1\include\arm_acle.h: In function ‘void __arm_stc2(unsigned int, unsigned int, void*)’:
c:\program files (x86)\gnu tools arm embedded\6 2017-q2-update\lib\gcc\arm-none-eabi\6.3.1\include\arm_acle.h:114:50: error: invalid conversion from ‘void*’ to ‘int*’ [-fpermissive]
return __builtin_arm_stc2 (__coproc, __CRd, __p);
^
: note: initializing argument 3 of ‘void __builtin_arm_stc2(unsigned int, unsigned int, int*)’
c:\program files (x86)\gnu tools arm embedded\6 2017-q2-update\lib\gcc\arm-none-eabi\6.3.1\include\arm_acle.h: In function ‘void __arm_stc2l(unsigned int, unsigned int, void*)’:
c:\program files (x86)\gnu tools arm embedded\6 2017-q2-update\lib\gcc\arm-none-eabi\6.3.1\include\arm_acle.h:121:51: error: invalid conversion from ‘void*’ to ‘int*’ [-fpermissive]
return __builtin_arm_stc2l (__coproc, __CRd, __p);
^
: note: initializing argument 3 of ‘void __builtin_arm_stc2l(unsigned int, unsigned int, int*)’
In file included from …/Source\KWS\kws.h:23:0,
from …/Source\KWS\kws.cpp:24:
…/Source/NN/nn.h: At global scope:
…/Source/NN/nn.h:28:25: error: ‘q7_t’ has not been declared
virtual void run_nn(q7_t* in_data, q7_t* out_data)=0;
^~~~
…/Source/NN/nn.h:28:40: error: ‘q7_t’ has not been declared
virtual void run_nn(q7_t* in_data, q7_t* out_data)=0;
^~~~
…/Source\KWS\kws.cpp: In member function ‘void KWS::classify()’:
…/Source\KWS\kws.cpp:72:33: error: no matching function for call to ‘NN::run_nn(q7_t*&, q7_t*&)’
nn->run_nn(mfcc_buffer, output);
^
In file included from …/Source\KWS\kws.h:23:0,
from …/Source\KWS\kws.cpp:24:
…/Source/NN/nn.h:28:18: note: candidate: virtual void NN::run_nn(int*, int*)
virtual void run_nn(q7_t* in_data, q7_t* out_data)=0;
^~~~~~
…/Source/NN/nn.h:28:18: note: no known conversion for argument 1 from ‘q7_t* {aka signed char*}’ to ‘int*’
…/Source\KWS\kws.cpp:74:47: error: ‘arm_softmax_q7’ was not declared in this scope
arm_softmax_q7(output,num_out_classes,output);
^

[mbed] ERROR: “C:\Python27\python.exe” returned error.
Code: 1
Path: “C:\prj_KWS\Deployment\ML-KWS-for-MCU\Deployment\kws_realtime_test”
Command: “C:\Python27\python.exe -u C:\prj_KWS\Deployment\ML-KWS-for-MCU\Deployment\kws_realtime_test\tools\make.py -t GCC_ARM -m DISCO_F746NG --profile …/release_O3.json --source . --source …/Source --source …/Examples/realtime_test --source …/CMSIS-NN/Include --source …/CMSIS-NN/Source --source …/CMSIS-DSP/Include --source …/CMSIS-DSP/PrivateInclude --source …/CMSIS-DSP/Source --source …/CMSIS_5/CMSIS/Core/Include --build .\BUILD\DISCO_F746NG\GCC_ARM-RELEASE_O3 -j 8”