Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
7 years, 3 months ago.
How can you find out the revision of mbed-os5 inside an application?
Thanks
2 Answers
7 years, 3 months ago.
Hey, if you are using a release branch, you can find them in these macros - https://github.com/ARMmbed/mbed-os/blob/mbed-os-5.5/mbed.h#L23-L25
Thanks Sarah, Why are none of these items defined?
#if MBED_CONF_RTOS_PRESENT // RTOS present, this is valid only for mbed OS 5 #define MBED_MAJOR_VERSION 5 #define MBED_MINOR_VERSION 5 #define MBED_PATCH_VERSION 5 #else // mbed 2 #define MBED_MAJOR_VERSION 2 #define MBED_MINOR_VERSION 0 #define MBED_PATCH_VERSION MBED_LIBRARY_VERSION #endif
They are defined after the "MBED_..." string name.
So the mbed.h file Sarah linked has the Mbed OS version 5.5, so the MBED_MAJOR_VERSION
is 5 and the MBED_MINOR_VERSION
is 5 for 5.5. Then there's a patch version (MBED_PATCH_VERSION
).
I got that Jenny,
The problem is that the items MBED_MAJOR_VERSION, MBED_MINOR_VERSION and MBED_PATCH_VERSION come up as undefined in the compiler.
posted by 21 Aug 2017Yes, I believe that the online compiler uses the "latest" branch by default, which does not contain these macros. You will have to import mbed OS from a release branch -https://github.com/ARMmbed/mbed-os/releases.
posted by 22 Aug 2017I am using the CLI / off-line compiler. I also imported mbed-os from the link you provided. Still, the #defines are not there
posted by 24 Aug 2017That link is used to show all the release branches. You will need to switch to one of those branches, like so:
mbed import mbed-os
cd mbed-os
mbed update mbed-os-5.5.5
posted by 24 Aug 2017Thanks Sarah,
The "mbed update mbed-os-5.5.5" did the trick!!
So, any mbed library older will not work, correct?
posted by 25 Aug 2017No, only the release branches linked here - https://github.com/ARMmbed/mbed-os/releases - will work.
posted by 28 Aug 20177 years, 3 months ago.
Hi Kevin,
I usually navigate into the directory of a cloned Mbed OS application repository on my computer. For example...
cd mbed-os-example-blinky cd mbed-os git log
The git log
inside of the mbed-os
directory allows you to view the commit history of the mbed OS you currently have cloned locally. The very top line will tell you which revision of Mbed OS you are using to compare against https://github.com/armmbed/mbed-os
commit db4be94693c3a873cfa0c025a5ad2e62b86a8474
Let me know if you have any questions!
- Jenny, team mbed