5 years, 8 months ago.

mbed cli import a specific revision number

Dear team,

at the moment I'm experiencing with mbed cli and I use the following command:

mbed import <my-url>

it imports the latest revision for each library included in the project even if in the project I'm using an older revision. So at the moment I'm solving using this way out:

mbed ls    // to check the library revision
del <directory library name>
mbed add <library url>#revision-number

Is there any better way to import directly the revision number I wish?

Thanks, Fabio

2 Answers

5 years, 8 months ago.

Hi Fabio,

You can alter your .lib file in the project (such as mbed-os.lib or a specific library <insert-approrate-library-name-her>.lib) to point to a particular version

For example: https://os.mbed.com/teams/mbed-os-examples/code/mbed-os-example-blinky/ has a mbed-os.lib pointing to a particular commit.

Another example: mbed import https://os.mbed.com/users/mudassar0121/code/example-C030-out-of-box-demo/

$ mbed ls
example-C030-out-of-box-demo (4d61a0f32573)
|- battery-charger-bq24295 (2a758bf86bb7)
|- gnss (56eda66d585b)
`- mbed-os (569159b784f7)

Each of the above libraries are pointing the particular commits shown in the output of mbed ls command. Please try setting the revision appropriately and retry.

Hope that helps. Please let us know if you have any further question.

- Naveen, Team mbed.

Accepted Answer

Also, please try mbed deploy command. For more details refer https://github.com/ARMmbed/mbed-cli#importing-an-existing-program which may help.

posted by Naveen Kaje 20 Aug 2018
5 years, 8 months ago.

Hi Fabio,

Adding onto Naveen's comment, you can also use the Mbed CLI to update a library to a specific revision number or tag with the following commands:

For example, I want to update my existing copy of Mbed OS to the 5.9.4 release:

// within root project folder
$ cd mbed-os
$ mbed update mbed-os-5.9.4 //this "mbed-os-5.9.4" tag was found here:  https://github.com/ARMmbed/mbed-os/releases
[mbed] Updating library "mbed-os" to branch/tag "mbed-os-5.9.4"
[mbed] Updating reference "mbed-os" -> "https://github.com/ARMmbed/mbed-os/#485bdeee150e2bc8ed75e27d936060fb63a7a7d1"

The mbed update command can also be used with other libraries and their specific library/revision numbers. For example:

$ cd <library>
$ mbed update <library revision/commit number>

Please let me know if you have any questions!

- Jenny, team Mbed

Thanks Navven and Jenny for your support. The key to way out is setting the the right revision of the library. Now it work for me .

Fabio

posted by Fabio Gatti 21 Aug 2018

Hi again Fabio,

I just want to add that mbed update <revision number> will update the library files and also the version number present in the .lib file.

- Jenny, team Mbed

posted by Jenny Plunkett 21 Aug 2018