Skip to content

Commit 59affad

Browse files
committed
STM32U5: STM32Cube_FW_U5_V1.0.0
1 parent 234d5ff commit 59affad

File tree

256 files changed

+362047
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

256 files changed

+362047
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright (c) 2020 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
add_subdirectory(TARGET_STM32U575xG EXCLUDE_FROM_ALL)
5+
add_subdirectory(TARGET_STM32U575xI EXCLUDE_FROM_ALL)
6+
add_subdirectory(TARGET_STM32U585xI EXCLUDE_FROM_ALL)
7+
add_subdirectory(STM32Cube_FW EXCLUDE_FROM_ALL)
8+
9+
add_library(mbed-stm32u5 INTERFACE)
10+
11+
target_include_directories(mbed-stm32u5
12+
INTERFACE
13+
.
14+
)
15+
16+
target_sources(mbed-stm32u5
17+
INTERFACE
18+
)
19+
20+
target_link_libraries(mbed-stm32u5 INTERFACE mbed-stm mbed-stm32u5cube-fw)
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
/**
2+
******************************************************************************
3+
* @file partition_stm32u5xx.h
4+
* @author MCD Application Team
5+
* @brief CMSIS STM32U5xx Device Header File for Initial Setup for
6+
* Secure / Non-Secure Zones based on CMSIS CORE V5.4.0
7+
*
8+
* The file is included in system_stm32u5xx_s.c in secure application.
9+
* It includes the configuration section that allows to select the
10+
* STM32U5xx device partitioning file for system core secure attributes
11+
* and interrupt secure and non-secure assignment.
12+
*
13+
******************************************************************************
14+
* @attention
15+
*
16+
* Copyright (c) 2021 STMicroelectronics.
17+
* All rights reserved.
18+
*
19+
* This software is licensed under terms that can be found in the LICENSE file
20+
* in the root directory of this software component.
21+
* If no LICENSE file comes with this software, it is provided AS-IS.
22+
*
23+
******************************************************************************
24+
*/
25+
26+
/** @addtogroup CMSIS
27+
* @{
28+
*/
29+
30+
/** @addtogroup stm32u5xx
31+
* @{
32+
*/
33+
34+
#ifndef PARTITION_STM32U5XX_H
35+
#define PARTITION_STM32U5XX_H
36+
37+
#ifdef __cplusplus
38+
extern "C" {
39+
#endif /* __cplusplus */
40+
41+
/** @addtogroup Secure_configuration_section
42+
* @{
43+
*/
44+
45+
#if defined(STM32U575xx)
46+
#include "partition_stm32u575xx.h"
47+
#elif defined(STM32U585xx)
48+
#include "partition_stm32u585xx.h"
49+
#else
50+
#error "Please select first the target STM32U5xx device used in your application (in stm32u5xx.h file)"
51+
#endif
52+
53+
54+
#ifdef __cplusplus
55+
}
56+
#endif /* __cplusplus */
57+
58+
#endif /* PARTITION_STM32U5XX_H */
59+
/**
60+
* @}
61+
*/
62+
63+
/**
64+
* @}
65+
*/
66+
67+
68+
69+

targets/TARGET_STM/TARGET_STM32U5/STM32Cube_FW/CMSIS/stm32u575xx.h

Lines changed: 23799 additions & 0 deletions
Large diffs are not rendered by default.

targets/TARGET_STM/TARGET_STM32U5/STM32Cube_FW/CMSIS/stm32u585xx.h

