aboutsummaryrefslogtreecommitdiff
path: root/src/modules/systemlib/mcu_version.c
diff options
context:
space:
mode:
authorThomas Gubler <thomasgubler@gmail.com>2015-01-28 16:29:14 +0100
committerThomas Gubler <thomasgubler@gmail.com>2015-01-28 16:29:14 +0100
commit2728889f7886e3ab2fea16941d29e60ece0d4449 (patch)
treeca9994d71205731ee4bb404175c2cf8f13fcc539 /src/modules/systemlib/mcu_version.c
parentf23e603d02ba416ae250770cdaad6a859d6bae69 (diff)
parent1dcc5c49cc75778bcdde770f2d6c2700dd2bec2e (diff)
downloadpx4-firmware-2728889f7886e3ab2fea16941d29e60ece0d4449.tar.gz
px4-firmware-2728889f7886e3ab2fea16941d29e60ece0d4449.tar.bz2
px4-firmware-2728889f7886e3ab2fea16941d29e60ece0d4449.zip
Merge remote-tracking branch 'upstream/master' into ros_messagelayer_merge_attctlposctl
Diffstat (limited to 'src/modules/systemlib/mcu_version.c')
-rw-r--r--src/modules/systemlib/mcu_version.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/modules/systemlib/mcu_version.c b/src/modules/systemlib/mcu_version.c
index 4bcf95784..24f4e4207 100644
--- a/src/modules/systemlib/mcu_version.c
+++ b/src/modules/systemlib/mcu_version.c
@@ -47,7 +47,8 @@
#ifdef CONFIG_ARCH_CHIP_STM32
#include <up_arch.h>
-#define DBGMCU_IDCODE 0xE0042000
+#define DBGMCU_IDCODE 0xE0042000 //STM DocID018909 Rev 8 Sect 38.18 (MCU device ID code)
+#define UNIQUE_ID 0x1FFF7A10 //STM DocID018909 Rev 8 Sect 39.1 (Unique device ID Register)
#define STM32F40x_41x 0x413
#define STM32F42x_43x 0x419
@@ -57,7 +58,13 @@
#endif
-
+/** Copy the 96bit MCU Unique ID into the provided pointer */
+void mcu_unique_id(uint32_t *uid_96_bit)
+{
+ uid_96_bit[0] = getreg32(UNIQUE_ID);
+ uid_96_bit[1] = getreg32(UNIQUE_ID+4);
+ uid_96_bit[2] = getreg32(UNIQUE_ID+8);
+}
int mcu_version(char* rev, char** revstr)
{