Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7ee0f17

Browse files
committed
Updated STM32F4xx HAL Drivers to v1.7.4
Included in STM32CubeF4 FW V1.21.0Signed-off-by: Frederic.Pillon <frederic.pillon@st.com>
1 parent238026d commit7ee0f17

File tree

7 files changed

+70
-39
lines changed

7 files changed

+70
-39
lines changed

‎system/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h‎

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ typedef enum
7070
}HAL_LockTypeDef;
7171

7272
/* Exported macro ------------------------------------------------------------*/
73+
74+
#defineUNUSED(X) (void)X/* To avoid gcc/g++ warnings */
75+
7376
#defineHAL_MAX_DELAY 0xFFFFFFFFU
7477

7578
#defineHAL_IS_BIT_SET(REG,BIT) (((REG) & (BIT)) != RESET)
@@ -79,9 +82,7 @@ typedef enum
7982
do{ \
8083
(__HANDLE__)->__PPP_DMA_FIELD__ = &(__DMA_HANDLE__); \
8184
(__DMA_HANDLE__).Parent = (__HANDLE__); \
82-
} while(0)
83-
84-
#defineUNUSED(x) ((void)(x))
85+
} while(0U)
8586

8687
/** @brief Reset the Handle's State field.
8788
* @param __HANDLE__ specifies the Peripheral Handle.
@@ -135,7 +136,7 @@ typedef enum
135136
/* Macro to get variable aligned on 4-bytes, for __ICCARM__ the directive "#pragma data_alignment=4" must be used instead */
136137
#if defined (__GNUC__ )&& !defined (__CC_ARM)/* GNU Compiler */
137138
#ifndef__ALIGN_END
138-
#define__ALIGN_END __attribute__ ((aligned (4)))
139+
#define__ALIGN_END __attribute__ ((aligned (4)))
139140
#endif/* __ALIGN_END */
140141
#ifndef__ALIGN_BEGIN
141142
#define__ALIGN_BEGIN
@@ -146,7 +147,7 @@ typedef enum
146147
#endif/* __ALIGN_END */
147148
#ifndef__ALIGN_BEGIN
148149
#if defined (__CC_ARM)/* ARM Compiler */
149-
#define__ALIGN_BEGIN __align(4)
150+
#define__ALIGN_BEGIN __align(4)
150151
#elif defined (__ICCARM__)/* IAR Compiler */
151152
#define__ALIGN_BEGIN
152153
#endif/* __CC_ARM */
@@ -167,22 +168,22 @@ typedef enum
167168
Available memory areas are declared in the 'Target' tab of the 'Options for Target'
168169
dialog.
169170
*/
170-
#define__RAM_FUNC HAL_StatusTypeDef
171+
#define__RAM_FUNC
171172

172173
#elif defined (__ICCARM__ )
173174
/* ICCARM Compiler
174175
---------------
175176
RAM functions are defined using a specific toolchain keyword "__ramfunc".
176177
*/
177-
#define__RAM_FUNC __ramfunc HAL_StatusTypeDef
178+
#define__RAM_FUNC __ramfunc
178179

179180
#elif defined (__GNUC__ )
180181
/* GNU Compiler
181182
------------
182183
RAM functions are defined using a specific toolchain attribute
183184
"__attribute__((section(".RamFunc")))".
184185
*/
185-
#define__RAM_FUNCHAL_StatusTypeDef__attribute__((section(".RamFunc")))
186+
#define__RAM_FUNC __attribute__((section(".RamFunc")))
186187

187188
#endif
188189

‎system/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ramfunc.h‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@
6464
/** @addtogroup FLASH_RAMFUNC_Exported_Functions_Group1
6565
* @{
6666
*/
67-
__RAM_FUNCHAL_FLASHEx_StopFlashInterfaceClk(void);
68-
__RAM_FUNCHAL_FLASHEx_StartFlashInterfaceClk(void);
69-
__RAM_FUNCHAL_FLASHEx_EnableFlashSleepMode(void);
70-
__RAM_FUNCHAL_FLASHEx_DisableFlashSleepMode(void);
67+
__RAM_FUNCHAL_StatusTypeDefHAL_FLASHEx_StopFlashInterfaceClk(void);
68+
__RAM_FUNCHAL_StatusTypeDefHAL_FLASHEx_StartFlashInterfaceClk(void);
69+
__RAM_FUNCHAL_StatusTypeDefHAL_FLASHEx_EnableFlashSleepMode(void);
70+
__RAM_FUNCHAL_StatusTypeDefHAL_FLASHEx_DisableFlashSleepMode(void);
7171
/**
7272
* @}
7373
*/

