mbed-cli version: 1.7.3
I follow the instructions in the Mbed CLI README documentation for creating a new Mbed OS 2 program (https://github.com/ARMmbed/mbed-cli#creating-a-new-program-for-mbed-os-2) and I receive the following output:
~/Repos $ mbed new mbed-classic-program --mbedlib
[mbed] Creating new program "mbed-classic-program" (git)
[mbed] Adding library "builds" from "https://mbed.org/users/mbed_official/code/mbed/builds" at branch/tag "tip"
[mbed] Downloading library build "5aab5a7997ee" (might take a while)
[mbed] Unpacking library build "5aab5a7997ee" in "/Users/jenplu01/Repos/mbed-classic-program/builds"
[mbed] Unpacking library build "5aab5a7997ee" in "/Users/jenplu01/Repos/mbed-classic-program/builds"
[mbed] Updating reference "builds" -> "https://mbed.org/users/mbed_official/code/mbed/builds/5aab5a7997ee"
[mbed] WARNING: Cannot find the mbed tools directory in "/Users/jenplu01/Repos/mbed-classic-program"
---
Unlike in the README, the Mbed 2.0 build tools are not downloaded. So, when I try to use commands like mbed export, mbed compile etc. I get the following output:
~/Repos/mbed-classic-program $ mbed compile
[mbed] ERROR: The mbed tools were not found in "/Users/jenplu01/Repos/mbed-classic-program".
[mbed] ERROR: Run `mbed deploy` to install dependencies and tools.
---
~/Repos/mbed-classic-program $ mbed export
[mbed] ERROR: The mbed tools were not found in "/Users/jenplu01/Repos/mbed-classic-program".
[mbed] ERROR: Run `mbed deploy` to install dependencies and tools.
---
So then I try to run mbed deploy...
~/Repos/mbed-classic-program $ mbed deploy
[mbed] Updating library "builds" to rev #5aab5a7997ee
[mbed] WARNING: Cannot find the mbed tools directory in "/Users/jenplu01/Repos/mbed-classic-program"
---
And now I'm stuck in a loop of being unable to do anything with this new Mbed OS 2 directory.
same for 1.8.0
[Mirrored to Jira]
Thanks for verifying that this bug is still present.
[Mirrored to Jira]
Is this problem still existent? I've tried it now with actual mbed-cli 1.8.3 and the mbed libname is correct and also the tools are downloaded.
But I prefer to create an empty project and use 'mbed add https://os.mbed.com/users/mbed_official/code/mbed-dev/' for the source version which is much leaner than the mbedlib version.
There I have no tools and 'mbed deploy' does not load them. Mbed deploy detects a mbed classic by checking if file mbed.bld exists. Creating an empty mbed.bld is tweaking the deploy command and it will download the tools. But it would be cleaner if this could be done by a '--force-mbed2-tools' or similar switch. Would this make sense or is there already another trick to achive this?
@JojoS62 Thanks for the hint for creating an empty mbed.bld!
I am having the same errors, does someone know the solution?
@PhanLeSon03 Make sure your Mbed CLI is updated: pip install -U mbed-cli
If you encounter the fatal error: mbed.h: No such file or directory after running mbed compile follow the instructions on this thread: https://github.com/ARMmbed/mbed-cli/issues/805
Apologies, this was closed in error by the automated bot - re-opening.
Internal Jira reference: https://jira.arm.com/browse/IOTBTOOL-479
Most helpful comment
Is this problem still existent? I've tried it now with actual mbed-cli 1.8.3 and the mbed libname is correct and also the tools are downloaded.
But I prefer to create an empty project and use 'mbed add https://os.mbed.com/users/mbed_official/code/mbed-dev/' for the source version which is much leaner than the mbedlib version.
There I have no tools and 'mbed deploy' does not load them. Mbed deploy detects a mbed classic by checking if file mbed.bld exists. Creating an empty mbed.bld is tweaking the deploy command and it will download the tools. But it would be cleaner if this could be done by a '--force-mbed2-tools' or similar switch. Would this make sense or is there already another trick to achive this?