Lines changed: 24671 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 233 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,233 @@
1+
/**
2+
******************************************************************************
3+
* @file stm32u5xx.h
4+
* @author MCD Application Team
5+
* @brief CMSIS STM32U5xx Device Peripheral Access Layer Header File.
6+
*
7+
* The file is the unique include file that the application programmer
8+
* is using in the C source code, usually in main.c. This file contains:
9+
* - Configuration section that allows to select:
10+
* - The STM32U5xx device used in the target application
11+
* - To use or not the peripheral's drivers in application code(i.e.
12+
* code will be based on direct access to peripheral's registers
13+
* rather than drivers API), this option is controlled by
14+
* "#define USE_HAL_DRIVER"
15+
*
16+
******************************************************************************
17+
* @attention
18+
*
19+
* Copyright (c) 2021 STMicroelectronics.
20+
* All rights reserved.
21+
*
22+
* This software is licensed under terms that can be found in the LICENSE file
23+
* in the root directory of this software component.
24+
* If no LICENSE file comes with this software, it is provided AS-IS.
25+
*
26+
******************************************************************************
27+
*/
28+
29+
/** @addtogroup CMSIS
30+
* @{
31+
*/
32+
33+
/** @addtogroup stm32u5xx
34+
* @{
35+
*/
36+
37+
#ifndef STM32U5xx_H
38+
#define STM32U5xx_H
39+
40+
#ifdef __cplusplus
41+
extern "C" {
42+
#endif /* __cplusplus */
43+
44+
/** @addtogroup Library_configuration_section
45+
* @{
46+
*/
47+
48+
/**
49+
* @brief STM32 Family
50+
*/
51+
#if !defined (STM32U5)
52+
#define STM32U5
53+
#endif /* STM32U5 */
54+
55+
/* Uncomment the line below according to the target STM32U5 device used in your
56+
application
57+
*/
58+
59+
#if !defined (STM32U575xx) && !defined (STM32U585xx)
60+
/* #define STM32U575xx */ /*!< STM32U575CIU6 STM32U575CIT6 STM32U575RIT6 STM32U575VIT6 STM32U575ZIT6 STM32U575QII6 STM32U575AII6 STM32U575CIU6Q STM32U575CIT6Q STM32U575OIY6Q STM32U575VIT6Q STM32U575QII6Q STM32U575ZIT6Q STM32U575RIT6Q STM32U575CGU6 STM32U575CGT6 STM32U575RGT6 STM32U575VGT6 STM32U575ZGT6 STM32U575QGI6 STM32U575AGI6 STM32U575CGU6Q STM32U575CGT6Q STM32U575OGY6Q STM32U575VGT6Q STM32U575QGI6Q STM32U575ZGT6Q STM32U575RGT6Q STM32U575AGI6Q Devices */
61+
/* #define STM32U585xx */ /*!< STM32U585CIU6 STM32U585CIT6 STM32U585RIT6 STM32U585VIT6 STM32U585AII6 STM32U585QII6 STM32U585ZIT6 STM32U585OIY6Q STM32U585VIT6Q STM32U585QEI6Q STM32U585RIT6Q STM32U585AII6Q STM32U585CIU6Q STM32U585CIT6Q STM32U585ZET6Q Devices */
62+
#endif
63+
64+
/* Tip: To avoid modifying this file each time you need to switch between these
65+
devices, you can define the device in your toolchain compiler preprocessor.
66+
*/
67+
#if !defined (USE_HAL_DRIVER)
68+
/**
69+
* @brief Comment the line below if you will not use the peripherals drivers.
70+
In this case, these drivers will not be included and the application code will
71+
be based on direct access to peripherals registers
72+
*/
73+
/*#define USE_HAL_DRIVER */
74+
#endif /* USE_HAL_DRIVER */
75+
76+
/**
77+
* @brief CMSIS Device version number 1.0.0
78+
*/
79+
#define __STM32U5_CMSIS_VERSION_MAIN (0x01) /*!< [31:24] main version */
80+
#define __STM32U5_CMSIS_VERSION_SUB1 (0x00) /*!< [23:16] sub1 version */
81+
#define __STM32U5_CMSIS_VERSION_SUB2 (0x00) /*!< [15:8] sub2 version */
82+
#define __STM32U5_CMSIS_VERSION_RC (0x00) /*!< [7:0] release candidate */
83+
#define __STM32U5_CMSIS_VERSION ((__STM32U5_CMSIS_VERSION_MAIN << 24U)\
84+
|(__STM32U5_CMSIS_VERSION_SUB1 << 16U)\
85+
|(__STM32U5_CMSIS_VERSION_SUB2 << 8U )\
86+
|(__STM32U5_CMSIS_VERSION_RC))
87+
88+
/**
89+
* @}
90+
*/
91+
92+
/** @addtogroup Device_Included
93+
* @{
94+
*/
95+
96+
#if defined(STM32U575xx)
97+
#include "stm32u575xx.h"
98+
#elif defined(STM32U585xx)
99+
#include "stm32u585xx.h"
100+
#else
101+
#error "Please select first the target STM32U5xx device used in your application (in stm32u5xx.h file)"
102+
#endif
103+
104+
/**
105+
* @}
106+
*/
107+
108+
/** @addtogroup Exported_types
109+
* @{
110+
*/
111+
typedef enum
112+
{
113+
RESET = 0,
114+
SET = !RESET
115+
} FlagStatus, ITStatus;
116+
117+
typedef enum
118+
{
119+
DISABLE = 0,
120+
ENABLE = !DISABLE
121+
} FunctionalState;
122+
#define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))
123+
124+
typedef enum
125+
{
126+
SUCCESS = 0,
127+
ERROR = !SUCCESS
128+
} ErrorStatus;
129+
130+
/**
131+
* @}
132+
*/
133+
134+
135+
/** @addtogroup Exported_macros
136+
* @{
137+
*/
138+
#define SET_BIT(REG, BIT) ((REG) |= (BIT))
139+
140+
#define CLEAR_BIT(REG, BIT) ((REG) &= ~(BIT))
141+
142+
#define READ_BIT(REG, BIT) ((REG) & (BIT))
143+
144+
#define CLEAR_REG(REG) ((REG) = (0x0))
145+
146+
#define WRITE_REG(REG, VAL) ((REG) = (VAL))
147+
148+
#define READ_REG(REG) ((REG))
149+
150+
#define MODIFY_REG(REG, CLEARMASK, SETMASK) WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK)))
151+
152+
/* Use of CMSIS compiler intrinsics for register exclusive access */
153+
/* Atomic 32-bit register access macro to set one or several bits */
154+
#define ATOMIC_SET_BIT(REG, BIT) \
155+
do { \
156+
uint32_t val; \
157+
do { \
158+
val = __LDREXW((__IO uint32_t *)&(REG)) | (BIT); \
159+
} while ((__STREXW(val,(__IO uint32_t *)&(REG))) != 0U); \
160+
} while(0)
161+
162+
/* Atomic 32-bit register access macro to clear one or several bits */
163+
#define ATOMIC_CLEAR_BIT(REG, BIT) \
164+
do { \
165+
uint32_t val; \
166+
do { \
167+
val = __LDREXW((__IO uint32_t *)&(REG)) & ~(BIT); \
168+
} while ((__STREXW(val,(__IO uint32_t *)&(REG))) != 0U); \
169+
} while(0)
170+
171+
/* Atomic 32-bit register access macro to clear and set one or several bits */
172+
#define ATOMIC_MODIFY_REG(REG, CLEARMSK, SETMASK) \
173+
do { \
174+
uint32_t val; \
175+
do { \
176+
val = (__LDREXW((__IO uint32_t *)&(REG)) & ~(CLEARMSK)) | (SETMASK); \
177+
} while ((__STREXW(val,(__IO uint32_t *)&(REG))) != 0U); \
178+
} while(0)
179+
180+
/* Atomic 16-bit register access macro to set one or several bits */
181+
#define ATOMIC_SETH_BIT(REG, BIT) \
182+
do { \
183+
uint16_t val; \
184+
do { \
185+
val = __LDREXH((__IO uint16_t *)&(REG)) | (BIT); \
186+
} while ((__STREXH(val,(__IO uint16_t *)&(REG))) != 0U); \
187+
} while(0)
188+
189+
/* Atomic 16-bit register access macro to clear one or several bits */
190+
#define ATOMIC_CLEARH_BIT(REG, BIT) \
191+
do { \
192+
uint16_t val; \
193+
do { \
194+
val = __LDREXH((__IO uint16_t *)&(REG)) & ~(BIT); \
195+
} while ((__STREXH(val,(__IO uint16_t *)&(REG))) != 0U); \
196+
} while(0)
197+
198+
/* Atomic 16-bit register access macro to clear and set one or several bits */
199+
#define ATOMIC_MODIFYH_REG(REG, CLEARMSK, SETMASK) \
200+
do { \
201+
uint16_t val; \
202+
do { \
203+
val = (__LDREXH((__IO uint16_t *)&(REG)) & ~(CLEARMSK)) | (SETMASK); \
204+
} while ((__STREXH(val,(__IO uint16_t *)&(REG))) != 0U); \
205+
} while(0)
206+
207+
#define POSITION_VAL(VAL) (__CLZ(__RBIT(VAL)))
208+
209+
210+
/**
211+
* @}
212+
*/
213+
214+
#if defined (USE_HAL_DRIVER)
215+
#include "stm32u5xx_hal.h"
216+
#endif /* USE_HAL_DRIVER */
217+
218+
#ifdef __cplusplus
219+
}
220+
#endif /* __cplusplus */
221+
222+
#endif /* STM32U5xx_H */
223+
/**
224+
* @}
225+
*/
226+
227+
/**
228+
* @}
229+
*/
230+
231+
232+
233+

0 commit comments

Comments
 (0)