‎system/Drivers/STM32F4xx_HAL_Driver/Release_Notes.html‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
1+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
22
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head>
33

44

@@ -922,7 +922,9 @@ <h1 style="margin-bottom: 0.25in; text-align: center;" align="center"><span styl
922922
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" width="900">
923923
<tbody><tr style="">
924924
<td style="padding: 0in;" valign="top">
925-
<h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"><a name="History"></a><span style="font-size: 12pt; color: white;">Update History</span></h2><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 274px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.7.3 / 22-December-2017</span></h3><p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
925+
<h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"><a name="History"></a><span style="font-size: 12pt; color: white;">Update History</span></h2><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 274px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.7.4 / 02-February-2018</span></h3><p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
926+
Changes</span></u></b></p><ul style="margin-bottom: 0in; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; margin-top: 0cm;" type="square"><li class="MsoNormal" style="color: black; margin-top: 4.5pt; margin-bottom: 4.5pt;"><span style="font-family: Verdana,sans-serif; font-size: 10pt;">General updates
927+
to fix known defects and enhancements implementation</span></li><li class="MsoNormal" style="color: black; margin-top: 4.5pt; margin-bottom: 4.5pt;"><span style="font-family: 'Verdana','sans-serif'; font-size: 10pt;"><span style="font-weight: bold;">HAL&nbsp;</span>update</span></li><ul><li class="MsoNormal" style="color: black; margin-top: 4.5pt; margin-bottom: 4.5pt;"><span style="font-family: 'Verdana','sans-serif'; font-size: 10pt;">Update UNUSED() macro implementation to avoid GCC warning</span></li><ul><li class="MsoNormal" style="color: black; margin-top: 4.5pt; margin-bottom: 4.5pt;"><span style="font-family: 'Verdana','sans-serif'; font-size: 10pt;">The warning is detected when the UNUSED() macro is called from C++ file</span></li></ul><li class="MsoNormal" style="color: black; margin-top: 4.5pt; margin-bottom: 4.5pt;"><span style="font-family: 'Verdana','sans-serif'; font-size: 10pt;">Update to make RAMFUNC define as generic type instead of HAL_StatusTypdef type.</span></li></ul><li class="MsoNormal" style="color: black; margin-top: 4.5pt; margin-bottom: 4.5pt;"><span style="font-family: 'Verdana','sans-serif'; font-size: 10pt;"><span style="font-weight: bold;">HAL FLASH </span>update</span></li><ul><li class="MsoNormal" style="color: black; margin-top: 4.5pt; margin-bottom: 4.5pt;"><span style="font-family: 'Verdana','sans-serif'; font-size: 10pt;">Update the&nbsp;prototypes of the following APIs after change on RAMFUNC defines&nbsp;</span></li><ul><li class="MsoNormal" style="color: black; margin-top: 4.5pt; margin-bottom: 4.5pt;"><span style="font-family: 'Verdana','sans-serif'; font-size: 10pt;">HAL_FLASHEx_StopFlashInterfaceClk()</span></li><li class="MsoNormal" style="color: black; margin-top: 4.5pt; margin-bottom: 4.5pt;"><span style="font-family: 'Verdana','sans-serif'; font-size: 10pt;">HAL_FLASHEx_StartFlashInterfaceClk()</span></li><li class="MsoNormal" style="color: black; margin-top: 4.5pt; margin-bottom: 4.5pt;"><span style="font-family: 'Verdana','sans-serif'; font-size: 10pt;">HAL_FLASHEx_EnableFlashSleepMode()</span></li><li class="MsoNormal" style="color: black; margin-top: 4.5pt; margin-bottom: 4.5pt;"><span style="font-family: 'Verdana','sans-serif'; font-size: 10pt;">HAL_FLASHEx_DisableFlashSleepMode()<br></span></li></ul></ul><li class="MsoNormal" style="color: black; margin-top: 4.5pt; margin-bottom: 4.5pt;"><span style="font-family: 'Verdana','sans-serif'; font-size: 10pt;"><span style="font-weight: bold;">HAL SAI </span>update</span></li><ul><li class="MsoNormal" style="color: black; margin-top: 4.5pt; margin-bottom: 4.5pt;"><span style="font-family: 'Verdana','sans-serif'; font-size: 10pt;">Update HAL_SAI_DMAStop() and HAL_SAI_Abort() process to fix the lock/unlock audio issue</span></li></ul></ul><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 274px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.7.3 / 22-December-2017</span></h3><p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
926928
Changes</span></u></b></p><ul style="margin-bottom: 0in; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; margin-top: 0cm;" type="square"><li class="MsoNormal" style="color: black; margin-top: 4.5pt; margin-bottom: 4.5pt;"><span style="font-family: Verdana,sans-serif; font-size: 10pt;">General updates
927929
to fix known defects and enhancements implementation</span></li><li class="MsoNormal" style="margin: 4.5pt 0in; font-size: 12pt; font-family: 'Times New Roman',serif; color: black;"><span style="font-family: Verdana,sans-serif; font-size: 10pt;"><span style="font-weight: bold;">The following changes done on the HAL drivers require an update on the application code based on older HAL versions</span></span></li><ul style="margin-bottom: 0in;"><li class="MsoNormal" style="margin: 4.5pt 0in; font-size: 12pt; font-family: &quot;Times New Roman&quot;,serif; color: black; font-weight: bold;"><span style="font-size: 10pt; font-family: Verdana;">Rework of HAL CAN driver (compatibility break)&nbsp;</span></li><ul style="margin-bottom: 0in;"><li class="MsoNormal" style="margin: 4.5pt 0in; font-size: 12pt; font-family: &quot;Times New Roman&quot;,serif; color: black;"><span style="font-size: 10pt; font-family: Verdana;">A
928930
new HAL CAN driver has been redesigned with new APIs, to bypass

