From 5a355177872dc2e4ea74ecc34d13f3b098ef836c Mon Sep 17 00:00:00 2001 From: Hauke Petersen <hauke.petersen@fu-berlin.de> Date: Fri, 13 Oct 2017 10:40:35 +0200 Subject: [PATCH] cpu/stm32: optimized definition of CPUID_ADDR --- cpu/stm32_common/include/periph_cpu_common.h | 10 ++-------- cpu/stm32f0/include/periph_cpu.h | 5 +++++ cpu/stm32f0/ldscripts/stm32f030r8.ld | 3 --- cpu/stm32f0/ldscripts/stm32f031k6.ld | 3 --- cpu/stm32f0/ldscripts/stm32f042k6.ld | 3 --- cpu/stm32f0/ldscripts/stm32f051r8.ld | 3 --- cpu/stm32f0/ldscripts/stm32f070rb.ld | 3 --- cpu/stm32f0/ldscripts/stm32f072rb.ld | 3 --- cpu/stm32f0/ldscripts/stm32f091rc.ld | 3 --- cpu/stm32f1/include/periph_cpu.h | 5 +++++ cpu/stm32f1/ldscripts/stm32f103c8.ld | 3 --- cpu/stm32f1/ldscripts/stm32f103cb.ld | 3 --- cpu/stm32f1/ldscripts/stm32f103cb_opencm904.ld | 3 --- cpu/stm32f1/ldscripts/stm32f103cb_sparkcore.ld | 3 --- cpu/stm32f1/ldscripts/stm32f103rb.ld | 3 --- cpu/stm32f1/ldscripts/stm32f103re.ld | 3 --- cpu/stm32f2/include/periph_cpu.h | 5 +++++ cpu/stm32f2/ldscripts/stm32f205rg.ld | 3 --- cpu/stm32f2/ldscripts/stm32f207zg.ld | 3 --- cpu/stm32f2/ldscripts/stm32f215rg.ld | 3 --- cpu/stm32f2/ldscripts/stm32f215ve.ld | 3 --- cpu/stm32f2/ldscripts/stm32f215vg.ld | 3 --- cpu/stm32f2/ldscripts/stm32f217zg.ld | 3 --- cpu/stm32f3/include/periph_cpu.h | 5 +++++ cpu/stm32f3/ldscripts/stm32f302r8.ld | 3 --- cpu/stm32f3/ldscripts/stm32f303k8.ld | 3 --- cpu/stm32f3/ldscripts/stm32f303re.ld | 3 --- cpu/stm32f3/ldscripts/stm32f303vc.ld | 3 --- cpu/stm32f3/ldscripts/stm32f303ze.ld | 3 --- cpu/stm32f3/ldscripts/stm32f334r8.ld | 3 --- cpu/stm32f4/include/periph_cpu.h | 5 +++++ cpu/stm32f4/ldscripts/stm32f401re.ld | 3 --- cpu/stm32f4/ldscripts/stm32f407vg.ld | 3 --- cpu/stm32f4/ldscripts/stm32f410rb.ld | 3 --- cpu/stm32f4/ldscripts/stm32f411re.ld | 3 --- cpu/stm32f4/ldscripts/stm32f412zg.ld | 3 --- cpu/stm32f4/ldscripts/stm32f413vg.ld | 3 --- cpu/stm32f4/ldscripts/stm32f413zh.ld | 3 --- cpu/stm32f4/ldscripts/stm32f415rg.ld | 3 --- cpu/stm32f4/ldscripts/stm32f429zi.ld | 3 --- cpu/stm32f4/ldscripts/stm32f446re.ld | 3 --- cpu/stm32f4/ldscripts/stm32f446ze.ld | 3 --- cpu/stm32f7/include/periph_cpu.h | 9 +++++++++ cpu/stm32f7/ldscripts/stm32f722ze.ld | 3 --- cpu/stm32f7/ldscripts/stm32f746zg.ld | 3 --- cpu/stm32f7/ldscripts/stm32f767zi.ld | 3 --- cpu/stm32f7/ldscripts/stm32f769ni.ld | 3 --- cpu/stm32l0/include/periph_cpu.h | 5 +++++ cpu/stm32l0/ldscripts/stm32l031k6.ld | 3 --- cpu/stm32l0/ldscripts/stm32l053r8.ld | 3 --- cpu/stm32l0/ldscripts/stm32l072cz.ld | 3 --- cpu/stm32l0/ldscripts/stm32l073rz.ld | 3 --- cpu/stm32l1/include/periph_cpu.h | 9 +++++++++ cpu/stm32l1/ldscripts/stm32l151rba.ld | 3 --- cpu/stm32l1/ldscripts/stm32l151rc.ld | 3 --- cpu/stm32l1/ldscripts/stm32l152ret6.ld | 3 --- cpu/stm32l4/include/periph_cpu.h | 5 +++++ cpu/stm32l4/ldscripts/stm32l432kc.ld | 3 --- cpu/stm32l4/ldscripts/stm32l476rg.ld | 3 --- 59 files changed, 55 insertions(+), 155 deletions(-) diff --git a/cpu/stm32_common/include/periph_cpu_common.h b/cpu/stm32_common/include/periph_cpu_common.h index db52e3945f..faa768648c 100644 --- a/cpu/stm32_common/include/periph_cpu_common.h +++ b/cpu/stm32_common/include/periph_cpu_common.h @@ -43,16 +43,10 @@ extern "C" { #error "error: LSI clock speed not defined for your target CPU" #endif -/** - * @brief Linker script provided symbol for CPUID location - */ -extern uint32_t _cpuid_address; -/** - * @brief Starting offset of CPU_ID - */ -#define CPUID_ADDR (&_cpuid_address) /** * @brief Length of the CPU_ID in octets + * + * This is the same for all members of the stm32 family */ #define CPUID_LEN (12U) diff --git a/cpu/stm32f0/include/periph_cpu.h b/cpu/stm32f0/include/periph_cpu.h index 50dcb32c65..1bed660526 100644 --- a/cpu/stm32f0/include/periph_cpu.h +++ b/cpu/stm32f0/include/periph_cpu.h @@ -25,6 +25,11 @@ extern "C" { #endif +/** + * @brief Starting address of the CPU ID + */ +#define CPUID_ADDR (0x1ffff7ac) + /** * @brief Available ports on the STM32F0 family */ diff --git a/cpu/stm32f0/ldscripts/stm32f030r8.ld b/cpu/stm32f0/ldscripts/stm32f030r8.ld index d986bb611c..e8f114a806 100644 --- a/cpu/stm32f0/ldscripts/stm32f030r8.ld +++ b/cpu/stm32f0/ldscripts/stm32f030r8.ld @@ -22,9 +22,6 @@ MEMORY { rom (rx) : ORIGIN = 0x08000000, LENGTH = 64K ram (rwx) : ORIGIN = 0x20000000, LENGTH = 8K - cpuid (r) : ORIGIN = 0x1ffff7ac, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld diff --git a/cpu/stm32f0/ldscripts/stm32f031k6.ld b/cpu/stm32f0/ldscripts/stm32f031k6.ld index aed0e208d5..4ac636b6d5 100644 --- a/cpu/stm32f0/ldscripts/stm32f031k6.ld +++ b/cpu/stm32f0/ldscripts/stm32f031k6.ld @@ -22,9 +22,6 @@ MEMORY { rom (rx) : ORIGIN = 0x08000000, LENGTH = 32K ram (rwx) : ORIGIN = 0x20000000, LENGTH = 4K - cpuid (r) : ORIGIN = 0x1ffff7ac, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld diff --git a/cpu/stm32f0/ldscripts/stm32f042k6.ld b/cpu/stm32f0/ldscripts/stm32f042k6.ld index 893e5c5100..39b744ff46 100644 --- a/cpu/stm32f0/ldscripts/stm32f042k6.ld +++ b/cpu/stm32f0/ldscripts/stm32f042k6.ld @@ -22,9 +22,6 @@ MEMORY { rom (rx) : ORIGIN = 0x08000000, LENGTH = 32K ram (rwx) : ORIGIN = 0x20000000, LENGTH = 6K - cpuid (r) : ORIGIN = 0x1ffff7ac, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld diff --git a/cpu/stm32f0/ldscripts/stm32f051r8.ld b/cpu/stm32f0/ldscripts/stm32f051r8.ld index 73cf275797..f22058a95e 100644 --- a/cpu/stm32f0/ldscripts/stm32f051r8.ld +++ b/cpu/stm32f0/ldscripts/stm32f051r8.ld @@ -22,9 +22,6 @@ MEMORY { rom (rx) : ORIGIN = 0x08000000, LENGTH = 64K ram (rwx) : ORIGIN = 0x20000000, LENGTH = 8K - cpuid (r) : ORIGIN = 0x1ffff7ac, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld diff --git a/cpu/stm32f0/ldscripts/stm32f070rb.ld b/cpu/stm32f0/ldscripts/stm32f070rb.ld index a754650f01..b9f9d271ca 100644 --- a/cpu/stm32f0/ldscripts/stm32f070rb.ld +++ b/cpu/stm32f0/ldscripts/stm32f070rb.ld @@ -22,9 +22,6 @@ MEMORY { rom (rx) : ORIGIN = 0x08000000, LENGTH = 128K ram (rwx) : ORIGIN = 0x20000000, LENGTH = 16K - cpuid (r) : ORIGIN = 0x1ffff7ac, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld diff --git a/cpu/stm32f0/ldscripts/stm32f072rb.ld b/cpu/stm32f0/ldscripts/stm32f072rb.ld index 458b0fac86..7a4d8380a6 100644 --- a/cpu/stm32f0/ldscripts/stm32f072rb.ld +++ b/cpu/stm32f0/ldscripts/stm32f072rb.ld @@ -22,9 +22,6 @@ MEMORY { rom (rx) : ORIGIN = 0x08000000, LENGTH = 128K ram (rwx) : ORIGIN = 0x20000000, LENGTH = 16K - cpuid (r) : ORIGIN = 0x1ffff7ac, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld diff --git a/cpu/stm32f0/ldscripts/stm32f091rc.ld b/cpu/stm32f0/ldscripts/stm32f091rc.ld index 810b690eb6..ebe346988c 100644 --- a/cpu/stm32f0/ldscripts/stm32f091rc.ld +++ b/cpu/stm32f0/ldscripts/stm32f091rc.ld @@ -22,9 +22,6 @@ MEMORY { rom (rx) : ORIGIN = 0x08000000, LENGTH = 256K ram (rwx) : ORIGIN = 0x20000000, LENGTH = 32K - cpuid (r) : ORIGIN = 0x1ffff7ac, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld diff --git a/cpu/stm32f1/include/periph_cpu.h b/cpu/stm32f1/include/periph_cpu.h index 042a3d4d5e..f57c126ec8 100644 --- a/cpu/stm32f1/include/periph_cpu.h +++ b/cpu/stm32f1/include/periph_cpu.h @@ -30,6 +30,11 @@ extern "C" { */ #define ADC_DEVS (2U) +/** + * @brief Starting address of the CPU ID + */ +#define CPUID_ADDR (0x1ffff7e8) + /** * @brief All timers for the STM32F1 have 4 CC channels */ diff --git a/cpu/stm32f1/ldscripts/stm32f103c8.ld b/cpu/stm32f1/ldscripts/stm32f103c8.ld index ba67be616d..4b7d38c942 100644 --- a/cpu/stm32f1/ldscripts/stm32f103c8.ld +++ b/cpu/stm32f1/ldscripts/stm32f103c8.ld @@ -22,9 +22,6 @@ MEMORY { rom (rx) : ORIGIN = 0x08000000, LENGTH = 64K ram (xrw) : ORIGIN = 0x20000000, LENGTH = 20K - cpuid (r) : ORIGIN = 0x1ffff7e8, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld diff --git a/cpu/stm32f1/ldscripts/stm32f103cb.ld b/cpu/stm32f1/ldscripts/stm32f103cb.ld index 37188f3677..91de244859 100644 --- a/cpu/stm32f1/ldscripts/stm32f103cb.ld +++ b/cpu/stm32f1/ldscripts/stm32f103cb.ld @@ -22,9 +22,6 @@ MEMORY { rom (rx) : ORIGIN = 0x08000000, LENGTH = 128K ram (xrw) : ORIGIN = 0x20000000, LENGTH = 20K - cpuid (r) : ORIGIN = 0x1ffff7e8, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld diff --git a/cpu/stm32f1/ldscripts/stm32f103cb_opencm904.ld b/cpu/stm32f1/ldscripts/stm32f103cb_opencm904.ld index 53d3b1119f..452935e298 100644 --- a/cpu/stm32f1/ldscripts/stm32f103cb_opencm904.ld +++ b/cpu/stm32f1/ldscripts/stm32f103cb_opencm904.ld @@ -22,9 +22,6 @@ MEMORY { rom (rx) : ORIGIN = 0x08003000, LENGTH = 128K-0x3000 ram (xrw) : ORIGIN = 0x20000000, LENGTH = 20K - cpuid (r) : ORIGIN = 0x1ffff7e8, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld diff --git a/cpu/stm32f1/ldscripts/stm32f103cb_sparkcore.ld b/cpu/stm32f1/ldscripts/stm32f103cb_sparkcore.ld index c5d3ca8361..6b33f73cf4 100644 --- a/cpu/stm32f1/ldscripts/stm32f103cb_sparkcore.ld +++ b/cpu/stm32f1/ldscripts/stm32f103cb_sparkcore.ld @@ -22,9 +22,6 @@ MEMORY { rom (rx) : ORIGIN = 0x08005000, LENGTH = 128K-0x5000 ram (xrw) : ORIGIN = 0x20000000, LENGTH = 20K - cpuid (r) : ORIGIN = 0x1ffff7e8, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld diff --git a/cpu/stm32f1/ldscripts/stm32f103rb.ld b/cpu/stm32f1/ldscripts/stm32f103rb.ld index 4098fca666..8412a07e07 100644 --- a/cpu/stm32f1/ldscripts/stm32f103rb.ld +++ b/cpu/stm32f1/ldscripts/stm32f103rb.ld @@ -22,9 +22,6 @@ MEMORY { rom (rx) : ORIGIN = 0x08000000, LENGTH = 128K ram (xrw) : ORIGIN = 0x20000000, LENGTH = 20K - cpuid (r) : ORIGIN = 0x1ffff7e8, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld diff --git a/cpu/stm32f1/ldscripts/stm32f103re.ld b/cpu/stm32f1/ldscripts/stm32f103re.ld index a322d128e3..af84488fe6 100644 --- a/cpu/stm32f1/ldscripts/stm32f103re.ld +++ b/cpu/stm32f1/ldscripts/stm32f103re.ld @@ -22,9 +22,6 @@ MEMORY { rom (rx) : ORIGIN = 0x08000000, LENGTH = 512K ram (xrw) : ORIGIN = 0x20000000, LENGTH = 64K - cpuid (r) : ORIGIN = 0x1ffff7e8, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld diff --git a/cpu/stm32f2/include/periph_cpu.h b/cpu/stm32f2/include/periph_cpu.h index eb8f34a09e..56d50efd57 100644 --- a/cpu/stm32f2/include/periph_cpu.h +++ b/cpu/stm32f2/include/periph_cpu.h @@ -27,6 +27,11 @@ extern "C" { #endif +/** + * @brief Starting address of the CPU ID + */ +#define CPUID_ADDR (0x1fff7a10) + /** * @brief Available ports on the STM32F2 family */ diff --git a/cpu/stm32f2/ldscripts/stm32f205rg.ld b/cpu/stm32f2/ldscripts/stm32f205rg.ld index 7e9626a309..c5adfed5ff 100644 --- a/cpu/stm32f2/ldscripts/stm32f205rg.ld +++ b/cpu/stm32f2/ldscripts/stm32f205rg.ld @@ -24,9 +24,6 @@ MEMORY { rom (rx) : ORIGIN = 0x08000000, LENGTH = 1024K ram (xrw) : ORIGIN = 0x20000000, LENGTH = 128K - cpuid (r) : ORIGIN = 0x1fff7a10, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld diff --git a/cpu/stm32f2/ldscripts/stm32f207zg.ld b/cpu/stm32f2/ldscripts/stm32f207zg.ld index 7031a395eb..c6a03b47e9 100644 --- a/cpu/stm32f2/ldscripts/stm32f207zg.ld +++ b/cpu/stm32f2/ldscripts/stm32f207zg.ld @@ -22,9 +22,6 @@ MEMORY { rom (rx) : ORIGIN = 0x08000000, LENGTH = 1024K ram (xrw) : ORIGIN = 0x20000000, LENGTH = 128K - cpuid (r) : ORIGIN = 0x1fff7a10, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld diff --git a/cpu/stm32f2/ldscripts/stm32f215rg.ld b/cpu/stm32f2/ldscripts/stm32f215rg.ld index 5b7f0df203..329f3c1835 100644 --- a/cpu/stm32f2/ldscripts/stm32f215rg.ld +++ b/cpu/stm32f2/ldscripts/stm32f215rg.ld @@ -24,9 +24,6 @@ MEMORY { rom (rx) : ORIGIN = 0x08000000, LENGTH = 1024K ram (xrw) : ORIGIN = 0x20000000, LENGTH = 128K - cpuid (r) : ORIGIN = 0x1fff7a10, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld diff --git a/cpu/stm32f2/ldscripts/stm32f215ve.ld b/cpu/stm32f2/ldscripts/stm32f215ve.ld index e85baf9398..c99cde1f34 100644 --- a/cpu/stm32f2/ldscripts/stm32f215ve.ld +++ b/cpu/stm32f2/ldscripts/stm32f215ve.ld @@ -24,9 +24,6 @@ MEMORY { rom (rx) : ORIGIN = 0x08000000, LENGTH = 512K ram (xrw) : ORIGIN = 0x20000000, LENGTH = 128K - cpuid (r) : ORIGIN = 0x1fff7a10, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld diff --git a/cpu/stm32f2/ldscripts/stm32f215vg.ld b/cpu/stm32f2/ldscripts/stm32f215vg.ld index c99243985f..acf610dd38 100644 --- a/cpu/stm32f2/ldscripts/stm32f215vg.ld +++ b/cpu/stm32f2/ldscripts/stm32f215vg.ld @@ -24,9 +24,6 @@ MEMORY { rom (rx) : ORIGIN = 0x08000000, LENGTH = 1024K ram (xrw) : ORIGIN = 0x20000000, LENGTH = 128K - cpuid (r) : ORIGIN = 0x1fff7a10, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld diff --git a/cpu/stm32f2/ldscripts/stm32f217zg.ld b/cpu/stm32f2/ldscripts/stm32f217zg.ld index a9dbcbe71a..7b6f577280 100644 --- a/cpu/stm32f2/ldscripts/stm32f217zg.ld +++ b/cpu/stm32f2/ldscripts/stm32f217zg.ld @@ -24,9 +24,6 @@ MEMORY { rom (rx) : ORIGIN = 0x08000000, LENGTH = 1024K ram (xrw) : ORIGIN = 0x20000000, LENGTH = 128K - cpuid (r) : ORIGIN = 0x1fff7a10, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld diff --git a/cpu/stm32f3/include/periph_cpu.h b/cpu/stm32f3/include/periph_cpu.h index d0cc7f6d3e..e63b1d5aee 100644 --- a/cpu/stm32f3/include/periph_cpu.h +++ b/cpu/stm32f3/include/periph_cpu.h @@ -25,6 +25,11 @@ extern "C" { #endif +/** + * @brief Starting address of the CPU ID + */ +#define CPUID_ADDR (0x1ffff7ac) + /** * @brief Available ports on the STM32F3 family */ diff --git a/cpu/stm32f3/ldscripts/stm32f302r8.ld b/cpu/stm32f3/ldscripts/stm32f302r8.ld index 4626bb6dc3..e23ae9817c 100644 --- a/cpu/stm32f3/ldscripts/stm32f302r8.ld +++ b/cpu/stm32f3/ldscripts/stm32f302r8.ld @@ -22,9 +22,6 @@ MEMORY { rom (rx) : ORIGIN = 0x08000000, LENGTH = 64K ram (rwx) : ORIGIN = 0x20000000, LENGTH = 16K - cpuid (r) : ORIGIN = 0x1ffff7ac, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld diff --git a/cpu/stm32f3/ldscripts/stm32f303k8.ld b/cpu/stm32f3/ldscripts/stm32f303k8.ld index cdfbb014ba..fe9971145d 100644 --- a/cpu/stm32f3/ldscripts/stm32f303k8.ld +++ b/cpu/stm32f3/ldscripts/stm32f303k8.ld @@ -22,9 +22,6 @@ MEMORY { rom (rx) : ORIGIN = 0x08000000, LENGTH = 64K ram (rwx) : ORIGIN = 0x20000000, LENGTH = 16K - cpuid (r) : ORIGIN = 0x1ffff7ac, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld diff --git a/cpu/stm32f3/ldscripts/stm32f303re.ld b/cpu/stm32f3/ldscripts/stm32f303re.ld index 709382490f..59c32208f6 100644 --- a/cpu/stm32f3/ldscripts/stm32f303re.ld +++ b/cpu/stm32f3/ldscripts/stm32f303re.ld @@ -25,9 +25,6 @@ MEMORY rom (rx) : ORIGIN = 0x08000000, LENGTH = 512K ram (rwx) : ORIGIN = 0x20000000, LENGTH = 64K ccmram (rwx): ORIGIN = 0x10000000, LENGTH = 16K - cpuid (r) : ORIGIN = 0x1ffff7ac, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld diff --git a/cpu/stm32f3/ldscripts/stm32f303vc.ld b/cpu/stm32f3/ldscripts/stm32f303vc.ld index cccb3c61ef..7f928b387c 100644 --- a/cpu/stm32f3/ldscripts/stm32f303vc.ld +++ b/cpu/stm32f3/ldscripts/stm32f303vc.ld @@ -23,9 +23,6 @@ MEMORY rom (rx) : ORIGIN = 0x08000000, LENGTH = 256K ram (rwx) : ORIGIN = 0x20000000, LENGTH = 40K ccmram (rwx): ORIGIN = 0x10000000, LENGTH = 8K - cpuid (r) : ORIGIN = 0x1ffff7ac, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld diff --git a/cpu/stm32f3/ldscripts/stm32f303ze.ld b/cpu/stm32f3/ldscripts/stm32f303ze.ld index cb0c3af3af..cb5cb42e11 100644 --- a/cpu/stm32f3/ldscripts/stm32f303ze.ld +++ b/cpu/stm32f3/ldscripts/stm32f303ze.ld @@ -23,9 +23,6 @@ MEMORY rom (rx) : ORIGIN = 0x08000000, LENGTH = 512K ram (rwx) : ORIGIN = 0x20000000, LENGTH = 64K ccmram (rwx): ORIGIN = 0x10000000, LENGTH = 16K - cpuid (r) : ORIGIN = 0x1ffff7ac, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld diff --git a/cpu/stm32f3/ldscripts/stm32f334r8.ld b/cpu/stm32f3/ldscripts/stm32f334r8.ld index a2c1cbcca4..dbf9a07e01 100644 --- a/cpu/stm32f3/ldscripts/stm32f334r8.ld +++ b/cpu/stm32f3/ldscripts/stm32f334r8.ld @@ -23,9 +23,6 @@ MEMORY rom (rx) : ORIGIN = 0x08000000, LENGTH = 64K ram (rwx) : ORIGIN = 0x20000000, LENGTH = 12K ccmram (rwx): ORIGIN = 0x10000000, LENGTH = 4K - cpuid (r) : ORIGIN = 0x1ffff7ac, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld diff --git a/cpu/stm32f4/include/periph_cpu.h b/cpu/stm32f4/include/periph_cpu.h index 35ba7613a7..39c0119d7a 100644 --- a/cpu/stm32f4/include/periph_cpu.h +++ b/cpu/stm32f4/include/periph_cpu.h @@ -25,6 +25,11 @@ extern "C" { #endif +/** + * @brief Starting address of the CPU ID + */ +#define CPUID_ADDR (0x1fff7a10) + /** * @brief Available ports on the STM32F4 family */ diff --git a/cpu/stm32f4/ldscripts/stm32f401re.ld b/cpu/stm32f4/ldscripts/stm32f401re.ld index 7f9a6ceda6..31072ce8fc 100644 --- a/cpu/stm32f4/ldscripts/stm32f401re.ld +++ b/cpu/stm32f4/ldscripts/stm32f401re.ld @@ -22,9 +22,6 @@ MEMORY { rom (rx) : ORIGIN = 0x08000000, LENGTH = 512K ram (rwx) : ORIGIN = 0x20000000, LENGTH = 96K - cpuid (r) : ORIGIN = 0x1fff7a10, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld diff --git a/cpu/stm32f4/ldscripts/stm32f407vg.ld b/cpu/stm32f4/ldscripts/stm32f407vg.ld index 2129121ba7..498a707bde 100644 --- a/cpu/stm32f4/ldscripts/stm32f407vg.ld +++ b/cpu/stm32f4/ldscripts/stm32f407vg.ld @@ -23,9 +23,6 @@ MEMORY rom (rx) : ORIGIN = 0x08000000, LENGTH = 1024K ram (rwx) : ORIGIN = 0x20000000, LENGTH = 128K ccmram (rwx): ORIGIN = 0x10000000, LENGTH = 64K - cpuid (r) : ORIGIN = 0x1fff7a10, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld diff --git a/cpu/stm32f4/ldscripts/stm32f410rb.ld b/cpu/stm32f4/ldscripts/stm32f410rb.ld index 95d03ae28c..39d7bc7d79 100644 --- a/cpu/stm32f4/ldscripts/stm32f410rb.ld +++ b/cpu/stm32f4/ldscripts/stm32f410rb.ld @@ -24,9 +24,6 @@ MEMORY { rom (rx) : ORIGIN = 0x08000000, LENGTH = 128K ram (rwx) : ORIGIN = 0x20000000, LENGTH = 32K - cpuid (r) : ORIGIN = 0x1fff7a10, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld diff --git a/cpu/stm32f4/ldscripts/stm32f411re.ld b/cpu/stm32f4/ldscripts/stm32f411re.ld index b612b5b903..5633d06ebc 100644 --- a/cpu/stm32f4/ldscripts/stm32f411re.ld +++ b/cpu/stm32f4/ldscripts/stm32f411re.ld @@ -22,9 +22,6 @@ MEMORY { rom (rx) : ORIGIN = 0x08000000, LENGTH = 512K ram (rwx) : ORIGIN = 0x20000000, LENGTH = 128K - cpuid (r) : ORIGIN = 0x1fff7a10, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld diff --git a/cpu/stm32f4/ldscripts/stm32f412zg.ld b/cpu/stm32f4/ldscripts/stm32f412zg.ld index 26850c474d..da49e49f74 100644 --- a/cpu/stm32f4/ldscripts/stm32f412zg.ld +++ b/cpu/stm32f4/ldscripts/stm32f412zg.ld @@ -24,9 +24,6 @@ MEMORY { rom (rx) : ORIGIN = 0x08000000, LENGTH = 1024K ram (rwx) : ORIGIN = 0x20000000, LENGTH = 256K - cpuid (r) : ORIGIN = 0x1fff7a10, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld diff --git a/cpu/stm32f4/ldscripts/stm32f413vg.ld b/cpu/stm32f4/ldscripts/stm32f413vg.ld index 686c03883e..bcd7de4767 100644 --- a/cpu/stm32f4/ldscripts/stm32f413vg.ld +++ b/cpu/stm32f4/ldscripts/stm32f413vg.ld @@ -22,9 +22,6 @@ MEMORY { rom (rx) : ORIGIN = 0x08000000, LENGTH = 1M ram (rwx) : ORIGIN = 0x20000000, LENGTH = 320K - cpuid (r) : ORIGIN = 0x1fff7a10, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld diff --git a/cpu/stm32f4/ldscripts/stm32f413zh.ld b/cpu/stm32f4/ldscripts/stm32f413zh.ld index cd3d16de4e..504667a3ac 100644 --- a/cpu/stm32f4/ldscripts/stm32f413zh.ld +++ b/cpu/stm32f4/ldscripts/stm32f413zh.ld @@ -22,9 +22,6 @@ MEMORY { rom (rx) : ORIGIN = 0x08000000, LENGTH = 1536K ram (rwx) : ORIGIN = 0x20000000, LENGTH = 320K - cpuid (r) : ORIGIN = 0x1fff7a10, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld diff --git a/cpu/stm32f4/ldscripts/stm32f415rg.ld b/cpu/stm32f4/ldscripts/stm32f415rg.ld index 08f4040aa4..d3bbc4074f 100644 --- a/cpu/stm32f4/ldscripts/stm32f415rg.ld +++ b/cpu/stm32f4/ldscripts/stm32f415rg.ld @@ -23,9 +23,6 @@ MEMORY rom (rx) : ORIGIN = 0x08000000, LENGTH = 1024K ram (rwx) : ORIGIN = 0x20000000, LENGTH = 128K ccmram (rwx): ORIGIN = 0x10000000, LENGTH = 64K - cpuid (r) : ORIGIN = 0x1fff7a10, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld diff --git a/cpu/stm32f4/ldscripts/stm32f429zi.ld b/cpu/stm32f4/ldscripts/stm32f429zi.ld index 2e1ad3777a..0ee0380d70 100644 --- a/cpu/stm32f4/ldscripts/stm32f429zi.ld +++ b/cpu/stm32f4/ldscripts/stm32f429zi.ld @@ -23,9 +23,6 @@ MEMORY rom (rx) : ORIGIN = 0x08000000, LENGTH = 2M ram (rwx) : ORIGIN = 0x20000000, LENGTH = 256K ccmram (rwx): ORIGIN = 0x10000000, LENGTH = 64K - cpuid (r) : ORIGIN = 0x1fff7a10, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld diff --git a/cpu/stm32f4/ldscripts/stm32f446re.ld b/cpu/stm32f4/ldscripts/stm32f446re.ld index 9469cb04c2..f1cc56475b 100644 --- a/cpu/stm32f4/ldscripts/stm32f446re.ld +++ b/cpu/stm32f4/ldscripts/stm32f446re.ld @@ -22,9 +22,6 @@ MEMORY { rom (rx) : ORIGIN = 0x08000000, LENGTH = 512K ram (rwx) : ORIGIN = 0x20000000, LENGTH = 128K - cpuid (r) : ORIGIN = 0x1fff7a10, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld diff --git a/cpu/stm32f4/ldscripts/stm32f446ze.ld b/cpu/stm32f4/ldscripts/stm32f446ze.ld index 8b6274f11d..328bba5d8c 100644 --- a/cpu/stm32f4/ldscripts/stm32f446ze.ld +++ b/cpu/stm32f4/ldscripts/stm32f446ze.ld @@ -22,9 +22,6 @@ MEMORY { rom (rx) : ORIGIN = 0x08000000, LENGTH = 512K ram (rwx) : ORIGIN = 0x20000000, LENGTH = 128K - cpuid (r) : ORIGIN = 0x1fff7a10, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld diff --git a/cpu/stm32f7/include/periph_cpu.h b/cpu/stm32f7/include/periph_cpu.h index 853bccb1d1..3a45cac9b2 100644 --- a/cpu/stm32f7/include/periph_cpu.h +++ b/cpu/stm32f7/include/periph_cpu.h @@ -27,6 +27,15 @@ extern "C" { #endif +/** + * @name Starting address of the CPU ID + */ +#ifdef CPU_MODEL_STM32F722ZE +#define CPUID_ADDR (0x1ff07a10) +#else +#define CPUID_ADDR (0x1ff0f420) +#endif + /** * @brief Available ports */ diff --git a/cpu/stm32f7/ldscripts/stm32f722ze.ld b/cpu/stm32f7/ldscripts/stm32f722ze.ld index 2b64cd64a7..f7a68d8421 100644 --- a/cpu/stm32f7/ldscripts/stm32f722ze.ld +++ b/cpu/stm32f7/ldscripts/stm32f722ze.ld @@ -22,9 +22,6 @@ MEMORY { rom (rx) : ORIGIN = 0x08000000, LENGTH = 512K ram (rwx) : ORIGIN = 0x20000000, LENGTH = 256K - cpuid (r) : ORIGIN = 0x1ff07A10, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld diff --git a/cpu/stm32f7/ldscripts/stm32f746zg.ld b/cpu/stm32f7/ldscripts/stm32f746zg.ld index 2ae110d90e..4972497459 100644 --- a/cpu/stm32f7/ldscripts/stm32f746zg.ld +++ b/cpu/stm32f7/ldscripts/stm32f746zg.ld @@ -22,9 +22,6 @@ MEMORY { rom (rx) : ORIGIN = 0x08000000, LENGTH = 1024K ram (rwx) : ORIGIN = 0x20000000, LENGTH = 320K - cpuid (r) : ORIGIN = 0x1ff0f420, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld diff --git a/cpu/stm32f7/ldscripts/stm32f767zi.ld b/cpu/stm32f7/ldscripts/stm32f767zi.ld index 937052d8da..3f1cdae47d 100644 --- a/cpu/stm32f7/ldscripts/stm32f767zi.ld +++ b/cpu/stm32f7/ldscripts/stm32f767zi.ld @@ -22,9 +22,6 @@ MEMORY { rom (rx) : ORIGIN = 0x08000000, LENGTH = 2M ram (rwx) : ORIGIN = 0x20000000, LENGTH = 512K - cpuid (r) : ORIGIN = 0x1ff0f420, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld diff --git a/cpu/stm32f7/ldscripts/stm32f769ni.ld b/cpu/stm32f7/ldscripts/stm32f769ni.ld index ab04a28551..d2431b1f35 100644 --- a/cpu/stm32f7/ldscripts/stm32f769ni.ld +++ b/cpu/stm32f7/ldscripts/stm32f769ni.ld @@ -22,9 +22,6 @@ MEMORY { rom (rx) : ORIGIN = 0x08000000, LENGTH = 2048K ram (rwx) : ORIGIN = 0x20000000, LENGTH = 512K - cpuid (r) : ORIGIN = 0x1ff0f420, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld diff --git a/cpu/stm32l0/include/periph_cpu.h b/cpu/stm32l0/include/periph_cpu.h index 9720f2184d..900fea6f41 100644 --- a/cpu/stm32l0/include/periph_cpu.h +++ b/cpu/stm32l0/include/periph_cpu.h @@ -28,6 +28,11 @@ extern "C" { #endif +/** + * @brief Starting address of the CPU ID + */ +#define CPUID_ADDR (0x1ff80050) + /** * @brief Available ports on the STM32L0 family */ diff --git a/cpu/stm32l0/ldscripts/stm32l031k6.ld b/cpu/stm32l0/ldscripts/stm32l031k6.ld index 3e8e0d50a6..4fd7f0eda2 100644 --- a/cpu/stm32l0/ldscripts/stm32l031k6.ld +++ b/cpu/stm32l0/ldscripts/stm32l031k6.ld @@ -22,9 +22,6 @@ MEMORY { rom (rx) : ORIGIN = 0x08000000, LENGTH = 32K ram (rwx) : ORIGIN = 0x20000000, LENGTH = 8K - cpuid (r) : ORIGIN = 0x1ff80050, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld diff --git a/cpu/stm32l0/ldscripts/stm32l053r8.ld b/cpu/stm32l0/ldscripts/stm32l053r8.ld index 475877d2a8..0f79bc1188 100644 --- a/cpu/stm32l0/ldscripts/stm32l053r8.ld +++ b/cpu/stm32l0/ldscripts/stm32l053r8.ld @@ -22,9 +22,6 @@ MEMORY { rom (rx) : ORIGIN = 0x08000000, LENGTH = 64K ram (rwx) : ORIGIN = 0x20000000, LENGTH = 8K - cpuid (r) : ORIGIN = 0x1ff80050, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld diff --git a/cpu/stm32l0/ldscripts/stm32l072cz.ld b/cpu/stm32l0/ldscripts/stm32l072cz.ld index 5b204f0cf5..147b2d7ab8 100644 --- a/cpu/stm32l0/ldscripts/stm32l072cz.ld +++ b/cpu/stm32l0/ldscripts/stm32l072cz.ld @@ -22,9 +22,6 @@ MEMORY { rom (rx) : ORIGIN = 0x08000000, LENGTH = 192K ram (rwx) : ORIGIN = 0x20000000, LENGTH = 20K - cpuid (r) : ORIGIN = 0x1ff80050, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld diff --git a/cpu/stm32l0/ldscripts/stm32l073rz.ld b/cpu/stm32l0/ldscripts/stm32l073rz.ld index 7fe6f4ba24..e4dabbb78d 100644 --- a/cpu/stm32l0/ldscripts/stm32l073rz.ld +++ b/cpu/stm32l0/ldscripts/stm32l073rz.ld @@ -22,9 +22,6 @@ MEMORY { rom (rx) : ORIGIN = 0x08000000, LENGTH = 192K ram (rwx) : ORIGIN = 0x20000000, LENGTH = 20K - cpuid (r) : ORIGIN = 0x1ff80050, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld diff --git a/cpu/stm32l1/include/periph_cpu.h b/cpu/stm32l1/include/periph_cpu.h index 5fb4285795..3bb986d6be 100644 --- a/cpu/stm32l1/include/periph_cpu.h +++ b/cpu/stm32l1/include/periph_cpu.h @@ -27,6 +27,15 @@ extern "C" { #endif +/** + * @name Starting address of the CPU ID + */ +#ifdef CPU_MODEL_STM32L151RBA +#define CPUID_ADDR (0x1ff80050) +#else +#define CPUID_ADDR (0x1ff800d0) +#endif + /** * @brief Available ports on the STM32L1 family */ diff --git a/cpu/stm32l1/ldscripts/stm32l151rba.ld b/cpu/stm32l1/ldscripts/stm32l151rba.ld index 18148d6fc9..07932703a9 100644 --- a/cpu/stm32l1/ldscripts/stm32l151rba.ld +++ b/cpu/stm32l1/ldscripts/stm32l151rba.ld @@ -22,9 +22,6 @@ MEMORY { rom (rx) : ORIGIN = 0x08000000, LENGTH = 128K ram (rw) : ORIGIN = 0x20000000, LENGTH = 32K - cpuid (r) : ORIGIN = 0x1ff80050, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld diff --git a/cpu/stm32l1/ldscripts/stm32l151rc.ld b/cpu/stm32l1/ldscripts/stm32l151rc.ld index af1d52132c..6344f1fc98 100644 --- a/cpu/stm32l1/ldscripts/stm32l151rc.ld +++ b/cpu/stm32l1/ldscripts/stm32l151rc.ld @@ -22,9 +22,6 @@ MEMORY { rom (rx) : ORIGIN = 0x08000000, LENGTH = 256K ram (xrw) : ORIGIN = 0x20000000, LENGTH = 32K - cpuid (r) : ORIGIN = 0x1ff800d0, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld diff --git a/cpu/stm32l1/ldscripts/stm32l152ret6.ld b/cpu/stm32l1/ldscripts/stm32l152ret6.ld index 24a844c095..256baa223f 100644 --- a/cpu/stm32l1/ldscripts/stm32l152ret6.ld +++ b/cpu/stm32l1/ldscripts/stm32l152ret6.ld @@ -22,9 +22,6 @@ MEMORY { rom (rx) : ORIGIN = 0x08000000, LENGTH = 512K ram (xrw) : ORIGIN = 0x20000000, LENGTH = 80K - cpuid (r) : ORIGIN = 0x1ff800d0, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld diff --git a/cpu/stm32l4/include/periph_cpu.h b/cpu/stm32l4/include/periph_cpu.h index c5f9e32362..9e59951223 100644 --- a/cpu/stm32l4/include/periph_cpu.h +++ b/cpu/stm32l4/include/periph_cpu.h @@ -26,6 +26,11 @@ extern "C" { #endif +/** + * @brief Starting address of the CPU ID + */ +#define CPUID_ADDR (0x1fff7590) + /** * @brief Available ports */ diff --git a/cpu/stm32l4/ldscripts/stm32l432kc.ld b/cpu/stm32l4/ldscripts/stm32l432kc.ld index ddadd6bc12..0c4852b5f1 100644 --- a/cpu/stm32l4/ldscripts/stm32l432kc.ld +++ b/cpu/stm32l4/ldscripts/stm32l432kc.ld @@ -22,9 +22,6 @@ MEMORY { rom (rx) : ORIGIN = 0x08000000, LENGTH = 256K ram (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - cpuid (r) : ORIGIN = 0x1fff7590, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld diff --git a/cpu/stm32l4/ldscripts/stm32l476rg.ld b/cpu/stm32l4/ldscripts/stm32l476rg.ld index 00676080a6..c6e6e8c556 100644 --- a/cpu/stm32l4/ldscripts/stm32l476rg.ld +++ b/cpu/stm32l4/ldscripts/stm32l476rg.ld @@ -22,9 +22,6 @@ MEMORY { rom (rx) : ORIGIN = 0x08000000, LENGTH = 1024K ram (rwx) : ORIGIN = 0x20000000, LENGTH = 128K - cpuid (r) : ORIGIN = 0x1fff7590, LENGTH = 12 } -_cpuid_address = ORIGIN(cpuid); - INCLUDE cortexm_base.ld -- GitLab