2 * This file is part of Cleanflight.
4 * Cleanflight is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * Cleanflight is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
20 #if !defined(UNIT_TEST) && !defined(SITL) && !(USBD_DEBUG_LEVEL > 0)
21 #pragma GCC poison sprintf snprintf
24 #if defined(STM32F745xx) || defined(STM32F746xx) || defined(STM32F722xx)
25 #include "stm32f7xx.h"
26 #include "stm32f7xx_hal.h"
28 // Chip Unique ID on F7
29 #if defined(STM32F722xx)
30 #define U_ID_0 (*(uint32_t*)0x1ff07a10)
31 #define U_ID_1 (*(uint32_t*)0x1ff07a14)
32 #define U_ID_2 (*(uint32_t*)0x1ff07a18)
34 #define U_ID_0 (*(uint32_t*)0x1ff0f420)
35 #define U_ID_1 (*(uint32_t*)0x1ff0f424)
36 #define U_ID_2 (*(uint32_t*)0x1ff0f428)
43 #elif defined(STM32F40_41xxx) || defined (STM32F411xE) || defined (STM32F446xx)
45 #include "stm32f4xx_conf.h"
46 #include "stm32f4xx_rcc.h"
47 #include "stm32f4xx_gpio.h"
50 // Chip Unique ID on F405
51 #define U_ID_0 (*(uint32_t*)0x1fff7a10)
52 #define U_ID_1 (*(uint32_t*)0x1fff7a14)
53 #define U_ID_2 (*(uint32_t*)0x1fff7a18)
59 #elif defined(STM32F303xC)
60 #include "stm32f30x_conf.h"
61 #include "stm32f30x_rcc.h"
62 #include "stm32f30x_gpio.h"
65 // Chip Unique ID on F303
66 #define U_ID_0 (*(uint32_t*)0x1FFFF7AC)
67 #define U_ID_1 (*(uint32_t*)0x1FFFF7B0)
68 #define U_ID_2 (*(uint32_t*)0x1FFFF7B4)
74 #elif defined(STM32F10X)
76 #include "stm32f10x_conf.h"
77 #include "stm32f10x_gpio.h"
80 // Chip Unique ID on F103
81 #define U_ID_0 (*(uint32_t*)0x1FFFF7E8)
82 #define U_ID_1 (*(uint32_t*)0x1FFFF7EC)
83 #define U_ID_2 (*(uint32_t*)0x1FFFF7F0)
94 #error "Invalid chipset specified. Update platform.h"
98 #include "target/common_osd_slave.h"
101 #include "target/common_fc_pre.h"
103 #include "target/common_fc_post.h"