Skip to content

Commit aa22c4b

Browse files
committed
STM32F4 V1.19.0 -> V1.25.0 : Driver part
1 parent 480fd2a commit aa22c4b

File tree

189 files changed

+67640
-42158
lines changed

Some content is hidden

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

189 files changed

+67640
-42158
lines changed

targets/TARGET_STM/TARGET_STM32F4/STM32Cube_FW/STM32F4xx_HAL_Driver/Legacy/stm32_hal_legacy.h

Lines changed: 578 additions & 111 deletions
Large diffs are not rendered by default.

targets/TARGET_STM/TARGET_STM32F4/STM32Cube_FW/STM32F4xx_HAL_Driver/Legacy/stm32f4xx_hal_can_legacy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
#error 'The HAL CAN driver cannot be used with its legacy, Please ensure to enable only one HAL CAN module at once in stm32f4xx_hal_conf.h file'
137137
#endif /* HAL_CAN_MODULE_ENABLED */
138138

139-
// #warning 'Legacy HAL CAN driver is enabled! It can be used with known limitations, refer to the release notes. However it is recommended to use rather the new HAL CAN driver'
139+
#warning 'Legacy HAL CAN driver is enabled! It can be used with known limitations, refer to the release notes. However it is recommended to use rather the new HAL CAN driver'
140140

141141
/* Private typedef -----------------------------------------------------------*/
142142
/* Private define ------------------------------------------------------------*/

targets/TARGET_STM/TARGET_STM32F4/STM32Cube_FW/STM32F4xx_HAL_Driver/stm32f4xx_hal.c

