diff --git a/cpu/stm32_common/include/periph_cpu_common.h b/cpu/stm32_common/include/periph_cpu_common.h index db52e3945f5d4c2e3183e5ec24fd7bf38e75d857..faa768648c1a51631ed16ca05af1d6c49d3210a7 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 50dcb32c65e90e324480283c9b368722ce8bef86..1bed660526c8ea61ee8903a71451dd22e33b2207 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 d986bb611c99755e07d4bbd22d5486f94cabbd2e..e8f114a806c3e92ef4afa050cf501f7ee4d4ac8a 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 aed0e208d5f0d768a19a586079bbeb14ac87d250..4ac636b6d5984b2225d5788499028f049c3d67e7 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 893e5c5100775b0704d25187c0228a0f22654689..39b744ff46b40bd4661b91b14d590c64baacbec5 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 73cf275797254b5b5c7bdf19fe1b2743708c25a1..f22058a95e27364111116a443e11dc4e46a4f565 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 a754650f017c4ccdce87babf49c382b70651d8c6..b9f9d271cadf47c0315c6bee843b8926570f20a7 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 458b0fac86e13de353c4cdc32af2ce81f0e5db5e..7a4d8380a6bb167d51ac48fcb4ba5779562eb501 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 810b690eb624fd621042d055e7a3b7bbd00a9e6e..ebe346988ce41aede28378d41dbd34ba4227dab2 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 042a3d4d5e4059d899ae6f958c64ac13b846a943..f57c126ec8c09e965a10484f036b083fb9f099ee 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 ba67be616da968a9b262ddb2e2487659971438b8..4b7d38c94282ce751bf5cefaaeb90815ababc6dd 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 37188f367713f1671a86c66f5d6e62a9c3339583..91de244859b85da478bc7614eb1fc14409c80c09 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 53d3b1119f66be7818462dd42059a17070d83520..452935e2989c0716f4aaf6edb7606a8e5a9399da 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 c5d3ca83615813ffa4a835b0585165cad5457def..6b33f73cf49a7295af9e0213f4f35b16656537ea 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 4098fca666e0ee3e366f331d7953a9130f5e8cfa..8412a07e07e258886469bdd17c731bc15bc460f7 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 a322d128e31f2549fa88c1acbce8ff1c9bd2adcb..af84488fe6f3be9583981e1046d28243ecdc748e 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 eb8f34a09e438df6b2033f4cc9b0121a9172cacc..56d50efd57108b3075c80cca593737884761f2e8 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 7e9626a3093bb7057340d492d8475dd96d685ed6..c5adfed5fff3b60912c97c5f62a739cb94a49a45 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 7031a395ebc1a4ccfd3b58401721bb6c3ac7f5fb..c6a03b47e9b99c806e33a24adc90085a17263a25 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 5b7f0df203fa455bba491ef909ebd6462cfa2a80..329f3c183513df9a004b983a0b8525a58fb11dc8 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 e85baf9398cab481fa8a90ab21fc5174a1d3fa5d..c99cde1f34ff36ab99610cb464c2fb60321c0022 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 c99243985f51759b0b9c3bf0ee857647aaad0289..acf610dd38d78372d8cb33907c09f59872875342 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 a9dbcbe71af512738c109c374e5991356eabafd3..7b6f577280ec42996a600babbc42a195cf47e6ac 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 d0cc7f6d3ef1590e953776414ea8cb80e2ac186a..e63b1d5aeef467c3d1f84529da8ae11bf36cfef1 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 4626bb6dc3d57223fc225fddeb402d88cc89a87d..e23ae9817c7839e6833f1f805f3f03db1e60da7e 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 cdfbb014ba8ea8ebb3acecfcbdd1b7569ef80c01..fe9971145da4f2ec567e044f0f8c6fb9e7188f1e 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 709382490f29783693ae2fcc27b6cc3bca01ceb1..59c32208f6fe54a8a6c2fae6d6bcb2f6f74335a4 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 cccb3c61ef73b748b5e7952d29df7b6a2284913a..7f928b387c781031fc6d7b0886846e95b2aabd82 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 cb0c3af3afef47c140349b17aeb7b2baab9759f8..cb5cb42e114484ee5acc3c46c9eaf08bd2ae5682 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 a2c1cbcca4de06ff3320d8f137470bd8ec33f36c..dbf9a07e011ef3b93abb469461df795255207127 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 35ba7613a7186a0c51e6520b612c3f291bc03544..39c0119d7a0bc2c939f092b24e441c9b0dd08608 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 7f9a6ceda6a59c21db58702857ca40ebee265e49..31072ce8fc1cf8a078f8544338216621f4bba109 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 2129121ba7098ad46f4923fee0d4c4a2af603154..498a707bdeb531e328dee4ab80c161f2fc35d763 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 95d03ae28c4a4800fce70cc3de5350a35ba7b50a..39d7bc7d79c966b340f0f8e479971360523bbbdc 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 b612b5b9033d3c26cf7f2066da009666626dd99e..5633d06ebc863c8a65841b546a1dd7fa83b66581 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 26850c474d04d9f26afb48d766e1c2c39cd1f42b..da49e49f741b8915d4d59dd83ff1d345d179d91b 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 686c03883e448995870c6a585eb96709ebbc34cb..bcd7de476729011988bc8822b4ddae6c3b5007f4 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 cd3d16de4e00da85332cde74e4e1bf6ab5a5db53..504667a3ace5cd652e92e411612e5e55c4d76fc1 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 08f4040aa41f73cc0ea57082340fc9fcc1f57121..d3bbc4074f416e1b4e1cd26f70d945314208d002 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 2e1ad3777ab06ae179a2d760bfaefd7058e2e24e..0ee0380d70f5be7fab00a3d1a9d911a2145c9e33 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 9469cb04c22766e3425a07adac7c1c8866be9175..f1cc56475bc2880bdfcdf95e1e99ea0c6c55bc12 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 8b6274f11dfff1b954ad36f2b0dee3b7702522db..328bba5d8c3c7ba02176c7712717cfe2dffacc7a 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 853bccb1d1694f2a1bedea99cac0272158519605..3a45cac9b2ceec0e9a46fb35d37a422e80038199 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 2b64cd64a7152b192f74b5ff4854dd3f80a5d4b1..f7a68d842161e77b38bc9aa27306a0238ad924f0 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 2ae110d90e66d6274bd475b4af7acaa6aab6ec5f..497249745959d37a9e357680e5758ce472db5d94 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 937052d8da88925dd301ccd993fb86a04a17a03d..3f1cdae47df4b539a94356fc48c0ebfd6bf9281a 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 ab04a2855154381380e4566ce6663df7a5c5a780..d2431b1f359d662c0cdc39536fb8416d739f3c39 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 9720f2184db12ebd539682f6dce3e9847c34d0ab..900fea6f41388e7f4e4ddf4f54e7bdae00348386 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 3e8e0d50a697f64dece8a2dc06facfcae69e0ad8..4fd7f0eda2d46761ced1c7acf4d0a65fc6bf6b5a 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 475877d2a8dd4f66cb316874daa3ac5be65eaaf3..0f79bc118801f6434eaa87413376c1a31ca460f5 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 5b204f0cf5201cc3d7a110a39b5bae42e2bc426c..147b2d7ab8e2fa6059ae935ea2a25c5752738ac5 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 7fe6f4ba24448ad7d4e2e004d613775c43c8f99e..e4dabbb78ddddd5a70a24ea5bc42346d51f5573f 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 5fb42857959ceb2f960d85c804fb32f4d271f713..3bb986d6becaf65ab3162e2e68ad14080dfcba44 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 18148d6fc95818cd72a4807d628956aeaf7d3128..07932703a95227cfddde7a3dc46e8c5fb19214b6 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 af1d52132c2fd894962fb295025666656c87c7bf..6344f1fc98ded35344e05073d38ebe802260b619 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 24a844c095c447c40d321618d637522585f5498d..256baa223f13dcf47c3a8c47e7cab038896c4d98 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 c5f9e3236263a44dccce347ad0b28e1d2d33113d..9e5995122303fe16f6cbc49731eb70925cabe1e1 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 ddadd6bc12f87106587499b98b16286c87fb6f89..0c4852b5f11763068eaf577bca3cd54cd417aefc 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 00676080a6efe2b43bbff2a763ddae8b4e6121b1..c6e6e8c5565d50aa0c13b0901bec4d167af473db 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