Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 0:db1600a88ae1
- Child:
- 5:ca9bf0d65cc6
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Tue Jun 05 17:34:25 2018 +0100
@@ -0,0 +1,40 @@
+#include "mbed.h"
+
+#if !defined(MBED_SYS_STATS_ENABLED)
+#error [NOT_SUPPORTED] test not supported
+#endif
+
+int main()
+{
+ mbed_stats_sys_t stats;
+ mbed_stats_sys_get(&stats);
+
+ printf("Mbed OS Version: 0x%x \n", stats.os_version);
+
+ /* CPUID Register information
+ [31:24]Implementer 0x41 = ARM
+ [23:20]Variant Major revision 0x0 = Revision 0
+ [19:16]Architecture 0xC = Baseline Architecture
+ 0xF = Constant (Mainline Architecture?)
+ [15:4]PartNO 0xC20 = Cortex-M0
+ 0xC60 = Cortex-M0+
+ 0xC23 = Cortex-M3
+ 0xC24 = Cortex-M4
+ 0xC27 = Cortex-M7
+ 0xD20 = Cortex-M23
+ 0xD21 = Cortex-M33
+ [3:0]Revision Minor revision: 0x1 = Patch 1.
+ */
+ printf("CPU ID: 0x%x \n", stats.cpu_id);
+
+ printf("Compiler ID: %d \n", stats.compiler_id);
+
+ /* Compiler versions:
+ ARM: PVVbbbb (P = Major; VV = Minor; bbbb = build number)
+ GCC: VVRRPP (VV = Version; RR = Revision; PP = Patch)
+ IAR: VRRRPPP (V = Version; RRR = Revision; PPP = Patch)
+ */
+ printf("Compiler Version: %d \n", stats.compiler_version);
+
+ return 0;
+}