‎system/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@
6666
* @{
6767
*/
6868
/**
69-
* @brief STM32F4xx HAL Driver version number V1.7.3
69+
* @brief STM32F4xx HAL Driver version number V1.7.4
7070
*/
7171
#define__STM32F4xx_HAL_VERSION_MAIN (0x01U)/*!< [31:24] main version */
7272
#define__STM32F4xx_HAL_VERSION_SUB1 (0x07U)/*!< [23:16] sub1 version */
73-
#define__STM32F4xx_HAL_VERSION_SUB2 (0x03U)/*!< [15:8] sub2 version */
73+
#define__STM32F4xx_HAL_VERSION_SUB2 (0x04U)/*!< [15:8] sub2 version */
7474
#define__STM32F4xx_HAL_VERSION_RC (0x00U)/*!< [7:0] release candidate */
7575
#define__STM32F4xx_HAL_VERSION ((__STM32F4xx_HAL_VERSION_MAIN << 24U)\
7676
|(__STM32F4xx_HAL_VERSION_SUB1 << 16U)\

‎system/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@
107107
* @note This mode is only available for STM32F41xxx/STM32F446xx devices.
108108
* @note This mode couldn't be set while executing with the flash itself.
109109
* It should be done with specific routine executed from RAM.
110-
* @retvalNone
110+
* @retvalHAL status
111111
*/
112-
__RAM_FUNCHAL_FLASHEx_StopFlashInterfaceClk(void)
112+
__RAM_FUNCHAL_StatusTypeDefHAL_FLASHEx_StopFlashInterfaceClk(void)
113113
{
114114
/* Enable Power ctrl clock */
115115
__HAL_RCC_PWR_CLK_ENABLE();
@@ -124,9 +124,9 @@ __RAM_FUNC HAL_FLASHEx_StopFlashInterfaceClk(void)
124124
* @note This mode is only available for STM32F411xx/STM32F446xx devices.
125125
* @note This mode couldn't be set while executing with the flash itself.
126126
* It should be done with specific routine executed from RAM.
127-
* @retvalNone
127+
* @retvalHAL status
128128
*/
129-
__RAM_FUNCHAL_FLASHEx_StartFlashInterfaceClk(void)
129+
__RAM_FUNCHAL_StatusTypeDefHAL_FLASHEx_StartFlashInterfaceClk(void)
130130
{
131131
/* Enable Power ctrl clock */
132132
__HAL_RCC_PWR_CLK_ENABLE();
@@ -141,9 +141,9 @@ __RAM_FUNC HAL_FLASHEx_StartFlashInterfaceClk(void)
141141
* @note This mode is only available for STM32F41xxx/STM32F446xx devices.
142142
* @note This mode could n't be set while executing with the flash itself.
143143
* It should be done with specific routine executed from RAM.
144-
* @retvalNone
144+
* @retvalHAL status
145145
*/
146-
__RAM_FUNCHAL_FLASHEx_EnableFlashSleepMode(void)
146+
__RAM_FUNCHAL_StatusTypeDefHAL_FLASHEx_EnableFlashSleepMode(void)
147147
{
148148
/* Enable Power ctrl clock */
149149
__HAL_RCC_PWR_CLK_ENABLE();
@@ -158,9 +158,9 @@ __RAM_FUNC HAL_FLASHEx_EnableFlashSleepMode(void)
158158
* @note This mode is only available for STM32F41xxx/STM32F446xx devices.
159159
* @note This mode couldn't be set while executing with the flash itself.
160160
* It should be done with specific routine executed from RAM.
161-
* @retvalNone
161+
* @retvalHAL status
162162
*/
163-
__RAM_FUNCHAL_FLASHEx_DisableFlashSleepMode(void)
163+
__RAM_FUNCHAL_StatusTypeDefHAL_FLASHEx_DisableFlashSleepMode(void)
164164
{
165165
/* Enable Power ctrl clock */
166166
__HAL_RCC_PWR_CLK_ENABLE();

‎system/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sai.c‎

Lines changed: 42 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -987,26 +987,39 @@ HAL_StatusTypeDef HAL_SAI_DMAResume(SAI_HandleTypeDef *hsai)
987987
*/
988988
HAL_StatusTypeDefHAL_SAI_DMAStop(SAI_HandleTypeDef*hsai)
989989
{
990+
HAL_StatusTypeDefstatus=HAL_OK;
991+
990992
/* Process Locked */
991993
__HAL_LOCK(hsai);
992994

993995
/* Disable the SAI DMA request */
994996
hsai->Instance->CR1 &= ~SAI_xCR1_DMAEN;
995997

996-
/* Abort the SAI DMAStreams */
997-
if(hsai->hdmatx!=NULL)
998+
/* Abort the SAITxDMAStream */
999+
if((hsai->hdmatx!=NULL)&& (hsai->State==HAL_SAI_STATE_BUSY_TX))
9981000
{
9991001
if(HAL_DMA_Abort(hsai->hdmatx)!=HAL_OK)
10001002
{
1001-
returnHAL_ERROR;
1003+
/* If the DMA Tx errorCode is different from DMA No Transfer then return Error */
1004+
if(hsai->hdmatx->ErrorCode!=HAL_DMA_ERROR_NO_XFER)
1005+
{
1006+
status=HAL_ERROR;
1007+
hsai->ErrorCode |=HAL_SAI_ERROR_DMA;
1008+
}
10021009
}
10031010
}
10041011

1005-
if(hsai->hdmarx!=NULL)
1012+
/* Abort the SAI Rx DMA Stream */
1013+
if((hsai->hdmarx!=NULL)&& (hsai->State==HAL_SAI_STATE_BUSY_RX))
10061014
{
10071015
if(HAL_DMA_Abort(hsai->hdmarx)!=HAL_OK)
10081016
{
1009-
returnHAL_ERROR;
1017+
/* If the DMA Rx errorCode is different from DMA No Transfer then return Error */
1018+
if(hsai->hdmarx->ErrorCode!=HAL_DMA_ERROR_NO_XFER)
1019+
{
1020+
status=HAL_ERROR;
1021+
hsai->ErrorCode |=HAL_SAI_ERROR_DMA;
1022+
}
10101023
}
10111024
}
10121025

@@ -1016,12 +1029,13 @@ HAL_StatusTypeDef HAL_SAI_DMAStop(SAI_HandleTypeDef *hsai)
10161029
/* Flush the fifo */
10171030
SET_BIT(hsai->Instance->CR2,SAI_xCR2_FFLUSH);
10181031

1032+
/* Set hsai state to ready */
10191033
hsai->State=HAL_SAI_STATE_READY;
10201034

10211035
/* Process Unlocked */
10221036
__HAL_UNLOCK(hsai);
10231037

1024-
returnHAL_OK;
1038+
returnstatus;
10251039
}
10261040

10271041
/**
@@ -1032,6 +1046,8 @@ HAL_StatusTypeDef HAL_SAI_DMAStop(SAI_HandleTypeDef *hsai)
10321046
*/
10331047
HAL_StatusTypeDefHAL_SAI_Abort(SAI_HandleTypeDef*hsai)
10341048
{
1049+
HAL_StatusTypeDefstatus=HAL_OK;
1050+
10351051
/* Process Locked */
10361052
__HAL_LOCK(hsai);
10371053

@@ -1040,21 +1056,32 @@ HAL_StatusTypeDef HAL_SAI_Abort(SAI_HandleTypeDef *hsai)
10401056
{
10411057
/* Disable the SAI DMA request */
10421058
hsai->Instance->CR1 &= ~SAI_xCR1_DMAEN;
1043-
1044-
/* Abort the SAI DMAStreams */
1045-
if(hsai->hdmatx!=NULL)
1059+
1060+
/* Abort the SAITxDMAStream */
1061+
if((hsai->hdmatx!=NULL)&& (hsai->State==HAL_SAI_STATE_BUSY_TX))
10461062
{
10471063
if(HAL_DMA_Abort(hsai->hdmatx)!=HAL_OK)
10481064
{
1049-
returnHAL_ERROR;
1065+
/* If the DMA Tx errorCode is different from DMA No Transfer then return Error */
1066+
if(hsai->hdmatx->ErrorCode!=HAL_DMA_ERROR_NO_XFER)
1067+
{
1068+
status=HAL_ERROR;
1069+
hsai->ErrorCode |=HAL_SAI_ERROR_DMA;
1070+
}
10501071
}
10511072
}
1052-
1053-
if(hsai->hdmarx!=NULL)
1073+
1074+
/* Abort the SAI Rx DMA Stream */
1075+
if((hsai->hdmarx!=NULL)&& (hsai->State==HAL_SAI_STATE_BUSY_RX))
10541076
{
10551077
if(HAL_DMA_Abort(hsai->hdmarx)!=HAL_OK)
10561078
{
1057-
returnHAL_ERROR;
1079+
/* If the DMA Rx errorCode is different from DMA No Transfer then return Error */
1080+
if(hsai->hdmarx->ErrorCode!=HAL_DMA_ERROR_NO_XFER)
1081+
{
1082+
status=HAL_ERROR;
1083+
hsai->ErrorCode |=HAL_SAI_ERROR_DMA;
1084+
}
10581085
}
10591086
}
10601087
}
@@ -1069,12 +1096,13 @@ HAL_StatusTypeDef HAL_SAI_Abort(SAI_HandleTypeDef *hsai)
10691096
/* Flush the fifo */
10701097
SET_BIT(hsai->Instance->CR2,SAI_xCR2_FFLUSH);
10711098

1099+
/* Set hsai state to ready */
10721100
hsai->State=HAL_SAI_STATE_READY;
10731101

10741102
/* Process Unlocked */
10751103
__HAL_UNLOCK(hsai);
10761104

1077-
returnHAL_OK;
1105+
returnstatus;
10781106
}
10791107

10801108
/**

‎system/Drivers/STM32YYxx_HAL_Driver_version.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* STM32F1: 1.1.1
55
* STM32F2: 1.2.2
66
* STM32F3: 1.5.0
7-
* STM32F4: 1.7.3
7+
* STM32F4: 1.7.4
88
* STM32F7: 1.2.5
99
* STM32L0: 1.8.2
1010
* STM32L1: 1.3.1

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp