From 2fd271d551cbf5e698d62f46945eb613fe778aae Mon Sep 17 00:00:00 2001 From: 3djc <5167938+3djc@users.noreply.github.com> Date: Tue, 17 Mar 2026 01:42:38 +0100 Subject: [PATCH] fix(h7): CPU id read (#7187) --- radio/src/targets/common/arm/stm32/cpu_id.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/radio/src/targets/common/arm/stm32/cpu_id.cpp b/radio/src/targets/common/arm/stm32/cpu_id.cpp index 6ce8e599f..10cf7f7d1 100644 --- a/radio/src/targets/common/arm/stm32/cpu_id.cpp +++ b/radio/src/targets/common/arm/stm32/cpu_id.cpp @@ -19,19 +19,22 @@ * GNU General Public License for more details. */ -#include "edgetx.h" +#include "cpu_id.h" + +#include "strhelpers.h" #if defined(SIMU) -const uint32_t cpu_uid[3] = { 0x12345678, 0x55AA55AA, 0x87654321}; +const uint32_t cpu_uid[3] = {0x12345678, 0x55AA55AA, 0x87654321}; #else -const uint32_t * const cpu_uid = (uint32_t *)0x1FFF7A10; +#include "stm32_cmsis.h" +const uint32_t *const cpu_uid = (uint32_t *)UID_BASE; #endif -void getCPUUniqueID(char * s) +void getCPUUniqueID(char* s) { - char * tmp = strAppendUnsigned(s, cpu_uid[0], 8, 16); + char* tmp = strAppendUnsigned(s, cpu_uid[0], 8, 16); *tmp = ' '; - tmp = strAppendUnsigned(tmp+1, cpu_uid[1], 8, 16); + tmp = strAppendUnsigned(tmp + 1, cpu_uid[1], 8, 16); *tmp = ' '; - strAppendUnsigned(tmp+1, cpu_uid[2], 8, 16); + strAppendUnsigned(tmp + 1, cpu_uid[2], 8, 16); }