Lines changed: 43 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -21,29 +21,13 @@
2121
******************************************************************************
2222
* @attention
2323
*
24-
* <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
24+
* <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
25+
* All rights reserved.</center></h2>
2526
*
26-
* Redistribution and use in source and binary forms, with or without modification,
27-
* are permitted provided that the following conditions are met:
28-
* 1. Redistributions of source code must retain the above copyright notice,
29-
* this list of conditions and the following disclaimer.
30-
* 2. Redistributions in binary form must reproduce the above copyright notice,
31-
* this list of conditions and the following disclaimer in the documentation
32-
* and/or other materials provided with the distribution.
33-
* 3. Neither the name of STMicroelectronics nor the names of its contributors
34-
* may be used to endorse or promote products derived from this software
35-
* without specific prior written permission.
36-
*
37-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
38-
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
39-
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
40-
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
41-
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
42-
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
43-
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
44-
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
45-
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
46-
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27+
* This software component is licensed by ST under BSD 3-Clause license,
28+
* the "License"; You may not use this file except in compliance with the
29+
* License. You may obtain a copy of the License at:
30+
* opensource.org/licenses/BSD-3-Clause
4731
*
4832
******************************************************************************
4933
*/
@@ -66,11 +50,11 @@
6650
* @{
6751
*/
6852
/**
69-
* @brief STM32F4xx HAL Driver version number V1.7.3
53+
* @brief STM32F4xx HAL Driver version number V1.7.8
7054
*/
7155
#define __STM32F4xx_HAL_VERSION_MAIN (0x01U) /*!< [31:24] main version */
7256
#define __STM32F4xx_HAL_VERSION_SUB1 (0x07U) /*!< [23:16] sub1 version */
73-
#define __STM32F4xx_HAL_VERSION_SUB2 (0x03U) /*!< [15:8] sub2 version */
57+
#define __STM32F4xx_HAL_VERSION_SUB2 (0x08U) /*!< [15:8] sub2 version */
7458
#define __STM32F4xx_HAL_VERSION_RC (0x00U) /*!< [7:0] release candidate */
7559
#define __STM32F4xx_HAL_VERSION ((__STM32F4xx_HAL_VERSION_MAIN << 24U)\
7660
|(__STM32F4xx_HAL_VERSION_SUB1 << 16U)\
@@ -357,14 +341,26 @@ uint32_t HAL_GetTickPrio(void)
357341
HAL_StatusTypeDef HAL_SetTickFreq(HAL_TickFreqTypeDef Freq)
358342
{
359343
HAL_StatusTypeDef status = HAL_OK;
344+
HAL_TickFreqTypeDef prevTickFreq;
345+
360346
assert_param(IS_TICKFREQ(Freq));
361347

362348
if (uwTickFreq != Freq)
363349
{
350+
/* Back up uwTickFreq frequency */
351+
prevTickFreq = uwTickFreq;
352+
353+
/* Update uwTickFreq global variable used by HAL_InitTick() */
364354
uwTickFreq = Freq;
365355

366356
/* Apply the new tick Freq */
367357
status = HAL_InitTick(uwTickPrio);
358+
359+
if (status != HAL_OK)
360+
{
361+
/* Restore previous tick frequency */
362+
uwTickFreq = prevTickFreq;
363+
}
368364
}
369365

370366
return status;
@@ -542,23 +538,38 @@ void HAL_DisableCompensationCell(void)
542538
}
543539

544540
/**
545-
* @brief Return the unique device identifier (UID based on 96 bits)
546-
* @param UID pointer to 3 words array.
541+
* @brief Returns first word of the unique device identifier (UID based on 96 bits)
542+
* @retval Device identifier
543+
*/
544+
uint32_t HAL_GetUIDw0(void)
545+
{
546+
return (READ_REG(*((uint32_t *)UID_BASE)));
547+
}
548+
549+
/**
550+
* @brief Returns second word of the unique device identifier (UID based on 96 bits)
551+
* @retval Device identifier
552+
*/
553+
uint32_t HAL_GetUIDw1(void)
554+
{
555+
return (READ_REG(*((uint32_t *)(UID_BASE + 4U))));
556+
}
557+
558+
/**
559+
* @brief Returns third word of the unique device identifier (UID based on 96 bits)
547560
* @retval Device identifier
548561
*/
549-
void HAL_GetUID(uint32_t *UID)
562+
uint32_t HAL_GetUIDw2(void)
550563
{
551-
UID[0] = (uint32_t)(READ_REG(*((uint32_t *)UID_BASE)));
552-
UID[1] = (uint32_t)(READ_REG(*((uint32_t *)(UID_BASE + 4U))));
553-
UID[2] = (uint32_t)(READ_REG(*((uint32_t *)(UID_BASE + 8U))));
564+
return (READ_REG(*((uint32_t *)(UID_BASE + 8U))));
554565
}
555566

556567
#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) ||\
557568
defined(STM32F469xx) || defined(STM32F479xx)
558569
/**
559570
* @brief Enables the Internal FLASH Bank Swapping.
560571
*
561-
* @note This function can be used only for STM32F42xxx/43xxx devices.
572+
* @note This function can be used only for STM32F42xxx/43xxx/469xx/479xx devices.
562573
*
563574
* @note Flash Bank2 mapped at 0x08000000 (and aliased @0x00000000)
564575
* and Flash Bank1 mapped at 0x08100000 (and aliased at 0x00100000)
@@ -573,7 +584,7 @@ void HAL_EnableMemorySwappingBank(void)
573584
/**
574585
* @brief Disables the Internal FLASH Bank Swapping.
575586
*
576-
* @note This function can be used only for STM32F42xxx/43xxx devices.
587+
* @note This function can be used only for STM32F42xxx/43xxx/469xx/479xx devices.
577588
*
578589
* @note The default state : Flash Bank1 mapped at 0x08000000 (and aliased @0x00000000)
579590
* and Flash Bank2 mapped at 0x08100000 (and aliased at 0x00100000)

targets/TARGET_STM/TARGET_STM32F4/STM32Cube_FW/STM32F4xx_HAL_Driver/stm32f4xx_hal.h

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,13 @@
77
******************************************************************************
88
* @attention
99
*
10-
* <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
10+
* <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
11+
* All rights reserved.</center></h2>
1112
*
12-
* Redistribution and use in source and binary forms, with or without modification,
13-
* are permitted provided that the following conditions are met:
14-
* 1. Redistributions of source code must retain the above copyright notice,
15-
* this list of conditions and the following disclaimer.
16-
* 2. Redistributions in binary form must reproduce the above copyright notice,
17-
* this list of conditions and the following disclaimer in the documentation
18-
* and/or other materials provided with the distribution.
19-
* 3. Neither the name of STMicroelectronics nor the names of its contributors
20-
* may be used to endorse or promote products derived from this software
21-
* without specific prior written permission.
22-
*
23-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24-
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25-
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26-
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
27-
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28-
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
29-
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30-
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
31-
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32-
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13+
* This software component is licensed by ST under BSD 3-Clause license,
14+
* the "License"; You may not use this file except in compliance with the
15+
* License. You may obtain a copy of the License at:
16+
* opensource.org/licenses/BSD-3-Clause
3317
*
3418
******************************************************************************
3519
*/
@@ -213,6 +197,18 @@ typedef enum
213197
* @}
214198
*/
215199

200+
/* Exported variables --------------------------------------------------------*/
201+
202+
/** @addtogroup HAL_Exported_Variables
203+
* @{
204+
*/
205+
extern __IO uint32_t uwTick;
206+
extern uint32_t uwTickPrio;
207+
extern HAL_TickFreqTypeDef uwTickFreq;
208+
/**
209+
* @}
210+
*/
211+
216212
/* Exported functions --------------------------------------------------------*/
217213
/** @addtogroup HAL_Exported_Functions
218214
* @{
@@ -253,7 +249,9 @@ void HAL_DBGMCU_EnableDBGStandbyMode(void);
253249
void HAL_DBGMCU_DisableDBGStandbyMode(void);
254250
void HAL_EnableCompensationCell(void);
255251
void HAL_DisableCompensationCell(void);
256-
void HAL_GetUID(uint32_t *UID);
252+
uint32_t HAL_GetUIDw0(void);
253+
uint32_t HAL_GetUIDw1(void);
254+
uint32_t HAL_GetUIDw2(void);
257255
#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) ||\
258256
defined(STM32F469xx) || defined(STM32F479xx)
259257
void HAL_EnableMemorySwappingBank(void);

0 commit comments

Comments
 (0)