From 139d2d9bd7f1d138e6cf5cd972b5893d0d391b8b Mon Sep 17 00:00:00 2001 From: "Mr.Tiger" <1039241323@qq.com> Date: Sat, 28 Aug 2021 17:55:19 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=9B=B4=E6=96=B0=E3=80=91STM32CubeF2?= =?UTF-8?q?=5FV1.9.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Device/ST/STM32F2xx/Include/stm32f2xx.h | 4 +- .../Device/ST/STM32F2xx/Release_Notes.html | 202 ++ .../Templates/gcc/startup_stm32f205xx.s | 4 +- .../Templates/gcc/startup_stm32f207xx.s | 2 +- .../Templates/gcc/startup_stm32f215xx.s | 4 +- .../Templates/gcc/startup_stm32f217xx.s | 4 +- .../Inc/Legacy/stm32_hal_legacy.h | 175 +- .../Inc/stm32f2xx_hal_i2c.h | 1 + .../Inc/stm32f2xx_hal_irda.h | 2 +- .../Inc/stm32f2xx_hal_smartcard.h | 2 +- .../Inc/stm32f2xx_hal_uart.h | 6 +- .../Inc/stm32f2xx_hal_usart.h | 2 +- .../Inc/stm32f2xx_ll_usart.h | 2 +- .../STM32F2xx_HAL_Driver/Release_Notes.html | 1961 +++++++++++++++++ .../STM32F2xx_HAL_Driver/Src/stm32f2xx_hal.c | 4 +- .../Src/stm32f2xx_hal_adc_ex.c | 63 +- .../Src/stm32f2xx_hal_gpio.c | 56 +- .../Src/stm32f2xx_hal_i2c.c | 246 ++- .../Src/stm32f2xx_hal_irda.c | 2 +- .../Src/stm32f2xx_hal_smartcard.c | 2 +- .../Src/stm32f2xx_hal_uart.c | 15 +- .../Src/stm32f2xx_hal_usart.c | 2 +- .../Src/stm32f2xx_ll_adc.c | 2 + .../Src/stm32f2xx_ll_gpio.c | 22 +- 24 files changed, 2577 insertions(+), 208 deletions(-) create mode 100644 bsp/stm32/libraries/STM32F2xx_HAL/CMSIS/Device/ST/STM32F2xx/Release_Notes.html create mode 100644 bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Release_Notes.html diff --git a/bsp/stm32/libraries/STM32F2xx_HAL/CMSIS/Device/ST/STM32F2xx/Include/stm32f2xx.h b/bsp/stm32/libraries/STM32F2xx_HAL/CMSIS/Device/ST/STM32F2xx/Include/stm32f2xx.h index 377491e9aa..b56e1e1550 100644 --- a/bsp/stm32/libraries/STM32F2xx_HAL/CMSIS/Device/ST/STM32F2xx/Include/stm32f2xx.h +++ b/bsp/stm32/libraries/STM32F2xx_HAL/CMSIS/Device/ST/STM32F2xx/Include/stm32f2xx.h @@ -81,11 +81,11 @@ #endif /* USE_HAL_DRIVER */ /** - * @brief CMSIS Device version number V2.2.2 + * @brief CMSIS Device version number V2.2.3 */ #define __STM32F2xx_CMSIS_VERSION_MAIN (0x02U) /*!< [31:24] main version */ #define __STM32F2xx_CMSIS_VERSION_SUB1 (0x02U) /*!< [23:16] sub1 version */ -#define __STM32F2xx_CMSIS_VERSION_SUB2 (0x02U) /*!< [15:8] sub2 version */ +#define __STM32F2xx_CMSIS_VERSION_SUB2 (0x03U) /*!< [15:8] sub2 version */ #define __STM32F2xx_CMSIS_VERSION_RC (0x00U) /*!< [7:0] release candidate */ #define __STM32F2xx_CMSIS_VERSION ((__STM32F2xx_CMSIS_VERSION_MAIN << 24)\ |(__STM32F2xx_CMSIS_VERSION_SUB1 << 16)\ diff --git a/bsp/stm32/libraries/STM32F2xx_HAL/CMSIS/Device/ST/STM32F2xx/Release_Notes.html b/bsp/stm32/libraries/STM32F2xx_HAL/CMSIS/Device/ST/STM32F2xx/Release_Notes.html new file mode 100644 index 0000000000..fa329d2dae --- /dev/null +++ b/bsp/stm32/libraries/STM32F2xx_HAL/CMSIS/Device/ST/STM32F2xx/Release_Notes.html @@ -0,0 +1,202 @@ + + + + + + + + + + +Release Notes for STM32F2xx CMSIS + + + + + +
+


+

+
+ + + + + + +
+ + + + + + + + + +
Back to Release page
+

Release +Notes for STM32F2xx CMSIS

+

Copyright 2017 STMicroelectronics

+

+
+

 

+ + + + + + +
+ +

Update History

+

V2.2.3 / 31-December-2019

+ Main Changes
+
  • Update Release_Notes.html to refer to"_htmresc/st_logo.png" instead of "../../../../../_htmresc/st_logo.png"

V2.2.2 / 26-June-2019

+ Main Changes
+
    +
  • General updates to fix known defects and enhancements implementation for MISRA 2012 compliancy.
  • +
      +
    • Update to use "UL" postfix for bits mask definitions(_Msk) and memory/peripheral base addresses
    • +
    + +
      +
    • HAL_IS_BIT_SET()/HAL_IS_BIT_CLR() macros implementation update
    • Devices headers clean up:
      • Remove double casting uint32_t and U
      • Remove extra parenthesis instead of U
      + +
  • stm32f2xx.h
    • Align ErrorStatus typedef to common error handling
  • GPIO:
  • +
      +
    • Add new IS_GPIO_AF_INSTANCE() macro
    • +
  • HASH
    • Rename HASH_RNG_IRQn to  RNG_IRQn for STM32F205xx and STM32F207xx devices as HASH isn't supported
    +
  • CRYP:
  • + +
      +
    • Rename CRYP data input register name to be aligned with reference manual 
      • Rename DIN field to DR in the CRYP_TypeDef structure
      +
  • USB:
  • +
      +
    • Add missing Bits Definitions in USB_OTG_DOEPMSK register
    • +
    +
      +
      • USB_OTG_DOEPMSK_AHBERRM
      • USB_OTG_DOEPMSK_OTEPSPRM
      • USB_OTG_DOEPMSK_BERRM
      • USB_OTG_DOEPMSK_NAKM
      • USB_OTG_DOEPMSK_NYETM
      +
    +
      +
    • Add missing Bits Definitions in USB_OTG_DIEPINT register
    • +
    +
      +
      • USB_OTG_DIEPINT_INEPNM
      • USB_OTG_DIEPINT_AHBERR
      • USB_OTG_DOEPINT_OUTPKTERR
      •  USB_OTG_DOEPINT_NAK
      • USB_OTG_DOEPINT_STPKTRX
    • Add missing Bits Definitions in USB_OTG_DCFG register
      • USB_OTG_DCFG_XCVRDLY
      • USB_OTG_DCFG_ERRATIM
      +
    +
  • TIM:
  • +
      +
    • Add requires TIM assert macros:
      • IS_TIM_SYNCHRO_INSTANCE()
      • IS_TIM_CLOCKSOURCE_TIX_INSTANCE()
      • +
      • IS_TIM_CLOCKSOURCE_ITRX_INSTANCE()
      • +
      +
    +
+

V2.2.1 / 29-September-2017

+Main Changes
  • Header file for all STM32 devices
    • Add missing HardFault_IRQn in IRQn_Type enumeration
  • "stm32f215xx.h", "stm32f217xx.h"
    • Remove HASH_DIGEST instance
  • Remove Date and Version from header files

V2.2.0 / 17-March-2017

Main Changes
  • Use _Pos and _Mask macros for all Bit Definitions
  • General updates in header files to support LL drivers
    • Align Bit naming for RCC_CSR register (ex: RCC_CSR_PADRSTF --> RCC_CSR_PINRSTF)
    • Align Bit naming for RTC_CR and RTC_TAFCR registers (ex: RTC_CR_BCK --> RTC_CR_BKP)
    • Rename IS_UART_INSTANCE() macro to IS_UART_HALFDUPLEX_INSTANCE()
    • Add new defines to check LIN instance: IS_UART_LIN_INSTANCE
    • Add FLASH_OTP_BASE and  FLASH_OTP_END defnes to manage FLASH OPT area
    • Add Device electronic signature defines: UID_BASE and FLASHSIZE_BASE defines
    • Add bit definitions for ETH_MACDBGR register
    • Add new define ADC123_COMMON_BASE to replace ADC_BASE define
    • Add new define ADC123_COMMON to replace ADC define
    • Add new ADC macros: IS_ADC_COMMON_INSTANCE() and IS_ADC_MULTIMODE_MASTER_INSTANCE()
    • Add new ADC aliases ADC_CDR_RDATA_MST and ADC_CDR_RDATA_SLV for compatibilities with all STM32 Families
    • Update TIM CNT and ARR register mask on 32-bits
    • Add new TIM_OR_TI1_RMP define in TIM_OR register
    • Add new TIM macros to check TIM feature instance support:
      • IS_TIM_COUNTER_MODE_SELECT_INSTANCE()
      • IS_TIM_CLOCK_DIVISION_INSTANCE()
      • IS_TIM_COMMUTATION_EVENT_INSTANCE()
      • IS_TIM_OCXREF_CLEAR_INSTANCE()
      • IS_TIM_CLOCKSOURCE_ETRMODE1_INSTANCE()
      • IS_TIM_CLOCKSOURCE_ETRMODE2_INSTANCE()
      • IS_TIM_REPETITION_COUNTER_INSTANCE()
      • IS_TIM_ENCODER_INTERFACE_INSTANCE()
      • IS_TIM_HALL_SENSOR_INTERFACE_INSTANCE()
      • IS_TIM_BREAK_INSTANCE()
    • USB_OTG register: fix the wrong defined values for USB_OTG_GAHBCFG bits

V2.1.2 / 29-June-2016

Main Changes
  • Header file for all STM32 devices
    • Remove uint32_t cast and keep only Misra Cast (U) to avoid two types cast duplication
    • Correct some bits definition to be in line with naming used in the Reference Manual
      • WWDG_CR_Tx changed to WWDG_CR_T_x
      • WWDG_CFR_Wx changed to WWDG_CFR_W_x
      • WWDG_CFR_WDGTBx changed to WWDG_CFR_WDGTB_x
    • I2C FLTR feature is not supported on F2 family, FLTR bits are removed.
    • Add missing defines for GPIO_AFRL & GPIO_AFRH registers
    • Remove the double definition of USB_OTG_HS_MAX_IN_ENDPOINTS and add a new one for  USB_OTG_HS_MAX_OUT_ENDPOINTS
    • Update CMSIS driver to be compliante with MISRA C 2004 rule 10.6
  • stm32f207xx.h and stm32f217xx.h files
    • Correct some bits definition to be in line with naming used in the Reference Manual
      • DCMI_RISR_x changed to DCMI_RIS_x
      • DCMI_RISR_OVF_RIS changed to DCMI_RIS_OVR_RIS
      • DCMI_IER_OVF_IE changed to DCMI_IER_OVR_IE
      • DCMI_ICR_OVF_ISC changed to DCMI_ICR_OVR_ISC
      • DCMI_MISR changed to DCMI_MIS
    • Add missing bit definitions for DCMI_ESCR, DCMI_ESUR, DCMI_CWSTRT, DCMI_CWSIZE, DCMI_DR registers
  • stm32f2xx.h
    • Rename __STM32F2xx_CMSIS_DEVICE_VERSION_xx defines to __STM32F2_CMSIS_VERSION_xx (MISRA-C 2004 rule 5.1)

V2.1.1 / 20-November-2015

Main Changes
  • stm32f205xx.h, stm32f207xx.h, stm32f215xx.h, stm32f217xx.h files
    • Remove FSMC_BWTRx_CLKDIV and FSMC_BWTRx_DATLAT bits definitions

V2.1.0 / 09-October-2015

Main Changes
  • stm32f2xx.h
    • Add new constant definition STM32F2
  • Header file for all STM32F2 devices
    • GPIO_TypeDef: change the BSRR register + definition, the two 16-bits definition BSRRH and BSRRL are merged in a + single 32-bits definition BSRR
    • Add missing defines for GPIO LCKR Register
    • Add defines for FLASH memory +base and end addresses 
    • Update SRAM2 and BKPSRAM Bit-Banding base address defined values
  • Update startup files for EWARM toolchain to cope with compiler enhancement of the V7.xx version
  • "stm32f215xx.h", "stm32f217xx.h"
    • HASH alignment with bits naming used in documentation
        • Rename HASH_IMR_DINIM to HASH_IMR_DINIE
        • Rename HASH_IMR_DCIM to HASH_IMR_DCIE
        • Rename HASH_STR_NBW to HASH_STR_NBW
  • system_stm32f2xx.c + +
    • Remove dependency vs. the HAL, to allow using this file without the need to have the HAL drivers
      +
      • Include stm32f2xx.h instead of stm32f2xx_hal.h
      • Add +definition of HSE_VALUE and HSI_VALUE, if they are not yet defined in +the compilation scope (these values are defined in stm32f2xx_hal_conf).
    • Remove __IO on constant table declaration
    • Implement workaround to cover RCC limitation regarding peripheral enable delay
    • SystemInit_ExtMemCtl() update GPIO configuration when external SRAM is used 

V2.0.0 / 07-March-2014

Main Changes

  • Update based on STM32Cube specification
  • This version and later has to be used only with STM32CubeF2 based development

V1.1.3 / 05-March-2012

Main Changes

  • All source files: license disclaimer text update and add link to the License file on ST Internet.

V1.1.2 / 28-December-2011

Main Changes

  • All source files: update disclaimer to add reference to the new license agreement
  • stm32f2xx.h
    • Correct bit definition: RCC_AHB2RSTR_HSAHRST changed to RCC_AHB2RSTR_HASHRST

V1.1.1 / 14-November-2011

Main Changes

  • stm32f2xx.h
    • Add missing bits definition for DAC CR register
    • Add missing bits definition for FSMC BTR1, BTR2, BTR3, BWTR1, BWTR2, BWTR3 and BWTR4 registers
  • Add startup file for TASKING toolchain

V1.1.0 / 23-September-2011

Main Changes

  • stm32f2xx.h
    • Add define for Cortex-M3 revision __CM3_REV
    • Allow +modification of some constants by the application code, definition +of these constants is now bracketed by         +     #if !defined. The concerned constant are HSE_VALUE, HSI_VALUE and HSE_STARTUP_TIMEOUT.
    • Fix include of stm32f2xx_conf.h file, change "stm32f2xx_conf.h " by "stm32f2xx_conf.h"
    • Correct MII_RMII_SEL bit (in SYSCFG_PMC register) value to 0x00800000
    • Correct RCC_CFGR_PPRE2_DIV16 bit (in RCC_CFGR register) value to 0x0000E000
    • Correct some bits definition to be in line with naming used in the Reference Manual (RM0033)
      • GPIO_OTYPER_IDR_x changed to GPIO_IDR_IDR_x
      • GPIO_OTYPER_ODR_x changed to GPIO_ODR_ODR_x
      • SYSCFG_PMC_MII_RMII changed to SYSCFG_PMC_MII_RMII_SEL
      • RCC_APB2RSTR_SPI1 changed to RCC_APB2RSTR_SPI1RST
      • DBGMCU_APB1_FZ_DBG_IWDEG_STOP changed to DBGMCU_APB1_FZ_DBG_IWDG_STOP
    • GPIO_TypeDef structure: in the comment change AFR[2] address mapping to 0x20-0x24 instead of 0x24-0x28

V1.0.0 / 18-April-2011

Main Changes

  • First official release for STM32F2xx devices
+ +
    +
+

License

+ + +
Redistribution and use in source and +binary forms, with or without modification, are permitted provided that the +following conditions are met:
+
  1. Redistributions of source code must +retain the above copyright notice, this list of conditions and the following +disclaimer. +
  2. Redistributions in binary form must +reproduce the above copyright notice, this list of conditions and the following +disclaimer in the +documentation and/or other materials provided with the distribution. +
  3. Neither the +name of STMicroelectronics nor the names of its contributors may be used to +endorse or promote products derived
from this +software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE +COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT +OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR +TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF +THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE.

+
+
+

For +complete documentation on STM32 Microcontrollers +visit www.st.com/STM32

+
+

+
+
+

 

+
+ \ No newline at end of file diff --git a/bsp/stm32/libraries/STM32F2xx_HAL/CMSIS/Device/ST/STM32F2xx/Source/Templates/gcc/startup_stm32f205xx.s b/bsp/stm32/libraries/STM32F2xx_HAL/CMSIS/Device/ST/STM32F2xx/Source/Templates/gcc/startup_stm32f205xx.s index 28fbafffb4..6468b22bdd 100644 --- a/bsp/stm32/libraries/STM32F2xx_HAL/CMSIS/Device/ST/STM32F2xx/Source/Templates/gcc/startup_stm32f205xx.s +++ b/bsp/stm32/libraries/STM32F2xx_HAL/CMSIS/Device/ST/STM32F2xx/Source/Templates/gcc/startup_stm32f205xx.s @@ -91,10 +91,10 @@ LoopFillZerobss: /* Call the clock system initialization function.*/ bl SystemInit /* Call static constructors */ -/* bl __libc_init_array */ + bl __libc_init_array /* Call the application's entry point.*/ bl entry - bx lr + bx lr .size Reset_Handler, .-Reset_Handler /** diff --git a/bsp/stm32/libraries/STM32F2xx_HAL/CMSIS/Device/ST/STM32F2xx/Source/Templates/gcc/startup_stm32f207xx.s b/bsp/stm32/libraries/STM32F2xx_HAL/CMSIS/Device/ST/STM32F2xx/Source/Templates/gcc/startup_stm32f207xx.s index 0a28ba68fd..c8cf71d7fd 100644 --- a/bsp/stm32/libraries/STM32F2xx_HAL/CMSIS/Device/ST/STM32F2xx/Source/Templates/gcc/startup_stm32f207xx.s +++ b/bsp/stm32/libraries/STM32F2xx_HAL/CMSIS/Device/ST/STM32F2xx/Source/Templates/gcc/startup_stm32f207xx.s @@ -91,7 +91,7 @@ LoopFillZerobss: /* Call the clock system initialization function.*/ bl SystemInit /* Call static constructors */ -/* bl __libc_init_array */ + bl __libc_init_array /* Call the application's entry point.*/ bl entry bx lr diff --git a/bsp/stm32/libraries/STM32F2xx_HAL/CMSIS/Device/ST/STM32F2xx/Source/Templates/gcc/startup_stm32f215xx.s b/bsp/stm32/libraries/STM32F2xx_HAL/CMSIS/Device/ST/STM32F2xx/Source/Templates/gcc/startup_stm32f215xx.s index 052075862e..50ecdada65 100644 --- a/bsp/stm32/libraries/STM32F2xx_HAL/CMSIS/Device/ST/STM32F2xx/Source/Templates/gcc/startup_stm32f215xx.s +++ b/bsp/stm32/libraries/STM32F2xx_HAL/CMSIS/Device/ST/STM32F2xx/Source/Templates/gcc/startup_stm32f215xx.s @@ -91,10 +91,10 @@ LoopFillZerobss: /* Call the clock system initialization function.*/ bl SystemInit /* Call static constructors */ -/* bl __libc_init_array */ + bl __libc_init_array /* Call the application's entry point.*/ bl entry - bx lr + bx lr .size Reset_Handler, .-Reset_Handler /** diff --git a/bsp/stm32/libraries/STM32F2xx_HAL/CMSIS/Device/ST/STM32F2xx/Source/Templates/gcc/startup_stm32f217xx.s b/bsp/stm32/libraries/STM32F2xx_HAL/CMSIS/Device/ST/STM32F2xx/Source/Templates/gcc/startup_stm32f217xx.s index 3c7d8647b2..5f5d05c8c4 100644 --- a/bsp/stm32/libraries/STM32F2xx_HAL/CMSIS/Device/ST/STM32F2xx/Source/Templates/gcc/startup_stm32f217xx.s +++ b/bsp/stm32/libraries/STM32F2xx_HAL/CMSIS/Device/ST/STM32F2xx/Source/Templates/gcc/startup_stm32f217xx.s @@ -91,10 +91,10 @@ LoopFillZerobss: /* Call the clock system initialization function.*/ bl SystemInit /* Call static constructors */ -/* bl __libc_init_array */ + bl __libc_init_array /* Call the application's entry point.*/ bl entry - bx lr + bx lr .size Reset_Handler, .-Reset_Handler /** diff --git a/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h b/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h index 52c9d6c5ed..90767ed33b 100644 --- a/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h +++ b/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h @@ -236,12 +236,12 @@ #define DAC_WAVEGENERATION_NOISE DAC_WAVE_NOISE #define DAC_WAVEGENERATION_TRIANGLE DAC_WAVE_TRIANGLE -#if defined(STM32G4) -#define DAC_CHIPCONNECT_DISABLE (DAC_CHIPCONNECT_EXTERNAL | DAC_CHIPCONNECT_BOTH) -#define DAC_CHIPCONNECT_ENABLE (DAC_CHIPCONNECT_INTERNAL | DAC_CHIPCONNECT_BOTH) +#if defined(STM32G4) || defined(STM32H7) +#define DAC_CHIPCONNECT_DISABLE DAC_CHIPCONNECT_EXTERNAL +#define DAC_CHIPCONNECT_ENABLE DAC_CHIPCONNECT_INTERNAL #endif -#if defined(STM32L1) || defined(STM32L4) || defined(STM32G0) +#if defined(STM32L1) || defined(STM32L4) || defined(STM32G0) || defined(STM32L5) || defined(STM32H7) || defined(STM32F4) #define HAL_DAC_MSP_INIT_CB_ID HAL_DAC_MSPINIT_CB_ID #define HAL_DAC_MSP_DEINIT_CB_ID HAL_DAC_MSPDEINIT_CB_ID #endif @@ -306,8 +306,17 @@ #define HAL_DMAMUX_REQUEST_GEN_FALLING HAL_DMAMUX_REQ_GEN_FALLING #define HAL_DMAMUX_REQUEST_GEN_RISING_FALLING HAL_DMAMUX_REQ_GEN_RISING_FALLING +#if defined(STM32L4R5xx) || defined(STM32L4R9xx) || defined(STM32L4R9xx) || defined(STM32L4S5xx) || defined(STM32L4S7xx) || defined(STM32L4S9xx) +#define DMA_REQUEST_DCMI_PSSI DMA_REQUEST_DCMI +#endif + #endif /* STM32L4 */ +#if defined(STM32G0) +#define DMA_REQUEST_DAC1_CHANNEL1 DMA_REQUEST_DAC1_CH1 +#define DMA_REQUEST_DAC1_CHANNEL2 DMA_REQUEST_DAC1_CH2 +#endif + #if defined(STM32H7) #define DMA_REQUEST_DAC1 DMA_REQUEST_DAC1_CH1 @@ -365,6 +374,9 @@ #define DFSDM_FILTER_EXT_TRIG_LPTIM2 DFSDM_FILTER_EXT_TRIG_LPTIM2_OUT #define DFSDM_FILTER_EXT_TRIG_LPTIM3 DFSDM_FILTER_EXT_TRIG_LPTIM3_OUT +#define DAC_TRIGGER_LP1_OUT DAC_TRIGGER_LPTIM1_OUT +#define DAC_TRIGGER_LP2_OUT DAC_TRIGGER_LPTIM2_OUT + #endif /* STM32H7 */ /** @@ -460,7 +472,9 @@ #define FLASH_FLAG_SNECCE_BANK2RR FLASH_FLAG_SNECCERR_BANK2 #define FLASH_FLAG_DBECCE_BANK2RR FLASH_FLAG_DBECCERR_BANK2 #define FLASH_FLAG_STRBER_BANK2R FLASH_FLAG_STRBERR_BANK2 -#endif +#define FLASH_FLAG_WDW FLASH_FLAG_WBNE +#define OB_WRP_SECTOR_All OB_WRP_SECTOR_ALL +#endif /* STM32H7 */ /** * @} @@ -564,7 +578,14 @@ #define GPIO_AF9_SDIO2 GPIO_AF9_SDMMC2 #define GPIO_AF10_SDIO2 GPIO_AF10_SDMMC2 #define GPIO_AF11_SDIO2 GPIO_AF11_SDMMC2 -#endif + +#if defined (STM32H743xx) || defined (STM32H753xx) || defined (STM32H750xx) || defined (STM32H742xx) || \ + defined (STM32H745xx) || defined (STM32H755xx) || defined (STM32H747xx) || defined (STM32H757xx) +#define GPIO_AF10_OTG2_HS GPIO_AF10_OTG2_FS +#define GPIO_AF10_OTG1_FS GPIO_AF10_OTG1_HS +#define GPIO_AF12_OTG2_FS GPIO_AF12_OTG1_FS +#endif /*STM32H743xx || STM32H753xx || STM32H750xx || STM32H742xx || STM32H745xx || STM32H755xx || STM32H747xx || STM32H757xx */ +#endif /* STM32H7 */ #define GPIO_AF0_LPTIM GPIO_AF0_LPTIM1 #define GPIO_AF1_LPTIM GPIO_AF1_LPTIM1 @@ -735,6 +756,66 @@ #define HRTIM_OUTPUTRESET_TIMFEV8_TIMECMP2 HRTIM_OUTPUTSET_TIMEV_8 #define HRTIM_OUTPUTRESET_TIMFEV9_TIMECMP3 HRTIM_OUTPUTSET_TIMEV_9 #endif /* STM32H7 */ + +#if defined(STM32F3) +/** @brief Constants defining available sources associated to external events. + */ +#define HRTIM_EVENTSRC_1 (0x00000000U) +#define HRTIM_EVENTSRC_2 (HRTIM_EECR1_EE1SRC_0) +#define HRTIM_EVENTSRC_3 (HRTIM_EECR1_EE1SRC_1) +#define HRTIM_EVENTSRC_4 (HRTIM_EECR1_EE1SRC_1 | HRTIM_EECR1_EE1SRC_0) + +/** @brief Constants defining the events that can be selected to configure the + * set/reset crossbar of a timer output + */ +#define HRTIM_OUTPUTSET_TIMEV_1 (HRTIM_SET1R_TIMEVNT1) +#define HRTIM_OUTPUTSET_TIMEV_2 (HRTIM_SET1R_TIMEVNT2) +#define HRTIM_OUTPUTSET_TIMEV_3 (HRTIM_SET1R_TIMEVNT3) +#define HRTIM_OUTPUTSET_TIMEV_4 (HRTIM_SET1R_TIMEVNT4) +#define HRTIM_OUTPUTSET_TIMEV_5 (HRTIM_SET1R_TIMEVNT5) +#define HRTIM_OUTPUTSET_TIMEV_6 (HRTIM_SET1R_TIMEVNT6) +#define HRTIM_OUTPUTSET_TIMEV_7 (HRTIM_SET1R_TIMEVNT7) +#define HRTIM_OUTPUTSET_TIMEV_8 (HRTIM_SET1R_TIMEVNT8) +#define HRTIM_OUTPUTSET_TIMEV_9 (HRTIM_SET1R_TIMEVNT9) + +#define HRTIM_OUTPUTRESET_TIMEV_1 (HRTIM_RST1R_TIMEVNT1) +#define HRTIM_OUTPUTRESET_TIMEV_2 (HRTIM_RST1R_TIMEVNT2) +#define HRTIM_OUTPUTRESET_TIMEV_3 (HRTIM_RST1R_TIMEVNT3) +#define HRTIM_OUTPUTRESET_TIMEV_4 (HRTIM_RST1R_TIMEVNT4) +#define HRTIM_OUTPUTRESET_TIMEV_5 (HRTIM_RST1R_TIMEVNT5) +#define HRTIM_OUTPUTRESET_TIMEV_6 (HRTIM_RST1R_TIMEVNT6) +#define HRTIM_OUTPUTRESET_TIMEV_7 (HRTIM_RST1R_TIMEVNT7) +#define HRTIM_OUTPUTRESET_TIMEV_8 (HRTIM_RST1R_TIMEVNT8) +#define HRTIM_OUTPUTRESET_TIMEV_9 (HRTIM_RST1R_TIMEVNT9) + +/** @brief Constants defining the event filtering applied to external events + * by a timer + */ +#define HRTIM_TIMEVENTFILTER_NONE (0x00000000U) +#define HRTIM_TIMEVENTFILTER_BLANKINGCMP1 (HRTIM_EEFR1_EE1FLTR_0) +#define HRTIM_TIMEVENTFILTER_BLANKINGCMP2 (HRTIM_EEFR1_EE1FLTR_1) +#define HRTIM_TIMEVENTFILTER_BLANKINGCMP3 (HRTIM_EEFR1_EE1FLTR_1 | HRTIM_EEFR1_EE1FLTR_0) +#define HRTIM_TIMEVENTFILTER_BLANKINGCMP4 (HRTIM_EEFR1_EE1FLTR_2) +#define HRTIM_TIMEVENTFILTER_BLANKINGFLTR1 (HRTIM_EEFR1_EE1FLTR_2 | HRTIM_EEFR1_EE1FLTR_0) +#define HRTIM_TIMEVENTFILTER_BLANKINGFLTR2 (HRTIM_EEFR1_EE1FLTR_2 | HRTIM_EEFR1_EE1FLTR_1) +#define HRTIM_TIMEVENTFILTER_BLANKINGFLTR3 (HRTIM_EEFR1_EE1FLTR_2 | HRTIM_EEFR1_EE1FLTR_1 | HRTIM_EEFR1_EE1FLTR_0) +#define HRTIM_TIMEVENTFILTER_BLANKINGFLTR4 (HRTIM_EEFR1_EE1FLTR_3) +#define HRTIM_TIMEVENTFILTER_BLANKINGFLTR5 (HRTIM_EEFR1_EE1FLTR_3 | HRTIM_EEFR1_EE1FLTR_0) +#define HRTIM_TIMEVENTFILTER_BLANKINGFLTR6 (HRTIM_EEFR1_EE1FLTR_3 | HRTIM_EEFR1_EE1FLTR_1) +#define HRTIM_TIMEVENTFILTER_BLANKINGFLTR7 (HRTIM_EEFR1_EE1FLTR_3 | HRTIM_EEFR1_EE1FLTR_1 | HRTIM_EEFR1_EE1FLTR_0) +#define HRTIM_TIMEVENTFILTER_BLANKINGFLTR8 (HRTIM_EEFR1_EE1FLTR_3 | HRTIM_EEFR1_EE1FLTR_2) +#define HRTIM_TIMEVENTFILTER_WINDOWINGCMP2 (HRTIM_EEFR1_EE1FLTR_3 | HRTIM_EEFR1_EE1FLTR_2 | HRTIM_EEFR1_EE1FLTR_0) +#define HRTIM_TIMEVENTFILTER_WINDOWINGCMP3 (HRTIM_EEFR1_EE1FLTR_3 | HRTIM_EEFR1_EE1FLTR_2 | HRTIM_EEFR1_EE1FLTR_1) +#define HRTIM_TIMEVENTFILTER_WINDOWINGTIM (HRTIM_EEFR1_EE1FLTR_3 | HRTIM_EEFR1_EE1FLTR_2 | HRTIM_EEFR1_EE1FLTR_1 | HRTIM_EEFR1_EE1FLTR_0) + +/** @brief Constants defining the DLL calibration periods (in micro seconds) + */ +#define HRTIM_CALIBRATIONRATE_7300 0x00000000U +#define HRTIM_CALIBRATIONRATE_910 (HRTIM_DLLCR_CALRTE_0) +#define HRTIM_CALIBRATIONRATE_114 (HRTIM_DLLCR_CALRTE_1) +#define HRTIM_CALIBRATIONRATE_14 (HRTIM_DLLCR_CALRTE_1 | HRTIM_DLLCR_CALRTE_0) + +#endif /* STM32F3 */ /** * @} */ @@ -874,7 +955,7 @@ #define OPAMP_PGACONNECT_VM0 OPAMP_PGA_CONNECT_INVERTINGINPUT_IO0 #define OPAMP_PGACONNECT_VM1 OPAMP_PGA_CONNECT_INVERTINGINPUT_IO1 -#if defined(STM32L1) || defined(STM32L4) +#if defined(STM32L1) || defined(STM32L4) || defined(STM32L5) || defined(STM32H7) #define HAL_OPAMP_MSP_INIT_CB_ID HAL_OPAMP_MSPINIT_CB_ID #define HAL_OPAMP_MSP_DEINIT_CB_ID HAL_OPAMP_MSPDEINIT_CB_ID #endif @@ -965,6 +1046,16 @@ #define RTC_TAMPERPIN_PA0 RTC_TAMPERPIN_POS1 #define RTC_TAMPERPIN_PI8 RTC_TAMPERPIN_POS1 +#if defined(STM32H7) +#define RTC_TAMPCR_TAMPXE RTC_TAMPER_X +#define RTC_TAMPCR_TAMPXIE RTC_TAMPER_X_INTERRUPT + +#define RTC_TAMPER1_INTERRUPT RTC_IT_TAMP1 +#define RTC_TAMPER2_INTERRUPT RTC_IT_TAMP2 +#define RTC_TAMPER3_INTERRUPT RTC_IT_TAMP3 +#define RTC_ALL_TAMPER_INTERRUPT RTC_IT_TAMPALL +#endif /* STM32H7 */ + /** * @} */ @@ -1358,6 +1449,30 @@ #define HASH_HMACKeyType_ShortKey HASH_HMAC_KEYTYPE_SHORTKEY #define HASH_HMACKeyType_LongKey HASH_HMAC_KEYTYPE_LONGKEY + +#if defined(STM32L4) || defined(STM32F4) || defined(STM32F7) || defined(STM32H7) + +#define HAL_HASH_MD5_Accumulate HAL_HASH_MD5_Accmlt +#define HAL_HASH_MD5_Accumulate_End HAL_HASH_MD5_Accmlt_End +#define HAL_HASH_MD5_Accumulate_IT HAL_HASH_MD5_Accmlt_IT +#define HAL_HASH_MD5_Accumulate_End_IT HAL_HASH_MD5_Accmlt_End_IT + +#define HAL_HASH_SHA1_Accumulate HAL_HASH_SHA1_Accmlt +#define HAL_HASH_SHA1_Accumulate_End HAL_HASH_SHA1_Accmlt_End +#define HAL_HASH_SHA1_Accumulate_IT HAL_HASH_SHA1_Accmlt_IT +#define HAL_HASH_SHA1_Accumulate_End_IT HAL_HASH_SHA1_Accmlt_End_IT + +#define HAL_HASHEx_SHA224_Accumulate HAL_HASHEx_SHA224_Accmlt +#define HAL_HASHEx_SHA224_Accumulate_End HAL_HASHEx_SHA224_Accmlt_End +#define HAL_HASHEx_SHA224_Accumulate_IT HAL_HASHEx_SHA224_Accmlt_IT +#define HAL_HASHEx_SHA224_Accumulate_End_IT HAL_HASHEx_SHA224_Accmlt_End_IT + +#define HAL_HASHEx_SHA256_Accumulate HAL_HASHEx_SHA256_Accmlt +#define HAL_HASHEx_SHA256_Accumulate_End HAL_HASHEx_SHA256_Accmlt_End +#define HAL_HASHEx_SHA256_Accumulate_IT HAL_HASHEx_SHA256_Accmlt_IT +#define HAL_HASHEx_SHA256_Accumulate_End_IT HAL_HASHEx_SHA256_Accmlt_End_IT + +#endif /* STM32L4 || STM32F4 || STM32F7 || STM32H7 */ /** * @} */ @@ -1380,6 +1495,13 @@ #endif #define HAL_ADC_EnableBuffer_Cmd(cmd) (((cmd)==ENABLE) ? HAL_ADCEx_EnableVREFINT() : HAL_ADCEx_DisableVREFINT()) #define HAL_ADC_EnableBufferSensor_Cmd(cmd) (((cmd)==ENABLE) ? HAL_ADCEx_EnableVREFINTTempSensor() : HAL_ADCEx_DisableVREFINTTempSensor()) +#if defined(STM32H7A3xx) || defined(STM32H7B3xx) || defined(STM32H7B0xx) || defined(STM32H7A3xxQ) || defined(STM32H7B3xxQ) || defined(STM32H7B0xxQ) +#define HAL_EnableSRDomainDBGStopMode HAL_EnableDomain3DBGStopMode +#define HAL_DisableSRDomainDBGStopMode HAL_DisableDomain3DBGStopMode +#define HAL_EnableSRDomainDBGStandbyMode HAL_EnableDomain3DBGStandbyMode +#define HAL_DisableSRDomainDBGStandbyMode HAL_DisableDomain3DBGStandbyMode +#endif /* STM32H7A3xx || STM32H7B3xx || STM32H7B0xx || STM32H7A3xxQ || STM32H7B3xxQ || STM32H7B0xxQ */ + /** * @} */ @@ -1409,16 +1531,18 @@ #define HAL_I2CFastModePlusConfig(SYSCFG_I2CFastModePlus, cmd) (((cmd)==ENABLE)? HAL_I2CEx_EnableFastModePlus(SYSCFG_I2CFastModePlus): HAL_I2CEx_DisableFastModePlus(SYSCFG_I2CFastModePlus)) -#if defined(STM32H7) || defined(STM32WB) || defined(STM32G0) || defined(STM32F4) || defined(STM32F7) || defined(STM32L0) || defined(STM32L4) || defined(STM32G4) +#if defined(STM32H7) || defined(STM32WB) || defined(STM32G0) || defined(STM32F0) || defined(STM32F1) || defined(STM32F2) || defined(STM32F3) || defined(STM32F4) || defined(STM32F7) || defined(STM32L0) || defined(STM32L4) || defined(STM32L5) || defined(STM32G4) #define HAL_I2C_Master_Sequential_Transmit_IT HAL_I2C_Master_Seq_Transmit_IT #define HAL_I2C_Master_Sequential_Receive_IT HAL_I2C_Master_Seq_Receive_IT #define HAL_I2C_Slave_Sequential_Transmit_IT HAL_I2C_Slave_Seq_Transmit_IT #define HAL_I2C_Slave_Sequential_Receive_IT HAL_I2C_Slave_Seq_Receive_IT +#endif /* STM32H7 || STM32WB || STM32G0 || STM32F0 || STM32F1 || STM32F2 || STM32F3 || STM32F4 || STM32F7 || STM32L0 || STM32L4 || STM32L5 || STM32G4 */ +#if defined(STM32H7) || defined(STM32WB) || defined(STM32G0) || defined(STM32F4) || defined(STM32F7) || defined(STM32L0) || defined(STM32L4) || defined(STM32L5) || defined(STM32G4) #define HAL_I2C_Master_Sequential_Transmit_DMA HAL_I2C_Master_Seq_Transmit_DMA #define HAL_I2C_Master_Sequential_Receive_DMA HAL_I2C_Master_Seq_Receive_DMA #define HAL_I2C_Slave_Sequential_Transmit_DMA HAL_I2C_Slave_Seq_Transmit_DMA #define HAL_I2C_Slave_Sequential_Receive_DMA HAL_I2C_Slave_Seq_Receive_DMA -#endif /* STM32H7 || STM32WB || STM32G0 || STM32F4 || STM32F7 || STM32L0 || STM32L4 */ +#endif /* STM32H7 || STM32WB || STM32G0 || STM32F4 || STM32F7 || STM32L0 || STM32L4 || STM32L5 || STM32G4 */ #if defined(STM32F4) #define HAL_FMPI2C_Master_Sequential_Transmit_IT HAL_FMPI2C_Master_Seq_Transmit_IT @@ -1437,6 +1561,13 @@ /** @defgroup HAL_PWR_Aliased HAL PWR Aliased maintained for legacy purpose * @{ */ + +#if defined(STM32G0) +#define HAL_PWR_ConfigPVD HAL_PWREx_ConfigPVD +#define HAL_PWR_EnablePVD HAL_PWREx_EnablePVD +#define HAL_PWR_DisablePVD HAL_PWREx_DisablePVD +#define HAL_PWR_PVD_IRQHandler HAL_PWREx_PVD_IRQHandler +#endif #define HAL_PWR_PVDConfig HAL_PWR_ConfigPVD #define HAL_PWR_DisableBkUpReg HAL_PWREx_DisableBkUpReg #define HAL_PWR_DisableFlashPowerDown HAL_PWREx_DisableFlashPowerDown @@ -1509,14 +1640,14 @@ #define HAL_TIM_DMAError TIM_DMAError #define HAL_TIM_DMACaptureCplt TIM_DMACaptureCplt #define HAL_TIMEx_DMACommutationCplt TIMEx_DMACommutationCplt -#if defined(STM32H7) || defined(STM32G0) || defined(STM32F7) || defined(STM32F4) || defined(STM32L0) || defined(STM32L4) +#if defined(STM32H7) || defined(STM32G0) || defined(STM32F0) || defined(STM32F1) || defined(STM32F2) || defined(STM32F3) || defined(STM32F4) || defined(STM32F7) || defined(STM32L0) || defined(STM32L4) #define HAL_TIM_SlaveConfigSynchronization HAL_TIM_SlaveConfigSynchro #define HAL_TIM_SlaveConfigSynchronization_IT HAL_TIM_SlaveConfigSynchro_IT #define HAL_TIMEx_CommutationCallback HAL_TIMEx_CommutCallback #define HAL_TIMEx_ConfigCommutationEvent HAL_TIMEx_ConfigCommutEvent #define HAL_TIMEx_ConfigCommutationEvent_IT HAL_TIMEx_ConfigCommutEvent_IT #define HAL_TIMEx_ConfigCommutationEvent_DMA HAL_TIMEx_ConfigCommutEvent_DMA -#endif /* STM32H7 || STM32G0 || STM32F7 || STM32F4 || STM32L0 */ +#endif /* STM32H7 || STM32G0 || STM32F0 || STM32F1 || STM32F2 || STM32F3 || STM32F4 || STM32F7 || STM32L0 */ /** * @} */ @@ -3114,7 +3245,7 @@ #if defined(STM32L4) #define RCC_RTCCLKSOURCE_NO_CLK RCC_RTCCLKSOURCE_NONE -#elif defined(STM32WB) || defined(STM32G0) || defined(STM32G4) +#elif defined(STM32WB) || defined(STM32G0) || defined(STM32G4) || defined(STM32L5) #else #define RCC_RTCCLKSOURCE_NONE RCC_RTCCLKSOURCE_NO_CLK #endif @@ -3242,7 +3373,7 @@ /** @defgroup HAL_RTC_Aliased_Macros HAL RTC Aliased Macros maintained for legacy purpose * @{ */ -#if defined (STM32G0) || defined (STM32L412xx) || defined (STM32L422xx) || defined (STM32L4P5xx) || defined (STM32L4Q5xx) || defined (STM32G4) +#if defined (STM32G0) || defined (STM32L5) || defined (STM32L412xx) || defined (STM32L422xx) || defined (STM32L4P5xx) || defined (STM32L4Q5xx) || defined (STM32G4) #else #define __HAL_RTC_CLEAR_FLAG __HAL_RTC_EXTI_CLEAR_FLAG #endif @@ -3365,7 +3496,7 @@ #define HAL_SD_CardStateTypedef HAL_SD_CardStateTypeDef #endif -#if defined(STM32H7) +#if defined(STM32H7) || defined(STM32L5) #define HAL_MMCEx_Read_DMADoubleBuffer0CpltCallback HAL_MMCEx_Read_DMADoubleBuf0CpltCallback #define HAL_MMCEx_Read_DMADoubleBuffer1CpltCallback HAL_MMCEx_Read_DMADoubleBuf1CpltCallback #define HAL_MMCEx_Write_DMADoubleBuffer0CpltCallback HAL_MMCEx_Write_DMADoubleBuf0CpltCallback @@ -3606,12 +3737,12 @@ * @{ */ #if defined (STM32H7) || defined (STM32G4) || defined (STM32F3) -#define HAL_HRTIM_WaveformCounterStart_IT HAL_HRTIM_WaveformCountStart_IT -#define HAL_HRTIM_WaveformCounterStart_DMA HAL_HRTIM_WaveformCountStart_DMA -#define HAL_HRTIM_WaveformCounterStart HAL_HRTIM_WaveformCountStart -#define HAL_HRTIM_WaveformCounterStop_IT HAL_HRTIM_WaveformCountStop_IT -#define HAL_HRTIM_WaveformCounterStop_DMA HAL_HRTIM_WaveformCountStop_DMA -#define HAL_HRTIM_WaveformCounterStop HAL_HRTIM_WaveformCountStop +#define HAL_HRTIM_WaveformCounterStart_IT HAL_HRTIM_WaveformCountStart_IT +#define HAL_HRTIM_WaveformCounterStart_DMA HAL_HRTIM_WaveformCountStart_DMA +#define HAL_HRTIM_WaveformCounterStart HAL_HRTIM_WaveformCountStart +#define HAL_HRTIM_WaveformCounterStop_IT HAL_HRTIM_WaveformCountStop_IT +#define HAL_HRTIM_WaveformCounterStop_DMA HAL_HRTIM_WaveformCountStop_DMA +#define HAL_HRTIM_WaveformCounterStop HAL_HRTIM_WaveformCountStop #endif /** * @} @@ -3620,9 +3751,9 @@ /** @defgroup HAL_QSPI_Aliased_Macros HAL QSPI Aliased Macros maintained for legacy purpose * @{ */ -#if defined (STM32L4) +#if defined (STM32L4) || defined (STM32F4) || defined (STM32F7) #define HAL_QPSI_TIMEOUT_DEFAULT_VALUE HAL_QSPI_TIMEOUT_DEFAULT_VALUE -#endif +#endif /* STM32L4 || STM32F4 || STM32F7 */ /** * @} */ diff --git a/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Inc/stm32f2xx_hal_i2c.h b/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Inc/stm32f2xx_hal_i2c.h index 4aeed36a45..e1f83fb65c 100644 --- a/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Inc/stm32f2xx_hal_i2c.h +++ b/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Inc/stm32f2xx_hal_i2c.h @@ -170,6 +170,7 @@ typedef enum #define HAL_I2C_ERROR_TIMEOUT 0x00000020U /*!< Timeout Error */ #define HAL_I2C_ERROR_SIZE 0x00000040U /*!< Size Management error */ #define HAL_I2C_ERROR_DMA_PARAM 0x00000080U /*!< DMA Parameter Error */ +#define HAL_I2C_WRONG_START 0x00000200U /*!< Wrong start Error */ #if (USE_HAL_I2C_REGISTER_CALLBACKS == 1) #define HAL_I2C_ERROR_INVALID_CALLBACK 0x00000100U /*!< Invalid Callback error */ #endif /* USE_HAL_I2C_REGISTER_CALLBACKS */ diff --git a/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Inc/stm32f2xx_hal_irda.h b/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Inc/stm32f2xx_hal_irda.h index 0737aad25f..4529d2488d 100644 --- a/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Inc/stm32f2xx_hal_irda.h +++ b/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Inc/stm32f2xx_hal_irda.h @@ -646,7 +646,7 @@ uint32_t HAL_IRDA_GetError(IRDA_HandleTypeDef *hirda); #define IRDA_DIVMANT(_PCLK_, _BAUD_) (IRDA_DIV((_PCLK_), (_BAUD_))/100U) -#define IRDA_DIVFRAQ(_PCLK_, _BAUD_) (((IRDA_DIV((_PCLK_), (_BAUD_)) - (IRDA_DIVMANT((_PCLK_), (_BAUD_)) * 100U)) * 16U + 50U) / 100U) +#define IRDA_DIVFRAQ(_PCLK_, _BAUD_) ((((IRDA_DIV((_PCLK_), (_BAUD_)) - (IRDA_DIVMANT((_PCLK_), (_BAUD_)) * 100U)) * 16U) + 50U) / 100U) /* UART BRR = mantissa + overflow + fraction = (UART DIVMANT << 4) + (UART DIVFRAQ & 0xF0) + (UART DIVFRAQ & 0x0FU) */ diff --git a/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Inc/stm32f2xx_hal_smartcard.h b/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Inc/stm32f2xx_hal_smartcard.h index f2cdfb84bf..25cd0abe6e 100644 --- a/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Inc/stm32f2xx_hal_smartcard.h +++ b/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Inc/stm32f2xx_hal_smartcard.h @@ -720,7 +720,7 @@ uint32_t HAL_SMARTCARD_GetError(SMARTCARD_HandleTypeDef *hsc); #define SMARTCARD_DIV(__PCLK__, __BAUD__) (((__PCLK__)*25U)/(4U*(__BAUD__))) #define SMARTCARD_DIVMANT(__PCLK__, __BAUD__) (SMARTCARD_DIV((__PCLK__), (__BAUD__))/100U) -#define SMARTCARD_DIVFRAQ(__PCLK__, __BAUD__) (((SMARTCARD_DIV((__PCLK__), (__BAUD__)) - (SMARTCARD_DIVMANT((__PCLK__), (__BAUD__)) * 100U)) * 16U + 50U) / 100U) +#define SMARTCARD_DIVFRAQ(__PCLK__, __BAUD__) ((((SMARTCARD_DIV((__PCLK__), (__BAUD__)) - (SMARTCARD_DIVMANT((__PCLK__), (__BAUD__)) * 100U)) * 16U) + 50U) / 100U) /* SMARTCARD BRR = mantissa + overflow + fraction = (SMARTCARD DIVMANT << 4) + (SMARTCARD DIVFRAQ & 0xF0) + (SMARTCARD DIVFRAQ & 0x0FU) */ #define SMARTCARD_BRR(__PCLK__, __BAUD__) (((SMARTCARD_DIVMANT((__PCLK__), (__BAUD__)) << 4U) + \ diff --git a/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Inc/stm32f2xx_hal_uart.h b/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Inc/stm32f2xx_hal_uart.h index 6b723a7fd0..306dacc65c 100644 --- a/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Inc/stm32f2xx_hal_uart.h +++ b/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Inc/stm32f2xx_hal_uart.h @@ -535,7 +535,7 @@ typedef void (*pUART_CallbackTypeDef)(UART_HandleTypeDef *huart); /*!< pointer (((__INTERRUPT__) >> 28U) == UART_CR2_REG_INDEX)? ((__HANDLE__)->Instance->CR2 &= ~((__INTERRUPT__) & UART_IT_MASK)): \ ((__HANDLE__)->Instance->CR3 &= ~ ((__INTERRUPT__) & UART_IT_MASK))) -/** @brief Checks whether the specified UART interrupt has occurred or not. +/** @brief Checks whether the specified UART interrupt source is enabled or not. * @param __HANDLE__ specifies the UART Handle. * UART Handle selects the USARTx or UARTy peripheral * (USART,UART availability and x,y values depending on device). @@ -800,7 +800,7 @@ uint32_t HAL_UART_GetError(UART_HandleTypeDef *huart); #define UART_DIV_SAMPLING16(_PCLK_, _BAUD_) (((_PCLK_)*25U)/(4U*(_BAUD_))) #define UART_DIVMANT_SAMPLING16(_PCLK_, _BAUD_) (UART_DIV_SAMPLING16((_PCLK_), (_BAUD_))/100U) -#define UART_DIVFRAQ_SAMPLING16(_PCLK_, _BAUD_) (((UART_DIV_SAMPLING16((_PCLK_), (_BAUD_)) - (UART_DIVMANT_SAMPLING16((_PCLK_), (_BAUD_)) * 100U)) * 16U + 50U) / 100U) +#define UART_DIVFRAQ_SAMPLING16(_PCLK_, _BAUD_) ((((UART_DIV_SAMPLING16((_PCLK_), (_BAUD_)) - (UART_DIVMANT_SAMPLING16((_PCLK_), (_BAUD_)) * 100U)) * 16U) + 50U) / 100U) /* UART BRR = mantissa + overflow + fraction = (UART DIVMANT << 4) + (UART DIVFRAQ & 0xF0) + (UART DIVFRAQ & 0x0FU) */ #define UART_BRR_SAMPLING16(_PCLK_, _BAUD_) (((UART_DIVMANT_SAMPLING16((_PCLK_), (_BAUD_)) << 4U) + \ @@ -809,7 +809,7 @@ uint32_t HAL_UART_GetError(UART_HandleTypeDef *huart); #define UART_DIV_SAMPLING8(_PCLK_, _BAUD_) (((_PCLK_)*25U)/(2U*(_BAUD_))) #define UART_DIVMANT_SAMPLING8(_PCLK_, _BAUD_) (UART_DIV_SAMPLING8((_PCLK_), (_BAUD_))/100U) -#define UART_DIVFRAQ_SAMPLING8(_PCLK_, _BAUD_) (((UART_DIV_SAMPLING8((_PCLK_), (_BAUD_)) - (UART_DIVMANT_SAMPLING8((_PCLK_), (_BAUD_)) * 100U)) * 8U + 50U) / 100U) +#define UART_DIVFRAQ_SAMPLING8(_PCLK_, _BAUD_) ((((UART_DIV_SAMPLING8((_PCLK_), (_BAUD_)) - (UART_DIVMANT_SAMPLING8((_PCLK_), (_BAUD_)) * 100U)) * 8U) + 50U) / 100U) /* UART BRR = mantissa + overflow + fraction = (UART DIVMANT << 4) + ((UART DIVFRAQ & 0xF8) << 1) + (UART DIVFRAQ & 0x07U) */ #define UART_BRR_SAMPLING8(_PCLK_, _BAUD_) (((UART_DIVMANT_SAMPLING8((_PCLK_), (_BAUD_)) << 4U) + \ diff --git a/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Inc/stm32f2xx_hal_usart.h b/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Inc/stm32f2xx_hal_usart.h index a2d21ee498..2d046e4d5f 100644 --- a/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Inc/stm32f2xx_hal_usart.h +++ b/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Inc/stm32f2xx_hal_usart.h @@ -607,7 +607,7 @@ uint32_t HAL_USART_GetError(USART_HandleTypeDef *husart); #define USART_DIVMANT(_PCLK_, _BAUD_) (USART_DIV((_PCLK_), (_BAUD_))/100U) -#define USART_DIVFRAQ(_PCLK_, _BAUD_) (((USART_DIV((_PCLK_), (_BAUD_)) - (USART_DIVMANT((_PCLK_), (_BAUD_)) * 100U)) * 8U + 50U) / 100U) +#define USART_DIVFRAQ(_PCLK_, _BAUD_) ((((USART_DIV((_PCLK_), (_BAUD_)) - (USART_DIVMANT((_PCLK_), (_BAUD_)) * 100U)) * 8U) + 50U) / 100U) /* UART BRR = mantissa + overflow + fraction = (UART DIVMANT << 4) + ((UART DIVFRAQ & 0xF8) << 1) + (UART DIVFRAQ & 0x07U) */ diff --git a/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Inc/stm32f2xx_ll_usart.h b/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Inc/stm32f2xx_ll_usart.h index 8dbf5eeaa2..864d8a3c2a 100644 --- a/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Inc/stm32f2xx_ll_usart.h +++ b/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Inc/stm32f2xx_ll_usart.h @@ -375,7 +375,7 @@ typedef struct */ #define __LL_USART_DIV_SAMPLING16_100(__PERIPHCLK__, __BAUDRATE__) (((__PERIPHCLK__)*25)/(4*(__BAUDRATE__))) #define __LL_USART_DIVMANT_SAMPLING16(__PERIPHCLK__, __BAUDRATE__) (__LL_USART_DIV_SAMPLING16_100((__PERIPHCLK__), (__BAUDRATE__))/100) -#define __LL_USART_DIVFRAQ_SAMPLING16(__PERIPHCLK__, __BAUDRATE__) (((__LL_USART_DIV_SAMPLING16_100((__PERIPHCLK__), (__BAUDRATE__)) - (__LL_USART_DIVMANT_SAMPLING16((__PERIPHCLK__), (__BAUDRATE__)) * 100)) * 16 + 50) / 100) +#define __LL_USART_DIVFRAQ_SAMPLING16(__PERIPHCLK__, __BAUDRATE__) ((((__LL_USART_DIV_SAMPLING16_100((__PERIPHCLK__), (__BAUDRATE__)) - (__LL_USART_DIVMANT_SAMPLING16((__PERIPHCLK__), (__BAUDRATE__)) * 100)) * 16) + 50) / 100) /* USART BRR = mantissa + overflow + fraction = (USART DIVMANT << 4) + (USART DIVFRAQ & 0xF0) + (USART DIVFRAQ & 0x0F) */ #define __LL_USART_DIV_SAMPLING16(__PERIPHCLK__, __BAUDRATE__) (((__LL_USART_DIVMANT_SAMPLING16((__PERIPHCLK__), (__BAUDRATE__)) << 4) + \ diff --git a/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Release_Notes.html b/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Release_Notes.html new file mode 100644 index 0000000000..eef6b2548e --- /dev/null +++ b/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Release_Notes.html @@ -0,0 +1,1961 @@ + + + + + + + Release Notes for STM32F2xx HAL Drivers + + + + + +
+
+
+
+
+

Release Notes for STM32F2xx HAL Drivers

+

Copyright © 2017 STMicroelectronics
+

+ +
+
+
+

License

+This software component is licensed by ST under BSD 3-Clause license, the “License”; You may not use this component except in compliance with the License. You may obtain a copy of the License at: +
+https://opensource.org/licenses/BSD-3-Clause +
+
+
+

Update History

+
+ +
+

Main Changes

+
    +
  • General updates to fix known defects and enhancements implementation
  • +
  • HAL/LL GPIO update +
      +
    • Update GPIO initialization sequence to avoid unwanted pulse on GPIO Pin’s
    • +
  • +
  • HAL I2C update +
      +
    • Update HAL_I2C_EV_IRQHandler() API to fix I2C send break issue +
        +
      • Add additional check on hi2c->hdmatx, hdmatx->XferCpltCallback, hi2c->hdmarx, hdmarx->XferCpltCallback in I2C_Master_SB() API to avoid enabling DMA request when IT mode is used.
      • +
    • +
    • Update HAL_I2C_ER_IRQHandler() API to fix acknowledge failure issue with I2C memory IT processes +
        +
      • Add stop condition generation when NACK occurs.
      • +
    • +
    • Update HAL_I2C_Init() API to force software reset before setting new I2C configuration.
    • +
    • Update HAL I2C processes to report ErrorCode when wrong I2C start condition occurs +
        +
      • Add new ErrorCode define: HAL_I2C_WRONG_START
      • +
      • Set ErrorCode parameter in I2C handle to HAL_I2C_WRONG_START
      • +
    • +
    • Update I2C_DMAXferCplt(), I2C_DMAError() and I2C_DMAAbort() APIs to fix hardfault issue when hdmatx and hdmarx parameters in i2c handle aren’t initialized (NULL pointer). +
        +
      • Add additional check on hi2c->hdmtx and hi2c->hdmarx before resetting DMA Tx/Rx complete callbacks.
      • +
    • +
  • +
  • HAL IRDA update +
      +
    • Update IRDA interruption handler to manage correctly the overrun interrupt +
        +
      • Add in the HAL_IRDA_IRQHandler() API a check on USART_CR1_RXNEIE bit when an overrun interrupt occurs.
      • +
    • +
  • +
  • HAL SMARTCARD update +
      +
    • Update SMARTCARD interruption handler to manage correctly the overrun interrupt. +
        +
      • Add in the HAL_SMARTCARD_IRQHandler() API a check on USART_CR1_RXNEIE bit when an overrun interrupt occurs.
      • +
    • +
  • +
  • HAL UART update +
      +
    • Update UART polling processes to handle efficiently the Lock mechanism +
        +
      • Move the process unlock at the top of the HAL_UART_Receive() and HAL_UART_Transmit() API.
      • +
    • +
    • Update UART interruption handler to manage correctly the overrun interrupt +
        +
      • Add in the HAL_UART_IRQHandler() API a check on USART_CR1_RXNEIE bit when an overrun interrupt occurs.
      • +
    • +
  • +
  • HAL USART update +
      +
    • Update USART interruption handler to manage correctly the overrun interrupt +
        +
      • Add in the HAL_USART_IRQHandler() API a check on USART_CR1_RXNEIE bit when an overrun interrupt occurs.
      • +
    • +
  • +
+
+
+
+ +
+

Main Changes

+
    +
  • General updates to fix known defects and enhancements implementation
  • +
  • HAL drivers clean up: remove double casting ‘uint32_t’ and ‘U’
  • +
  • General updates to fix CodeSonar compilation warnings
  • +
  • General updates to fix the user manual .chm files
  • +
  • Add support of HAL callback registration feature
  • +
  • Add new HAL EXTI driver
  • +
  • The following changes done on the HAL drivers require an update on the application code based on older HAL versions +
      +
    • HAL/LL Generic update +
        +
      • Add support of HAL callback registration feature +
          +
        • The feature disabled by default is available for the following HAL drivers: +
            +
          • ADC, CAN, CRYP, DAC, DCMI, ETH, HASH, HCD, I2C, UART, USART, IRDA, SMARTCARD,
          • +
          • MMC, NAND, NOR, PCCARD, PCD, RNG, RTC, SD, SRAM, SPI, I2S, TIM and WWDG
          • +
        • +
        • The feature may be enabled individually per HAL PPP driver by setting the corresponding definition USE_HAL_PPP_REGISTER_CALLBACKS to 1U in stm32f2xx_hal_conf.h project configuration file (template file stm32f2xx_hal_conf_template.h available from Drivers/STM32F2xx_HAL_Driver/Inc)
        • +
        • Once enabled , the user application may resort to HAL_PPP_RegisterCallback() to register specific callback function(s) and unregister it(them) with HAL_PPP_UnRegisterCallback()
        • +
      • +
    • +
    • Rework of HAL CRYP driver (compatibility break) +
        +
      • HAL CRYP driver has been redesigned with new API’s, to bypass limitations on data Encryption/Decryption management present with previous HAL CRYP driver version.
      • +
      • The new HAL CRYP driver is the recommended version. It is located as usual in Drivers/STM32F2xx_HAL_Driver/Src and Drivers/STM32f2xx_HAL_Driver/Inc folders. It can be enabled through switch HAL_CRYP_MODULE_ENABLED in stm32f2xx_hal_conf.h
      • +
      • The legacy HAL CRYP driver is no longer supported.
      • +
    • +
    • Rework of HAL CAN driver (compatibility break) +
        +
      • A new HAL CAN driver has been redesigned with new APIs, to bypass limitations on CAN Tx/Rx FIFO management present with previous HAL CAN driver version.
      • +
      • The new HAL CAN driver is the recommended version. It is located as usual in Drivers/STM32F2xx_HAL_Driver/Src and Drivers/STM32f2xx_HAL_Driver/Inc folders. It can be enabled through switch HAL_CAN_MODULE_ENABLED in stm32f2xx_hal_conf.h
      • +
      • The legacy HAL CAN driver is also present in the release in Drivers/STM32F2xx_HAL_Driver/Src/Legacy and Drivers/STM32F2xx_HAL_Driver/Inc/Legacy folders for software compatibility reasons. Its usage is not recommended as deprecated. It can however be enabled through switch HAL_CAN_LEGACY_MODULE_ENABLED in stm32f2xx_hal_conf.h
      • +
    • +
  • +
  • HAL/LL Generic update +
      +
    • Update HAL driver to allow user to change systick period to 1ms, 10 ms or 100 ms : +
        +
      • Add the following API’s : +
          +
        • HAL_GetTickPrio(): Returns a tick priority.
        • +
        • HAL_SetTickFreq(): Sets new tick frequency.
        • +
        • HAL_GetTickFreq(): Returns tick frequency.
        • +
      • +
      • Add HAL_TickFreqTypeDef enumeration for the different Tick Frequencies: 10 Hz, 100 Hz and 1KHz (default).
      • +
    • +
    • Add UNUSED() macro implementation to avoid GCC warning +
        +
      • The warning is detected when the UNUSED() macro is called from C++ file
      • +
    • +
    • General updates to fix MISRA 2012 compilation errors +
        +
      • HAL_IS_BIT_SET()/HAL_IS_BIT_CLR() macros implementation update
      • +
      • “stdio.h” include updated with “stddef.h”
      • +
    • +
    • Add HAL_GetUIDw0(), HAL_GetUIDw1() and HAL_GetUIDw2() API in order to returns the unique device identifier
    • +
  • +
  • HAL CAN update +
      +
    • Fields of CAN_InitTypeDef structure are reworked: +
        +
      • SJW to SyncJumpWidth, BS1 to TimeSeg1, BS2 to TimeSeg2, TTCM to TimeTriggeredMode, ABOM to AutoBusOff, AWUM to AutoWakeUp, NART to AutoRetransmission (inversed), RFLM to ReceiveFifoLocked and TXFP to TransmitFifoPriority
      • +
    • +
    • Rename CAN_FilterConfTypeDef structure to CAN_FilterTypeDef and update some fields: +
        +
      • FilterNumber to FilterBank
      • +
      • BankNumber to SlaveStartFilterBank
      • +
    • +
    • Rename CanTxMsgTypeDef structure to CAN_TxHeaderTypeDef and update some fields: +
        +
      • Data to TransmitGlobalTime
      • +
    • +
    • Rename CanRxMsgTypeDef structure to CAN_RxHeaderTypeDef and update some fields: +
        +
      • Data to Timestamp
      • +
      • FMI to FilterMatchIndex
      • +
    • +
    • Update possible values list for FilterActivation parameter in CAN_FilterTypeDef structure +
        +
      • CAN_FILTER_ENABLE instead of ENABLE
      • +
      • CAN_FILTER_DISABLE instead of DISABLE
      • +
    • +
    • HAL_CAN_Init() is split into both HAL_CAN_Init() and HAL_CAN_Start() API’s
    • +
    • HAL_CAN_Transmit() is replaced by HAL_CAN_AddTxMessage() to place Tx Request, then HAL_CAN_GetTxMailboxesFreeLevel() for polling until completion.
    • +
    • HAL_CAN_Transmit_IT() is replaced by HAL_CAN_ActivateNotification() to enable transmit IT, then HAL_CAN_AddTxMessage() for place Tx request.
    • +
    • HAL_CAN_Receive() is replaced by HAL_CAN_GetRxFifoFillLevel() for polling until reception, then HAL_CAN_GetRxMessage()
    • +
    • to get Rx message.
    • +
    • HAL_CAN_Receive_IT() is replaced by HAL_CAN_ActivateNotification() to enable receive IT, then HAL_CAN_GetRxMessage()
    • +
    • in the receive callback to get Rx message
    • +
    • HAL_CAN_Slepp() is renamed as HAL_CAN_RequestSleep()
    • +
    • HAL_CAN_TxCpltCallback() is split into HAL_CAN_TxMailbox0CompleteCallback(), HAL_CAN_TxMailbox1CompleteCallback() and HAL_CAN_TxMailbox2CompleteCallback().
    • +
    • HAL_CAN_RxCpltCallback is split into HAL_CAN_RxFifo0MsgPendingCallback() and HAL_CAN_RxFifo1MsgPendingCallback().
    • +
    • More complete “How to use the new driver” is detailed in the driver header section itself.
    • +
    • Refer to the following example to identify the changes
    • +
  • +
  • HAL CRC update +
      +
    • Update __HAL_CRC_DR_RESET() macro
    • +
    • Update HAL_CRC_DeInit() API to +
        +
      • Be able to return HAL status when CRC is is already busy
      • +
      • DeInit the low level hardware after reset IDR register content
      • +
    • +
    • Remove extra call to HAL_LOCK/HAL_UNLOCK from the followings API’s: +
        +
      • HAL_CRC_Accumulate()
      • +
      • HAL_CRC_Calculate()
      • +
    • +
  • +
  • HAL CRYP update +
      +
    • The CRYP_InitTypeDef is no more supported, changed by CRYP_ConfigTypedef to allow changing parameters
    • +
    • Using HAL_CRYP_setConfig() API without reinitialize the CRYP IP using the HAL_CRYP_Init() API
    • +
    • New parameters added in the CRYP_ConfigTypeDef structure: B0 and DataWidthUnit
    • +
    • Input data size and error code parameters are added in the CRYP_HandleTypeDef structure
    • +
    • Add new APIs to manage the CRYP configuration: +
        +
      • HAL_CRYP_SetConfig()
      • +
      • HAL_CRYP_GetConfig()
      • +
    • +
    • Add new APIs to encrypt and decrypt data: +
        +
      • HAL_CRYP_Encypt()
      • +
      • HAL_CRYP_Decypt()
      • +
      • HAL_CRYP_Encypt_IT()
      • +
      • HAL_CRYP_Decypt_IT()
      • +
      • HAL_CRYP_Encypt_DMA()
      • +
      • HAL_CRYP_Decypt_DMA()
      • +
    • +
    • More complete “How to use the new driver” is detailed in the driver header section itself.
    • +
    • Refer to the following example to identify the changes
    • +
  • +
  • HAL DAC update +
      +
    • Overall rework of the driver for a more efficient implementation +
        +
      • Update HAL_DAC_Start(), HAL_DAC_Start_DMA(), HAL_DAC_Stop_DMA() and HAL_DAC_ConfigChannel() API to +
          +
        • Update lock mechanism for DAC process
        • +
        • Optimize code by using direct register read
        • +
      • +
      • Update HAL_DAC_IRQHandler() function to +
          +
        • Add error management in case DMA errors through HAL_DAC_DMAUnderrunCallbackCh1() and HAL_DACEx_DMAUnderrunCallbackCh2()
        • +
        • Optimize code by using direct register read
        • +
      • +
    • +
  • +
  • HAL DCMI update +
      +
    • Update HAL_DCMI_Start_DMA() function to Enable the DCMI peripheral
    • +
    • Add new timeout implementation based on cpu cycles for DCMI stop
    • +
    • Update lock mechanism for DCMI process
    • +
    • Update HAL_DCMI_IRQHandler() function to: +
        +
      • Optimize code by using direct register read
      • +
    • +
    • The extension files stm32f2xx_hal_dcmi_ex.c/.h is added and kept empty for projects compatibility reason
    • +
    • Add DCMI_SyncUnmaskTypeDef structure and HAL_DCMI_ConfigSyncUnmask() API to manage embedded synchronization delimiters unmasks
    • +
    • HAL DCMI driver clean-up: remove non referenced callback APIs: HAL_DCMI_VsyncCallback() and HAL_DCMI_HsyncCallback()
    • +
  • +
  • HAL DMA update +
      +
    • Add clean of callbacks in HAL_DMA_DeInit() API
    • +
    • Remove FIFO error enabling in “HAL_DMA_Start_IT” +
        +
      • when FIFO error monitoring is requested in IT model, the macro __HAL_DMA_ENABLE_IT can be used to enable the FIFO error IT at the user Msp functio
      • +
    • +
  • +
  • HAL FLASH update +
      +
    • HAL_FLASH_Unlock() update to return state error when the FLASH is already unlocked
    • +
  • +
  • HAL GPIO update +
      +
    • HAL_GPIO_TogglePin() API implementation update: to improve robustness
    • +
    • HAL_GPIO_DeInit() API update to ensure clear all GPIO EXTI pending interrupts.
    • +
  • +
  • HAL HASH update +
      +
    • Overall rework of the driver for a more efficient implementation +
        +
      • HASH API changes for MISRA-C 2012 compliance
      • +
      • Update HASH_Start_DMA() to add check on HASH_CR_MDMAT bit before checking input buffer length in case of multi-buffer processing
      • +
      • Fill-up empty statement in HAL_HASH_DMAFeed_ProcessSuspend() to correct CodeSonar warning
      • +
    • +
  • +
  • HAL I2C update +
      +
    • I2C API changes for MISRA-C 2012 compliance: +
        +
      • Rename HAL_I2C_Master_Sequential_Transmit_IT() to HAL_I2C_Master_Seq_Transmit_IT()
      • +
      • Rename HAL_I2C_Master_Sequentiel_Receive_IT() to HAL_I2C_Master_Seq_Receive_IT()
      • +
      • Rename HAL_I2C_Slave_Sequentiel_Transmit_IT() to HAL_I2C_Slave_Seq_Transmit_IT()
      • +
      • Rename HAL_I2C_Slave_Sequentiel_Receive_DMA() to HAL_I2C_Slave_Seq_Receive_DMA()
      • +
    • +
    • Add support of I2C repeated start feature in DMA Mode With the following new API’s +
        +
      • HAL_I2C_Master_Seq_Transmit_DMA()
      • +
      • HAL_I2C_Master_Seq_Receive_DMA()
      • +
      • HAL_I2C_Slave_Seq_Transmit_DMA()
      • +
      • HAL_I2C_Slave_Seq_Receive_DMA()
      • +
    • +
    • Add new I2C transfer options to easy manage the sequential transfers +
        +
      • I2C_OTHER_FRAME
      • +
      • I2C_OTHER_AND_LAST_FRAME
      • +
    • +
    • Fix I2C send break issue in IT processes +
        +
      • Add additional check on hi2c->hdmatxand hi2c->hdmarx to avoid the DMA request enable when ITmode is used.
      • +
    • +
  • +
  • HAL UART/USART/IrDA/SMARTCARD update +
      +
    • Overall rework of the driver for a more efficient implementation +
        +
      • Improve I/O operation functions: separate transfer process and PPP state management
      • +
      • Update the HAL_PPP_IRQHandler function by optimizing the management of interrupt errors
      • +
      • Align driver with the Reference Manual regarding registers and bit definition naming
      • +
    • +
  • +
  • LL IWDG update +
      +
    • Update LL inline macros to use IWDGx parameter instead of IWDG instance defined in CMSIS device
    • +
  • +
  • HAL RNG update +
      +
    • Add ErrorCode parameter in HAL RNG Handler structure
    • +
    • Add HAL_RNG_GetError() API
    • +
    • HAL Lock/Unlock mecanism update
    • +
  • +
  • HAL/LL RTC update +
      +
    • HAL/ LL drivers optimization +
        +
      • HAL driver: remove unused variables
      • +
      • LL driver: getter APIs optimization
      • +
    • +
  • +
  • HAL/LL RCC update +
      +
    • Update HAL_RCC_DeInit() and LL_RCC_DeInit() APIs to +
        +
      • Be able to return HAL/LL status
      • +
      • Add checks for HSI, PLL and PLLI2S ready before modifying RCC CFGR registers
      • +
      • Clear all interrupt flags
      • +
      • Initialize systick interrupt period
      • +
    • +
  • +
  • HAL SDMMC update +
      +
    • Add API HAL_SD_ConfigSpeedBusOperation() to configure the SD card speed bus mode
    • +
    • Fix and improve state and error management
    • +
    • Fix preprocessing compilation issue with SDIO STA STBITERR interrupt
    • +
    • Align driver with the Reference Manual regarding registers and bit definition naming
    • +
  • +
  • HAL SPI update +
      +
    • Overall rework of the driver for a more efficient implementation +
        +
      • Add the following new macros: +
          +
        • SPI_CHECK_FLAG()
        • +
        • SPI_CHECK_IT_SOURCE()
        • +
      • +
      • Update HAL_SPI_StateTypeDef structure to add new state: HAL_SPI_STATE_ABORT
      • +
      • Add HAL_SPI_Abort() to manage abort issue in SPI TX or Rx mode only
      • +
      • Update HAL_SPI_Transmit()/HAL_SPI_Receive() API’s to fix memory overflow issue.
      • +
      • Update HAL_SPI_Transmit_DMA : checking hmdtx instead of hdmrx.
      • +
      • Update HAL_SPI_IRQHandler() function to +
          +
        • Add error management in case DMA errors through HAL_DMA_Abort_IT() and ErrorCallback()
        • +
        • Optimize code by using direct register read
        • +
      • +
      • Align driver with the Reference Manual regarding registers and bit definition naming
      • +
    • +
  • +
  • HAL I2S update +
      +
    • Overall rework of the driver for a more efficient implementation +
        +
      • Add the following new macros: +
          +
        • I2S_CHECK_FLAG()
        • +
        • I2S_CHECK_IT_SOURCE()
        • +
      • +
      • Update HAL_I2S_Transmit()/HAL_I2S_Receive() API’s to fix memory overflow issue
      • +
      • Update HAL_SPI_IRQHandler() function to +
          +
        • Add error management in case DMA errors through HAL_DMA_Abort_IT() and ErrorCallback()
        • +
        • Optimize code by using direct register read
        • +
      • +
      • Add extra call to HAL_LOCK/HAL_UNLOCK to the followings API’s: +
          +
        • HAL_I2S_Transmit()
        • +
        • HAL_I2S_Receive()
        • +
        • HAL_I2S_Transmit_IT()
        • +
        • HAL_I2S_Receive_IT()
        • +
        • HAL_I2S_Transmit_DMA()
        • +
        • HAL_I2S_Receive_DMA()
        • +
      • +
      • Align driver with the Reference Manual regarding registers and bit definition naming
      • +
    • +
  • +
  • HAL/LL TIM update +
      +
    • Move the following TIM structures from stm32f4xx_hal_tim_ex.h into stm32f4xx_hal_tim.h +
        +
      • TIM_MasterConfigTypeDef()
      • +
      • TIM_BreakDeadTimeConfigTypeDef()
      • +
    • +
    • Add new TIM Callbacks API’s: +
        +
      • HAL_TIM_PeriodElapsedHalfCpltCallback()
      • +
      • HAL_TIM_IC_CaptureHalfCpltCallback()
      • +
      • HAL_TIM_PWM_PulseFinishedHalfCpltCallback()
      • +
      • HAL_TIM_TriggerHalfCpltCallback()
      • +
    • +
    • TIM API changes for MISRA-C 2012 compliance: +
        +
      • Rename HAL_TIM_SlaveConfigSynchronization to HAL_TIM_SlaveConfigSynchro
      • +
      • Rename HAL_TIM_SlaveConfigSynchronization_IT to HAL_TIM_SlaveConfigSynchro_IT
      • +
      • Rename HAL_TIMEx_ConfigCommutationEvent to HAL_TIMEx_ConfigCommutEvent
      • +
      • Rename HAL_TIMEx_ConfigCommutationEvent_IT to HAL_TIMEx_ConfigCommutEvent_IT
      • +
      • Rename HAL_TIMEx_ConfigCommutationEvent_DMA to HAL_TIMEx_ConfigCommutEvent_DMA
      • +
      • Rename HAL_TIMEx_CommutationCallback to HAL_TIMEx_CommutCallback
      • +
      • Rename HAL_TIMEx_DMACommutationCplt to TIMEx_DMACommutationCplt
      • +
    • +
    • Add a call to HAL_DMA_Abort_IT from HAL_TIM_XXX_Stop_DMA
    • +
  • +
  • HAL/LL USB update +
      +
    • Rework USB interrupt handler and improve HS DMA support in Device mode
    • +
    • Fix BCD handling for OTG instance in device mode
    • +
    • cleanup reference to low speed in device mode
    • +
    • Allow writing TX FIFO in case of transfer length is equal to available space in the TX FIFO
    • +
    • Fix Toggle OUT interrupt channel in host mode
    • +
    • Add new callback to be used to handle usb device connection/disconnection +
        +
      • HAL_HCD_PortEnabled_Callback()
      • +
      • HAL_HCD_PortDisabled_Callback()
      • +
    • +
    • Update to prevent reactivate host interrupt channel
    • +
    • Updated USB_WritePacket(), USB_ReadPacket()APIs to prevent compilation warning with GCC GNU v8.2.0
    • +
    • Rework USB_EPStartXfer() API to enable theUSB endpoint before unmasking the TX FiFo empty interrupt in case DMA is not used
    • +
    • USB HAL_HCD_Init() and HAL_PCD_Init() APIsupdated to avoid enabling USB DMA feature for OTG FS instance, USB DMAfeature is available only on OTG HS Instance
    • +
    • Remove duplicated line in hal_hcd.c header file comment section
    • +
    • Rework USB HAL driver to use instancePCD_SPEED_xxx, HCD_SPEED_xx speeds instead of OTG register Core speed definition during the instance initialization
    • +
    • Software Quality improvement with a fix ofCodeSonar warning on PCD_Port_IRQHandler() and HCD_Port_IRQHandler()interrupt handlers
    • +
  • +
  • HAL UTILS update +
      +
    • Update LL_GetFlashSize() API to return uint32_t instead of uint16_t
    • +
  • +
+
+
+
+ +
+

Main Changes

+
    +
  • General updates to fix known defects and enhancements implementation
  • +
  • Fix compilation warning with GCC compiler
  • +
  • Remove Date and version from header files
  • +
  • HAL Generic update +
      +
    • Update __weak and __packed defined values for ARM compiler
    • +
    • Update __ALIGN_BEGIN and __ALIGN_END defined values for ARM compiler
    • +
  • +
  • HAL I2C update +
      +
    • Update Interface APIs headers to remove confusing message about device address
    • +
    • UpdateI2C_MasterReceive_RXNE() and I2C_MasterReceive_BTF() static APIs to fix badHandling of NACK in I2C master receive process.
    • +
  • +
  • HAL RCC update +
      +
    • Update HAL_RCC_GetOscConfig()API to: +
        +
      • set PLLR in theRCC_OscInitStruct
      • +
      • check on null pointer
      • +
      • Update HAL_RCC_ClockConfig()API to:
      • +
      • check on null pointer
      • +
      • optimize code size byupdating the handling method of the SWS bits
      • +
      • update to use __HAL_FLASH_GET_LATENCY() flash macro instead of using direct registeraccess to LATENCY bits in FLASH ACR register.
      • +
    • +
    • Update HAL_RCC_DeInit() to +
        +
      • Be able to return HAL status (HAL_OK, HAL_TIMEOUT and HAL_ERROR)
      • +
      • Add checks for HSI, PLL and PLLI2S ready before modifying RCC CFGR registers
      • +
      • Clear all interrupt falgs
      • +
      • Initialize systick interrupt period
      • +
    • +
    • Update HAL_RCC_GetSysClockFreq() to avoid risk of rounding error which may leads to a wrong returned value.
    • +
  • +
  • HAL RNG update +
      +
    • HAL_RNG_Init() remove Lock()/Unlock()
    • +
  • +
  • HAL MMC update +
      +
    • HAL_MMC_Erase() API: add missing () to fix compilation warning detected with SW4STM32 when extra feature is enabled.
    • +
  • +
  • LL DMA update +
      +
    • Update to clear DMA flags using WRITE_REG() instead SET_REG() API to avoid read access to the IFCR register that is write only.
    • +
    • Update values for the following defines: DMA_FLAG_FEIF0_4 and DMA_FLAG_DMEIF0_4
    • +
  • +
  • LL RTC update +
      +
    • Fix warning with static analyzer
    • +
  • +
  • LL USART update +
      +
    • Add assert macros to check USART BaudRate register
    • +
  • +
  • LL I2C update +
      +
    • Rename IS_I2C_CLOCK_SPEED()and IS_I2C_DUTY_CYCLE() respectively to IS_LL_I2C_CLOCK_SPEED() andIS_LL_I2C_DUTY_CYCLE() to avoid incompatible macros redefinition.
    • +
  • +
+
+
+
+ +
+

Main Changes

+
    +
  • General updates to fix known defects and enhancements implementation
  • +
  • HAL CONF Template update +
      +
    • Add support for HAL MMC driver.
    • +
  • +
  • HAL CAN update +
      +
    • Addmanagement of overrun error.
    • +
    • Allowpossibility to receive messages from the 2 RX FIFOs in parallel viainterrupt.
    • +
    • Fix messagelost issue with specific sequence of transmit requests.
    • +
    • Handletransmission failure with error callback, when NART is enabled.
    • +
    • Add __HAL_CAN_CANCEL_TRANSMIT() call to abort transmission whentimeout is reached
    • +
  • +
+
+
+
+ +
+

Main Changes

+
    +
  • Add Low Layer drivers allowing performance and footprint optimization +
      +
    • Low Layer drivers APIs provide register level programming: require deep knowledge of peripherals described in STM32F2xx Reference Manuals
    • +
    • Low Layer drivers are available for: ADC, Cortex, CRC, DAC, DMA, EXTI, GPIO, I2C, IWDG, PWR, RCC, RNG, RTC, SPI, TIM, USART, WWDG peripherals and additionnal Low Level Bus, System and Utilities APIs.
    • +
    • Low Layer drivers APIs are implemented as static inline function in new Inc/stm32f2xx_ll_ppp.h files for PPP peripherals, there is no configuration file and each stm32f2xx_ll_ppp.h file must be included in user code.
    • +
  • +
  • General updates to fix known defects and enhancements implementation
  • +
  • Fix extra warnings with GCC compiler
  • +
  • HAL drivers clean up: remove double casting ‘uint32_t’ and ‘U’
  • +
  • Add new HAL MMC driver
  • +
  • The following changes done on the HAL drivers require an update on the application code based on older HAL versions +
      +
    • HAL SD update +
        +
      • Overall rework of the driver for a more efficient implementation +
          +
        • Modify initialization API and structures
        • +
        • Modify Read / Write sequences: separate transfer process and SD Cards state management
        • +
        • Adding interrupt mode for Read / Write operations
        • +
        • Update the HAL_SD_IRQHandler function by optimizing the management of interrupt errors
        • +
      • +
      • Refer to the following example to identify the changes: BSP example and USB_Device/MSC_Standalone application
      • +
    • +
    • HAL NAND update
    • +
    • Modify NAND_AddressTypeDef, NAND_DeviceConfigTypeDef and NAND_HandleTypeDef structures fields
    • +
    • Add new HAL_NAND_ConfigDevice API
    • +
  • +
  • HAL update +
      +
    • Modifiy default HAL_Delay implementation to guarantee minimum delay
    • +
    • Add HAL_GetUID API : returns the unique device identifier
    • +
  • +
  • HAL Cortex update +
      +
    • Move HAL_MPU_Disable() and HAL_MPU_Enable() from stm32f2xx_hal_cortex.h to stm32f2xx_hal_cortex.c
    • +
    • Clear the whole MPU control register in HAL_MPU_Disable() API
    • +
  • +
  • HAL FLASH update +
      +
    • IS_FLASH_ADDRESS() macro update to support OTP range
    • +
    • FLASH_Program_DoubleWord(): Replace 64-bit accesses with 2 double-words operations
    • +
  • +
  • HAL GPIO update +
      +
    • Update IS_GPIO_PIN() macro implementation to be more safe
    • +
  • +
  • HAL RCC update +
      +
    • Update IS_RCC_PLLQ_VALUE() macro implementation: the minimum accepted value is 2 instead of 4
    • +
    • Update to refer to AHBPrescTable[] and APBPrescTable[] tables defined in system_stm32f2xx.c file instead of APBAHBPrescTable[] table.
    • +
  • +
  • HAL DMA update +
      +
    • HAL_DMA_Init(): update to check compatibility between FIFO threshold level and size of the memory burst
    • +
  • +
  • HAL UART/USART/IrDA/SMARTCARD (referenced as PPP here below) +
      +
    • DMA Receive process; the code has been updated to clear the PPP OVR flag before enabling DMA receive request.
    • +
    • Add transfer abort APIs and associated callbacks : +
        +
      • HAL_PPP_Abort()
      • +
      • HAL_PPP_AbortTransmit()
      • +
      • HAL_PPP_AbortReceive()
      • +
      • HAL_PPP_Abort_IT()
      • +
      • HAL_PPP_AbortTransmit_IT()
      • +
      • HAL_PPP_AbortReceive_IT()
      • +
      • HAL_PPP_AbortCpltCallback()
      • +
      • HAL_PPP_AbortTransmitCpltCallback()
      • +
      • HAL_PPP_AbortReceiveCpltCallback()
      • +
    • +
  • +
  • HAL CAN update +
      +
    • Remove Lock mechanism from HAL_CAN_Transmit_IT() and HAL_CAN_Receive_IT() processes
    • +
    • HAL CAN driver optimization
    • +
  • +
  • HAL TIM update +
      +
    • Add __HAL_TIM_MOE_DISABLE_UNCONDITIONALLY() macro to disable Master output without check on TIM channel state.
    • +
    • Update HAL_TIMEx_ConfigBreakDeadTime() to fix TIM BDTR register corruption.
    • +
  • +
  • HAL I2C update +
      +
    • Update HAL_I2C_Master_Transmit() and HAL_I2C_Slave_Transmit() to avoid sending extra bytes at the end of the transmit processes
    • +
    • UpdateHAL_I2C_Mem_Read() API to fix wrong check on misused parameter “Size”
    • +
    • UpdateI2C_MasterReceive_RXNE() and I2C_MasterReceive_BTF() static APIs toenhance Master sequential reception process.
    • +
  • +
  • HAL SPI update +
      +
    • Add transfer abort APIs and associated callbacks in interrupt mode +
        +
      • HAL_SPI_Abort()
      • +
      • HAL_SPI_Abort_IT()
      • +
      • HAL_SPI_AbortCpltCallback()
      • +
    • +
  • +
  • HAL USB PCD update +
      +
    • Flush all TX FIFOs on USB Reset
    • +
    • Remove Lock mechanism from HAL_PCD_EP_Transmit() and HAL_PCD_EP_Receive() API’s
    • +
  • +
  • LL USB update +
      +
    • Enable DMA Burst mode for USB OTG HS
    • +
    • Fix SD card detection issue
    • +
  • +
  • LL SDMMC update +
      +
    • Add new SDMMC_CmdSDEraseStartAdd, SDMMC_CmdSDEraseEndAdd, SDMMC_CmdOpCondition and SDMMC_CmdSwitch functions
    • +
  • +
+
+
+
+ +
+

Main Changes

+
    +
  • General updates to fix known defects and enhancements implementation
  • +
  • Enhance HAL delay and time base implementation: +
      +
    • Add new drivers stm32f2xx_hal_timebase_tim_template.c, stm32f2xx_hal_timebase_rtc_alarm_template.c and stm32f2xx_hal_timebase_rtc_wakeup_template.c which override the native HAL time base functions (defined as weak) to either use the TIM or the RTC as time base tick source. For more details about the usage of these drivers, please refer to HAL_TimeBase examples and FreeRTOS-based applications
    • +
  • +
  • The following changes done on the HAL drivers require an update on the application code based on HAL V1.1.2 +
      +
    • HAL UART, USART, IRDA, SMARTCARD, SPI, I2C (referenced as PPP here below) drivers +
        +
      • Add PPP error management during DMA process. This requires the following updates on user application: +
          +
        • Configure and enable the PPP IRQ in HAL_PPP_MspInit() function
        • +
        • In stm32f2xx_it.c file, PPP_IRQHandler() function: add a call to HAL_PPP_IRQHandler() function
        • +
        • Add and customize the Error Callback API: HAL_PPP_ErrorCallback()
        • +
      • +
      • HAL I2C driver:◾Update to avoid waiting on STOPF/BTF/AF flag under DMA ISR by using the PPP end of transfer interrupt in theDMA transfer process. This requires the following updates on user application: +
          +
        • Configure and enable the PPP IRQ in HAL_PPP_MspInit() function
        • +
        • In stm32f2xx_it.c file, PPP_IRQHandler() function: add a call to HAL_PPP_IRQHandler() function
        • +
      • +
      • I2C transfer processes IT update: NACK during addressing phase is managed through I2C Error interrupt instead of HAL state
      • +
    • +
    • HAL IWDG driver: rework overall driver for better implementation +
        +
      • Remove HAL_IWDG_Start(), HAL_IWDG_MspInit() and HAL_IWDG_GetState() APIs
      • +
    • +
    • HAL WWDG driver: rework overall driver for better implementation +
        +
      • Remove HAL_WWDG_Start(), HAL_WWDG_Start_IT(), HAL_WWDG_MspDeInit() and HAL_WWDG_GetState() APIs
      • +
      • Update the HAL_WWDG_Refresh(WWDG_HandleTypeDef *hwwdg, uint32_t counter) function and API by removing the “counter” parameter
      • +
    • +
  • +
  • HAL Generic update +
      +
    • stm32f2xx_hal_conf_template.h +
        +
      • Optimize HSE Startup Timeout value from 5000ms to 100 ms
      • +
      • Add new define LSE_STARTUP_TIMEOUT
      • +
      • Add new define USE_SPI_CRC for code cleanup when the CRC calculation is disabled.
      • +
    • +
    • Update HAL drivers to support MISRA C 2004 rule 10.6
    • +
    • Add new template driver to configure timebase using TIMER : +
        +
      • stm32f2xx_hal_timebase_tim_template.c
      • +
    • +
  • +
  • HAL CAN update +
      +
    • Update HAL_CAN_Transmit() and HAL_CAN_Transmit_IT() functions to unlock process when all Mailboxes are busy
    • +
  • +
  • HAL DCMI update +
      +
    • Rename DCMI_DMAConvCplt to DCMI_DMAXferCplt
    • +
    • Update HAL_DCMI_Start_DMA() function to Enable the DCMI peripheral
    • +
    • Add new timeout implementation based on cpu cycles for DCMI stop
    • +
    • Add HAL_DCMI_Suspend() function to suspend DCMI capture
    • +
    • Add HAL_DCMI_Resume() function to resume capture after DCMI suspend
    • +
    • Update lock mechanism for DCMI process
    • +
    • Update HAL_DCMI_IRQHandler() function to +
        +
      • Add error management in case DMA errors through XferAbortCallback() and HAL_DMA_Abort_IT()
      • +
      • Optimize code by using direct register read
      • +
    • +
  • +
  • HAL DMA update +
      +
    • Add new APIs HAL_DMA_RegisterCallback() and HAL_DMA_UnRegisterCallback to register/unregister the different callbacks identified by the enum typedef HAL_DMA_CallbackIDTypeDef
    • +
    • Add new API HAL_DMA_Abort_IT() to abort DMA transfer under interrupt context +
        +
      • The new registered Abort callback is called when DMA transfer abortion is completed
      • +
    • +
    • Add the check of compatibility between FIFO threshold level and size of the memory burst in the HAL_DMA_Init() API
    • +
    • Add new Error Codes: HAL_DMA_ERROR_PARAM, HAL_DMA_ERROR_NO_XFER and HAL_DMA_ERROR_NOT_SUPPORTED
    • +
    • Remove all DMA states related to MEM0/MEM1 in HAL_DMA_StateTypeDef
    • +
  • +
  • HAL ETH update +
      +
    • Removal of ETH MAC debug register defines
    • +
  • +
  • HAL HCD update +
      +
    • Update HCD_Port_IRQHandler() to unmask disconnect IT only when the port is disable
    • +
  • +
  • HAL I2C update +
      +
    • Add support of I2C repeated start feature: +
        +
      • With the following new API’s +
          +
        • HAL_I2C_Master_Sequential_Transmit_IT()
        • +
        • HAL_I2C_Master_Sequential_Receive_IT()
        • +
        • HAL_I2C_Master_Abort_IT()
        • +
        • HAL_I2C_Slave_Sequential_Transmit_IT()
        • +
        • HAL_I2C_Slave_Sequential_Receive_IT()
        • +
        • HAL_I2C_EnableListen_IT()
        • +
        • HAL_I2C_DisableListen_IT()
        • +
      • +
      • Add new user callbacks: +
          +
        • HAL_I2C_ListenCpltCallback()
        • +
        • HAL_I2C_AddrCallback()
        • +
      • +
    • +
    • Update to generate STOP condition when a acknowledge failure error is detected
    • +
    • Several update on HAL I2C driver to implement the new I2C state machine: +
        +
      • Add new API to get the I2C mode: HAL_I2C_GetMode()
      • +
      • Update I2C process to manage the new I2C states.
      • +
    • +
    • Fix wrong behaviour in single byte transmission
    • +
    • Update I2C_WaitOnFlagUntilTimeout() to manage the NACK feature.
    • +
    • Update I2C transmission process to support the case data size equal 0
    • +
    • Update Polling management: +
        +
      • The Timeout value must be estimated for the overall process duration: the Timeout measurement is cumulative
      • +
    • +
    • Add the management of Abort service: Abort DMA transfer through interrupt +
        +
      • In the case of Master Abort IT transfer usage: +
          +
        • Add new user HAL_I2C_AbortCpltCallback() to inform user of the end of abort process
        • +
        • A new abort state is defined in the HAL_I2C_StateTypeDef structure
        • +
      • +
    • +
    • Add the management of I2C peripheral errors, ACK failure and STOP condition detection during DMA process. This requires the following updates on user application: +
        +
      • Configure and enable the I2C IRQ in HAL_I2C_MspInit() function
      • +
      • In stm32f2xx_it.c file, I2C_IRQHandler() function: add a call to HAL_I2C_IRQHandler() function
      • +
      • Add and customize the Error Callback API: HAL_I2C_ErrorCallback()
      • +
    • +
    • NACK error during addressing phase is returned through interrupt instead of previously through I2C transfer API’s
    • +
    • I2C addressing phase is updated to be managed using interrupt instead of polling (Only for HAL I2C driver) +
        +
      • Add new static functions to manage I2C SB, ADDR and ADD10 flags
      • +
    • +
  • +
  • HAL IRDA update +
      +
    • Several update on HAL IRDA driver to implement the new UART state machine: +
        +
      • Add new field in IRDA_HandleTypeDef structure: “rxState”, IRDA state information related to Rx Operations
      • +
      • Rename “state” field in UART_HandleTypeDef structure by “gstate”: IRDA state information related to global Handle management and Tx Operations
      • +
      • Update IRDA process to manage the new UART states.
      • +
      • Update __HAL_IRDA_RESET_HANDLE_STATE() macro to handle the new IRDA state parameters (gState, rxState)
      • +
    • +
    • Removal of IRDA_TIMEOUT_VALUE define
    • +
    • Update IRDA_BRR() Macro to fix wrong baudrate calculation
    • +
    • Update Polling management: +
        +
      • The user Timeout value must be estimated for the overall process duration: the Timeout measurement is cumulative
      • +
    • +
    • Update DMA process: +
        +
      • Update the management of IRDA peripheral errors during DMA process. This requires the following updates in user application: +
          +
        • Configure and enable the IRDA IRQ in HAL_IRDA_MspInit() function
        • +
        • In stm32f2xx_it.c file, IRDA_IRQHandler() function: add a call to HAL_IRDA_IRQHandler() function
        • +
        • Add and customize the Error Callback API: HAL_IRDA_ErrorCallback()
        • +
      • +
    • +
  • +
  • HAL IWDG update +
      +
    • Overall rework of the driver for a more efficient implementation +
        +
      • Remove the following APIs: +
          +
        • HAL_IWDG_Start()
        • +
        • HAL_IWDG_MspInit()
        • +
        • HAL_IWDG_GetState()
        • +
      • +
      • Update implementation: +
          +
        • HAL_IWDG_Init(): this function insures the configuration and the start of the IWDG counter
        • +
        • HAL_IWDG_Refresh(): this function insures the reload of the IWDG counter
        • +
      • +
      • Refer to the following example to identify the changes: IWDG_Example
      • +
    • +
  • +
  • HAL NOR update +
      +
    • Update NOR_ADDR_SHIFT macro implementation
    • +
  • +
  • HAL PCD update +
      +
    • Update HAL_PCD_IRQHandler() to get HCLK frequency before setting TRDT value
    • +
  • +
  • HAL RCC update +
      +
    • Add new default define value for HSI calibration “RCC_HSICALIBRATION_DEFAULT”
    • +
    • Optimize Internal oscillators and PLL startup timeout
    • +
    • Update to avoid the disable for HSE/LSE oscillators before setting the new RCC HSE/LSE configuration and add the following notes in HAL_RCC_OscConfig() API description: +
        +
        • +
        • @note Transitions LSE Bypass to LSE On and LSE On to LSE Bypass are not
        • +
      • +
        • +
        • supported by this API. User should request a transition to LSE Off
        • +
      • +
        • +
        • first and then LSE On or LSE Bypass.
        • +
      • +
        • +
        • @note Transition HSE Bypass to HSE On and HSE On to HSE Bypass are not
        • +
      • +
        • +
        • supported by this API. User should request a transition to HSE Off
        • +
      • +
        • +
        • first and then HSE On or HSE Bypass.◦Optimize the HAL_RCC_ClockConfig() API implementation
        • +
      • +
    • +
    • Update HAL_RCC_ClockConfig() function to adjust the SystemCoreClock
    • +
    • HAL_RCCEx_PeriphCLKConfig() API: update to fix the RTC clock configuration issue
    • +
  • +
  • HAL RTC update +
      +
    • Add new timeout implementation based on cpu cycles for ALRAWF, ALRBWF and WUTWF flags
    • +
  • +
  • HAL SMARTCARD update +
      +
    • Several update on HAL SMARTCARD driver to implement the new UART state machine: +
        +
      • Add new field in SMARTCARD_HandleTypeDef structure: “rxState”, SMARTCARDstate information related to Rx Operations
      • +
      • Rename “state” field in UART_HandleTypeDef structure by “gstate”: SMARTCARDstate information related to global Handle management and Tx Operations
      • +
      • Update SMARTCARD process to manage the new UART states.
      • +
      • Update __HAL_SMARTCARD_RESET_HANDLE_STATE() macro to handle the new SMARTCARD state parameters (gState, rxState)
      • +
    • +
    • Update SMARTCARD_BRR() macro to fix wrong baudrate calculation
    • +
    • Update Polling management: +
        +
      • The user Timeout value must be estimated for the overall process duration: the Timeout measurement is cumulative
      • +
    • +
    • Update DMA process: +
        +
      • Update the management of SMARTCARD peripheral errors during DMA process. This requires the following updates in user application: +
          +
        • Configure and enable the SMARTCARD IRQ in HAL_SMARTCARD_MspInit() function
        • +
        • In stm32f2xx_it.c file, SMARTCARD_IRQHandler() function: add a call to HAL_SMARTCARD_IRQHandler() function
        • +
        • Add and customize the Error Callback API: HAL_SMARTCARD_ErrorCallback()
        • +
      • +
    • +
  • +
  • HAL SPI update +
      +
    • Major Update to improve performance in polling/interrupt mode to reach max frequency: +
        +
      • Polling mode: +
          +
        • Replace use of SPI_WaitOnFlagUnitTimeout() funnction by “if” statement to check on RXNE/TXE flage while transferring data
        • +
        • Use API data pointer instead of SPI handle data pointer
        • +
        • Use a Goto implementation instead of “if..else” statements
        • +
      • +
    • +
    • Interrupt mode: +
        +
      • Minimize access on SPI registers
      • +
      • Split the SPI modes into dedicated static functions to minimize checking statements under HAL_IRQHandler():
      • +
      • 1lines/2lines modes
      • +
      • 8 bit/ 16 bits data formats
      • +
      • CRC calculation enabled/disabled
      • +
      • Remove waiting loop under ISR when closing the communication
      • +
    • +
    • All modes +
        +
      • Adding switch USE_SPI_CRC to minimize number of statements when CRC calculation is disabled +
          +
        • Update Timeout management to check on global process
        • +
        • Update Error code management in all processes
        • +
        • Update DMA process:◾Add the management of SPI peripheral errors during DMA process. This requires the following updates in the user application:
        • +
        • Configure and enable the SPI IRQ in HAL_SPI_MspInit() function
        • +
        • In stm32f2xx_it.c file, SPI_IRQHandler() function: add a call to HAL_SPI_IRQHandler() function
        • +
        • Add and customize the Error Callback API: HAL_SPI_ErrorCallback()
        • +
        • Refer to the following example which describe the changes: SPI_FullDuplex_ComDMA
        • +
      • +
    • +
  • +
  • HAL UART update +
      +
    • Several update on HAL UART driver to implement the new UART state machine: +
        +
      • Add new field in UART_HandleTypeDef structure: “rxState”, UART state information related to Rx Operations
      • +
      • Rename “state” field in UART_HandleTypeDef structure by “gstate”: UART state information related to global Handle management and Tx Operations
      • +
      • Update UART process to manage the new UART states.
      • +
      • Update __HAL_UART_RESET_HANDLE_STATE() macro to handle the new UART state parameters (gState, rxState)
      • +
    • +
    • Update UART_BRR_SAMPLING16() and UART_BRR_SAMPLING8() Macros to fix wrong baudrate calculation.
    • +
    • Update Polling management: +
        +
      • The user Timeout value must be estimated for the overall process duration: the Timeout measurement is cumulative
      • +
    • +
    • Update DMA process: +
        +
      • Update the management of UART peripheral errors during DMA process. This requires the following updates in user application: +
          +
        • Configure and enable the UART IRQ in HAL_UART_MspInit() function
        • +
        • In stm32f2xx_it.c file, UART_IRQHandler() function: add a call to HAL_UART_IRQHandler() function
        • +
        • Add and customize the Error Callback API: HAL_UART_ErrorCallback()
        • +
      • +
    • +
  • +
  • HAL USART update +
      +
    • Update Polling management: +
        +
      • The user Timeout value must be estimated for the overall process duration: the Timeout measurement is cumulative
      • +
    • +
    • Update DMA process: +
        +
      • Update the management of USART peripheral errors during DMA process. This requires the following updates in user application: +
          +
        • Configure and enable the USART IRQ in HAL_USART_MspInit() function
        • +
        • In stm32f2xx_it.c file, USART_IRQHandler() function: add a call to HAL_USART_IRQHandler() function
        • +
        • Add and customize the Error Callback API: HAL_USART_ErrorCallback()
        • +
      • +
    • +
  • +
  • HAL WWDG update +
      +
    • Overall rework of the driver for more efficient implementation +
        +
      • Remove the following APIs: +
          +
        • HAL_WWDG_Start()
        • +
        • HAL_WWDG_Start_IT()
        • +
        • HAL_WWDG_MspDeInit()
        • +
        • HAL_WWDG_GetState()
        • +
      • +
      • Update implementation: +
          +
        • HAL_WWDG_Init()
        • +
        • A new parameter in the Init structure: EWIMode +
            +
          • HAL_WWDG_MspInit()
          • +
        • +
        • HAL_WWDG_Refresh() +
            +
          • This function insures the reload of the counter
          • +
          • The “counter” parameter has been removed
          • +
        • +
        • HAL_WWDG_IRQHandler()
        • +
        • HAL_WWDG_EarlyWakeupCallback() is the new prototype of HAL_WWDG_WakeUpCallback()
        • +
      • +
    • +
    • Refer to the following example to identify the changes: WWDG_Example
    • +
  • +
+
+
+
+ +
+

Main Changes

+
    +
  • HAL RCC update +
      +
    • Fix compilation errors with the __HAL_RCC_DAC_IS_CLK_DISABLED(), __HAL_RCC_CRYP_IS_CLK_DISABLED() and __HAL_RCC_HASH_IS_CLK_DISABLED() macros
    • +
  • +
  • HAL ETH update +
      +
    • Update HAL_ETH_Init() function to add timeout on the Software reset management
    • +
  • +
+
+
+
+ +
+

Main Changes

+
    +
  • General updates to fix known defects and enhancements implementation
  • +
  • One change done on the HAL CRYP requires an update on the application code based on HAL V1.1.0 +
      +
    • Update HAL_CRYP_DESECB_Decrypt() API to invert pPlainData and pCypherData parameters
    • +
  • +
  • HAL generic update +
      +
    • Update HAL weak empty callbacks to prevent unused argument compilation warnings with some compilers by calling the following line: +
        +
      • UNUSED(hppp);
      • +
    • +
    • HSE_STARTUP_TIMEOUT constant has been corrected in stm32f2xx_hal_conf_template.h file, its value changed from 5000 to 100.
    • +
  • +
  • HAL CORTEX update +
      +
    • Remove duplication for __HAL_CORTEX_SYSTICKCLK_CONFIG() macro
    • +
  • +
  • HAL HASH update +
      +
    • Rename HAL_HASH_STATETypeDef to HAL_HASH_StateTypeDef
    • +
    • Rename HAL_HASH_PhaseTypeDef to HAL_HASH_PhaseTypeDef
    • +
  • +
  • HAL RCC update +
      +
    • Add new macros __HAL_RCC_PPP_IS_CLK_ENABLED() to check on Clock enable/disable status
    • +
    • Update __HAL_RCC_USB_OTG_FS_CLK_DISABLE() macro to remove the disable for the SYSCFG
    • +
  • +
  • HAL FLASH update +
      +
    • __HAL_FLASH_INSTRUCTION_CACHE_RESET() macro: update to reset ICRST bit in the ACR register after setting it.
    • +
  • +
  • HAL CRYP update +
      +
    • Update HAL_CRYP_DESECB_Decrypt() API to fix the inverted pPlainData and pCypherData parameters issue
    • +
  • +
  • HAL TIM update +
      +
    • Update HAL_TIM_ConfigClockSource() API to check only the required parameters
    • +
  • +
  • HAL NAND update +
      +
    • Update HAL_NAND_Read_Page()/HAL_NAND_Write_Page()/HAL_NAND_Read_SpareArea() APIs to manage correctly the NAND Page access
    • +
  • +
  • HAL CAN update +
      +
    • Update to use “=” instead of “|=” to clear flags in the MSR, TSR, RF0R and RF1R registers
    • +
  • +
  • HAL PCD update +
      +
    • Fix typo in __HAL_USB_OTG_HS_WAKEUP_EXTI_ENABLE_RISING_FALLING_EDGE() macro implementation
    • +
  • +
  • LL FSMC update +
      +
    • Update the FSMC_NORSRAM_Extended_Timing_Init() API to remove the check on CLKDIvison and DataLatency parameters
    • +
  • +
+
+
+
+ +
+

Main Changes

+
    +
  • Maintenance release to fix known defects and enhancements implementation
  • +
  • Macros and literals renaming to ensure compatibles across STM32 series, backward compatibility maintained thanks to new added file stm32_hal_legacy.h under /Inc/Legacy
  • +
  • Add *.chm UM for all drivers
  • +
  • Update drivers to be C++ compliant
  • +
  • Several update on source code formatting, for better UM generation (i.e. Doxygen tags updated)
  • +
  • Four changes done on the HAL requires an update on the application code based on HAL V1.0.1 +
      +
    • LSI_VALUE constant has been corrected in stm32f2xx_hal_conf.h file, its value changed from 40 KHz to 32 KHz
    • +
    • UART, USART, IRDA and SMARTCARD (referenced as PPP here below) drivers: in DMA transmit process, the code has been updated to avoid waiting on TC flag under DMA ISR, PPP TC interrupt is used instead. Below the update to be done on user application: +
        +
      • Configure and enable the USART IRQ in HAL_PPP_MspInit() function
      • +
      • In stm32f2xx_it.c file, PPP_IRQHandler() function: add a call to HAL_PPP_IRQHandler() function
      • +
    • +
    • CRYP driver updated to support multi instance,so user must ensure that the new parameter Instance is initialized in his application(CRYPHandle.Instance = CRYP)
    • +
    • HASH IT process: update to call the HAL_HASH_InCpltCallback() at the end of the complete buffer instead of every each 512 bits
    • +
  • +
  • HAL generic update +
      +
    • stm32f2xx_hal_def.h +
        +
      • Remove NULL definition and add include for stdio.h
      • +
      • Add UNUSED() macro
      • +
      • Add a new define __NOINLINE to be used for the no inline code independent from tool chain
      • +
    • +
    • stm32f2xx_hal_conf_template.h +
        +
      • Add a new define for LSI default value LSI_VALUE
      • +
      • Add a new define for LSE default value LSE_VALUE
      • +
      • Add a new define for Tick interrupt priority TICK_INT_PRIORITY (needed for the enhanced time base implementation)
      • +
    • +
    • Enhance HAL delay and time base implementation +
        +
      • Systick timer is used by default as source of time base, but user can eventually implement his proper time base source (a general purpose timer for example or other time source)
      • +
      • Functions affecting time base configurations are declared as __Weak to make override possible in case of other implementations in user file, for more details please refer to HAL_TimeBase example
      • +
    • +
    • Fix flag clear procedure: use atomic write operation “=” instead of ready-modify-write operation “|=” or “&=”
    • +
    • Fix on Timeout management, Timeout value set to 0 passed to API automatically exits the function after checking the flag without any wait
    • +
    • Common update for the following communication peripherals: SPI, UART, USART and IRDA +
        +
      • Add DMA circular mode support
      • +
      • Remove lock from recursive process
      • +
    • +
    • Add new macro __HAL_RESET_HANDLE_STATE to reset a given handle state
    • +
    • Add a new attribute for functions executed from internal SRAM and depending from Compiler implementation
    • +
    • When USE_RTOS == 1 (in stm32f2xx_hal_conf.h), the __HAL_LOCK() is not defined instead of being defined empty
    • +
    • Miscellaneous comments and formatting update
    • +
    • Update all macros and literals naming to be upper case
    • +
    • ErrorCode parameter in PPP_HandleTypeDef structure updated to uint32_t instead of enum HAL_PPP_ErrorTypeDef
    • +
    • Remove the unused FLAG and IT assert macros
    • +
    • stm32f2xx_hal_ppp.c +
        +
      • HAL_PPP_Init(): update to force the HAL_PPP_STATE_RESET before calling the HAL_PPP_MspInit()
      • +
    • +
    • Important Note: aliases has been added for any API naming change, to keep compatibility with previous version
    • +
  • +
  • HAL ADC update +
      +
    • ADC HAL state machine update to use bit fields instead of enum: +
        +
      • HAL_ADC_StateTypeDef enum fields are replaced by respective defines
      • +
    • +
    • Add new literal: ADC_SOFTWARE_START to be used as possible value for the ExternalTrigConv parameter in the ADC_InitTypeDef structure to select the ADC software trigger mode.
    • +
    • IS_ADC_CHANNEL() macro update to don’t assert stop the ADC_CHANNEL_TEMPSENSOR value
    • +
    • HAL_ADC_PollForConversion(): update to manage particular case when ADC configured in DMA mode and ADC sequencer with several ranks and polling for end of each conversion
    • +
    • HAL_ADC_Start()/HAL_ADC_Start_IT() /HAL_ADC_Start_DMA() update: +
        +
      • unlock the process before starting the ADC software conversion.
      • +
      • Optimize the ADC stabilization delays
      • +
    • +
    • __HAL_ADC_GET_IT_SOURCE() update macro implementation
    • +
    • Add more details in ‘How to use this driver’ section
    • +
    • Add new literal: ADC_INJECTED_SOFTWARE_START to be used as possible value for the ExternalTrigInjecConvEdge parameter in the ADC_InitTypeDef structure to select the ADC software trigger mode.
    • +
  • +
  • HAL DAC update +
      +
    • Enhance the DMA channelconfiguration when used with DAC
    • +
    • HAL_DAC_ConfigChannel(): update the access to the DAC peripheral registers via the hdac handle instance
    • +
    • HAL_DAC_IRQHandler(): update to check on both DAC_FLAG_DMAUDR1 and DAC_FLAG_DMAUDR2
    • +
    • HAL_DACEx_NoiseWaveGenerate(): update to reset DAC CR register before setting the new DAC configuration
    • +
    • HAL_DACEx_TriangleWaveGenerate(): update to reset DAC CR register before setting the new DAC configuration
    • +
    • Add new macro to check if the specified DAC interrupt source is enabled or disabled +
        +
      • __HAL_DAC_GET_IT_SOURCE()
      • +
    • +
    • HAL_DACEx_TriangleWaveGeneration() update to use DAC CR bit mask definition
    • +
    • HAL_DACEx_NoiseWaveGeneration() update to use DAC CR bit mask definition
    • +
  • +
  • HAL CAN update +
      +
    • Unlock the CAN process when communication error occurred
    • +
    • CanTxMsgTypeDef structure: update to use uint8_t Data[8] instead of uint32_t Data[8]
    • +
    • CanRxMsgTypeDef structure: update to use uint8_t Data[8] instead of uint32_t Data[8]
    • +
  • +
  • HAL CORTEX update +
      +
    • Add new macro IS_NVIC_DEVICE_IRQ() to check on negative values of IRQn parameter
    • +
    • Add specific API for MPU management +
        +
      • add MPU_Region_InitTypeDef structure
      • +
      • add new function HAL_MPU_ConfigRegion()
      • +
    • +
  • +
  • HAL CRYP update +
      +
    • HAL_CRYP_DESECB_Decrypt_DMA(): fix the inverted pPlainData and pCypherData parameters issue
    • +
    • Add restriction for the CCM Encrypt/Decrypt API’s that only DataType equal to 8bits is supported
    • +
    • Update to manage multi instance: +
        +
      • Add new parameter Instance in the CRYP_HandleTypeDef Handle structure.
      • +
      • Add new parameter in all HAL CRYP macros +
          +
        • example: __HAL_CRYP_ENABLE() updated by __HAL_CRYP_ENABLE(HANDLE)
        • +
      • +
    • +
  • +
  • HAL DCMI update +
      +
    • HAL_DCMI_ConfigCROP(): Invert assert macros to check Y0 and Ysize parameters
    • +
  • +
  • HAL DMA update +
      +
    • Overall driver update for code optimization
    • +
    • add StreamBaseAddress and StreamIndex new fields in the DMA_HandleTypeDef structure
    • +
    • add DMA_Base_Registers private structure
    • +
    • add static function DMA_CalcBaseAndBitshift() +
        +
      • update HAL_DMA_Init() function to use the new added static function
      • +
      • update HAL_DMA_DeInit() function to optimize clear flag operations
      • +
      • update HAL_DMA_Start_IT() function to optimize interrupts enable
      • +
      • update HAL_DMA_PollForTransfer() function to optimize check on flags
      • +
      • update HAL_DMA_IRQHandler() function to optimize interrupt flag management
      • +
    • +
    • Fix in HAL_DMA_PollForTransfer() to: +
        +
      • set DMA error code in case of HAL_ERROR status
      • +
      • set HAL Unlock before DMA state update
      • +
    • +
    • HAL_DMA_Init(): Update to clear the DBM bit in the SxCR register before setting the new configuration
    • +
    • DMA_SetConfig(): add to clear the DBM bit in the SxCR register
    • +
  • +
  • HAL FLASH update +
      +
    • update HAL_FLASH_Program_IT() function by removing the pending flag clear
    • +
    • update HAL_FLASH_IRQHandler() function to improve erase operation procedure
    • +
    • update FLASH_WaitForLastOperation() function by checking on end of operation flag
    • +
    • Add “HAL_” prefix in the defined values for the FLASH error code
    • +
    • Example: FLASH_ERROR_PGP renamed by HAL_FLASH_ERROR_PGP
    • +
    • Clear the Flash ErrorCode in the FLASH_WaitForLastOperation() function
    • +
    • Update FLASH_SetErrorCode() function to use “|=” operant to update the Flash ErrorCode parameter in the FLASH handle
    • +
    • IS_FLASH_ADDRESS(): Update the macro check using ‘<=’ condition instead of ‘<’
    • +
    • IS_OPTIONBYTE(): Update the macro check using ‘<=’ condition instead of ‘<’
    • +
    • Add “FLASH_” prefix in the defined values of FLASH Type Program parameter
    • +
    • Example: TYPEPROGRAM_BYTE renamed by FLASH_TYPEPROGRAM_BYTE
    • +
    • Add “FLASH_” prefix in the defined values of FLASH Type Erase parameter
    • +
    • Example: TYPEERASE_SECTORS renamed by FLASH_TYPEERASE_SECTORS
    • +
    • Add “FLASH_” prefix in the defined values of FLASH Voltage Range parameter
    • +
    • Example: VOLTAGE_RANGE_1 renamed by FLASH_VOLTAGE_RANGE_1
    • +
    • Add “OB_” prefix in the defined values of FLASH WRP State parameter
    • +
    • Example: WRPSTATE_ENABLE renamed by OB_WRPSTATE_ENABLE
    • +
    • __HAL_FLASH_INSTRUCTION_CACHE_RESET() macro: update to reset ICRST bit in the ACR register after setting it.
    • +
    • __HAL_FLASH_DATA_CACHE_RESET() macro: update to reset DCRST bit in the ACR register after setting it.
    • +
    • FLASH_OB_GetRDP() API update to return uint8_t instead of FlagStatus
    • +
    • __HAL_FLASH_GET_LATENCY() new macro add to get the flash latency
    • +
  • +
  • HAL ETH update +
      +
    • Update HAL_ETH_GetReceivedFrame_IT() function to return HAL_ERROR if the received packet is not complete
    • +
    • Use HAL_Delay() instead of counting loop
    • +
    • __HAL_ETH_MAC_CLEAR_FLAG() macro is removed: the MACSR register is read only
    • +
    • Add the following macros used toWake up the device from STOP mode by Ethernet event : +
        +
      • __HAL_ETH_WAKEUP_EXTI_ENABLE_IT()
      • +
      • __HAL_ETH_WAKEUP_EXTI_DISABLE_IT()
      • +
      • __HAL_ETH_WAKEUP_EXTI_GET_FLAG()
      • +
      • __HAL_ETH_WAKEUP_EXTI_CLEAR_FLAG()
      • +
      • __HAL_ETH_WAKEUP_EXTI_ENABLE_RISING_EGDE_TRIGGER()
      • +
      • __HAL_ETH_WAKE_EXTI_ENABLE_FALLING_EGDE_TRIGGER()
      • +
      • __HAL_ETH_WAKE_EXTI_ENABLE_FALLINGRISING_TRIGGER()
      • +
    • +
    • Rename literals +
        +
      • ETH_PROMISCIOUSMODE_ENABLE by ETH_PROMISCUOUS_MODE_ENABLE
      • +
      • ETH_PROMISCIOUSMODE_DISABLE by ETH_PROMISCUOUS_MODE_DISABLE
      • +
    • +
    • Remove illegal space ETH_MAC_READCONTROLLER_FLUSHING macro
    • +
    • Update ETH_MAC_READCONTROLLER_XXX defined values (XXX can be IDLE, READING_DATA and READING_STATUS)
    • +
  • +
  • HAL PWR update +
      +
    • HAL_PWR_ConfigPVD(): add clear of the EXTI trigger before new configuration
    • +
    • Fix in HAL_PWR_EnterSTANDBYMode() to not clear Wakeup flag (WUF), which need to be cleared at application level before to call this function
    • +
    • HAL_PWR_EnterSLEEPMode() +
        +
      • Remove disable and enable of SysTick Timer
      • +
      • Update to clear SLEEPDEEP bit of Cortex System Control Register (SCB->SCR) before entering in sleep mode
      • +
      • Update usage of __WFE() in low power entry function: if there is a pending event, calling __WFE() will not enter the CortexM3 core to sleep mode. The solution is to made the call below; the first __WFE() is always ignored and clears the event if one was already pending, the second is always applied +
          +
        • __SEV()
        • +
        • __WFE()
        • +
        • __WFE()
        • +
      • +
    • +
    • Add new macro for software event generation __HAL_PWR_PVD_EXTI_GENERATE_SWIT()
    • +
    • Remove the following defines form Generic driver and add them under extension driver because they are only used within extension functions.
    • +
    • CR_FPDS_BB: used within HAL_PWREx_EnableFlashPowerDown() function
    • +
    • CSR_BRE_BB: used within HAL_PWREx_EnableBkUpReg() function
    • +
    • Add new API to manage SLEEPONEXIT and SEVONPEND bits of SCR register +
        +
      • HAL_PWR_DisableSleepOnExit()
      • +
      • HAL_PWR_EnableSleepOnExit()
      • +
      • HAL_PWR_EnableSEVOnPend()
      • +
      • HAL_PWR_DisableSEVOnPend()
      • +
    • +
    • HAL_PWR_EnterSLEEPMode() +
        +
      • Update to clear the CORTEX SLEEPDEEP bit of SCR register before entering in sleep mode
      • +
    • +
    • Add new PVD configuration modes +
        +
      • PWR_PVD_MODE_NORMAL
      • +
      • PWR_PVD_MODE_EVENT_RISING
      • +
      • PWR_PVD_MODE_EVENT_FALLING
      • +
      • PWR_PVD_MODE_EVENT_RISING_FALLING
      • +
    • +
    • Add new macros to manage PVD Trigger +
        +
      • __HAL_PWR_PVD_EXTI_ENABLE_RISING_EDGE()
      • +
      • __HAL_PWR_PVD_EXTI_DISABLE_RISING_EDGE(
      • +
      • __HAL_PWR_PVD_EXTI_ENABLE_FALLING_EDGE()
      • +
      • __HAL_PWR_PVD_EXTI_DISABLE_FALLING_EDGE()
      • +
      • __HAL_PWR_PVD_EXTI_ENABLE_RISING_FALLING_EDGE()
      • +
      • __HAL_PWR_PVD_EXTI_DISABLE_RISING_FALLING_EDGE()
      • +
    • +
    • PVD macros: +
        +
      • Remove the EXTILINE parameter
      • +
      • Update to use prefix "__HAL_PWR_PVD_" instead of prefix "__HAL_PVD"
      • +
    • +
    • Rename HAL_PWR_PVDConfig() function by HAL_PWR_ConfigPVD()
    • +
  • +
  • HAL GPIO update +
      +
    • Rename GPIO_SPEED_LOW define to GPIO_SPEED_FREQ_LOW
    • +
    • Rename GPIO_SPEED_MEDIUM define to GPIO_SPEED_FREQ_MEDIUM
    • +
    • Rename GPIO_SPEED_FAST define to GPIO_SPEED_FREQ_HIGH
    • +
    • Rename GPIO_SPEED_HIGH define to GPIO_SPEED_FREQ_VERY_HIGH
    • +
    • Add a new macro __HAL_GPIO_EXTI_GENERATE_SWIT() to manage the generation of software interrupton selected EXTI line
    • +
    • HAL_GPIO_Init(): use temporary variable when modifying the registers, to avoid unexpected transition in the GPIO pin configuration
    • +
    • Remove IS_GET_GPIO_PIN macro
    • +
    • Add a new function HAL_GPIO_LockPin()
    • +
    • Update the following HAL GPIO macros description: rename EXTI_Linex by GPIO_PIN_x +
        +
      • __HAL_GPIO_EXTI_CLEAR_IT()
      • +
      • __HAL_GPIO_EXTI_GET_IT()
      • +
      • __HAL_GPIO_EXTI_CLEAR_FLAG()
      • +
      • __HAL_GPIO_EXTI_GET_FLAG()
      • +
    • +
    • HAL_GPIO_Init()/HAL_GPIO_DeInit(): add a call to the CMSIS assert macro to check GPIO instance: IS_GPIO_ALL_INSTANCE()
    • +
    • Rename __HAL_GET_GPIO_SOURCE() by GPIO_GET_INDEX() and move this later to file stm32f2xx_hal_gpio_ex.h
    • +
    • HAL_GPIO_DeInit(): Update to check if GPIO Pin x is already used in EXTI mode on another GPIO Port before De-Initialize the EXTI registers
    • +
  • +
  • HAL HASH update +
      +
    • HAL_HASH_MD5_Start_IT(): fix input address management issue
    • +
    • HAL_HASH_MODE_Start_IT() (MODE stands for MD5 and SHA1) updates: +
        +
      • Fix processing fail for small input buffers
      • +
      • Update to unlock the process and call return HAL_OK at the end of HASH processing to avoid incorrectly repeating software
      • +
      • Update to properly manage the HashITCounter
      • +
      • Update to call the HAL_HASH_InCpltCallback() at the end of the complete buffer instead of every each 512 bits
      • +
    • +
    • __HAL_HASH_GET_FLAG() update to check the right register when the DINNE flag is selected
    • +
    • HAL_HASH_SHA1_Accumulate() updates: +
        +
      • Add a call to the new IS_HASH_SHA1_BUFFER_SIZE() macro to check the size parameter.
      • +
      • Add the following note in API description +
          +
          • +
          • @note Input buffer size in bytes must be a multiple of 4 otherwise the digest computation is corrupted.
          • +
        • +
      • +
    • +
  • +
  • HAL RCC update +
      +
    • HAL_RCCEx_PeriphCLKConfig() updates: +
        +
      • Update the LSE check condition after backup domain reset: update to check LSE ready flag when LSE oscillator is already enabled instead of check on LSE oscillator only when LSE is used as RTC clock source
      • +
    • +
    • In HAL_RCC_ClockConfig()function: update the AHB clock divider before clock switch to new source
    • +
    • Allow to calibrate the HSI when it is used as system clock source
    • +
    • Reorganize the RCC macros to make them more clear
    • +
    • Rename the following Macros +
        +
      • __PPP_CLK_ENABLE() by __HAL_RCC_PPP_CLK_ENABLE()
      • +
      • __PPP_CLK_DISABLE() by __HAL_RCC_PPP_CLK_DISABLE()
      • +
      • __PPP_FORCE_RESET() by __HAL_RCC_PPP_FORCE_RESET()
      • +
      • __PPP_RELEASE_RESET() by __HAL_RCC_PPP_RELEASE_RESET()
      • +
      • __PPP_CLK_SLEEP_ENABLE() by __HAL_RCC_PPP_CLK_SLEEP_ENABLE()
      • +
      • __PPP_CLK_SLEEP_DISABLE() by __HAL_RCC_PPP_CLK_SLEEP_DISABLE()
      • +
    • +
    • Add description of RCC known Limitations
    • +
    • HAL_RCC_OscConfig() fix issues: +
        +
      • Remove the disable of HSE oscillator when HSE_BYPASS is used as system clock source or as PPL clock source
      • +
      • Add a check on HSERDY flag when HSE_BYPASS is selected as new state for HSE oscillator.
      • +
    • +
    • Rename __HAL_RCC_I2SCLK() by __HAL_RCC_I2S_Config()
    • +
    • __HAL_RCC_PPP_CLK_ENABLE(): Implement workaround to cover RCC limitation regarding peripheral enable delay
    • +
    • HAL_RCC_OscConfig() fix issues: +
        +
      • Add a check on LSERDY flag when LSE_BYPASS is selected as new state for LSE oscillator.
      • +
    • +
    • __HAL_RCC_HSE_CONFIG() macro: add the comment below: +
        +
        • +
        • @note Transition HSE Bypass to HSE On and HSE On to HSE Bypass are not supported by this macro.
        • +
      • +
        • +
        • User should request a transition to HSE Off first and then HSE On or HSE Bypass.
        • +
      • +
    • +
    • __HAL_RCC_LSE_CONFIG() macro: add the comment below: +
        +
        • +
        • @note Transition LSE Bypass to LSE On and LSE On to LSE Bypass are not supported by this macro.
        • +
      • +
        • +
        • User should request a transition to LSE Off first and then LSE On or LSE Bypass.
        • +
      • +
    • +
    • Add the following new macros for PLL source and PLLM selection : +
        +
      • __HAL_RCC_PLL_PLLSOURCE_CONFIG()
      • +
      • __HAL_RCC_PLL_PLLM_CONFIG()
      • +
    • +
    • Add __HAL_RCC_SYSCLK_CONFIG() new macro to configure the system clock source (SYSCLK)
    • +
    • __HAL_RCC_GET_SYSCLK_SOURCE() updates:
    • +
    • Add new RCC Literals: +
        +
      • RCC_SYSCLKSOURCE_STATUS_HSI
      • +
      • RCC_SYSCLKSOURCE_STATUS_HSE
      • +
      • RCC_SYSCLKSOURCE_STATUS_PLLCLK
      • +
    • +
    • Update macro description to refer to the literals above
    • +
  • +
  • HAL I2S update +
      +
    • HAL_I2S_Init(): add check on I2S instance using CMSIS macro IS_I2S_ALL_INSTANCE()
    • +
    • HAL_I2S_IRQHandler() update for compliancy w/ C++
    • +
    • Add use of tmpreg variable in __HAL_I2S_CLEAR_OVRFLAG() and __HAL_I2S_CLEAR_UDRFLAG() macro for compliancy with C++
    • +
    • HAL_I2S_GetError(): update to return uint32_t instead of HAL_I2S_ErrorTypeDef enumeration
    • +
    • HAL_I2S_Transmit() API update to check on busy flag only for I2S slave mode
    • +
  • +
  • HAL I2C update +
      +
    • I2C Polling/IT/DMA processes: move the wait loop on busy flag at the top of the processes, to ensure that software not perform any write access to I2C_CR1 register before hardware clearing STOP bit and to avoid also the waiting loop on BUSY flag under I2C/DMA ISR.
    • +
    • Update busy flag Timeout value
    • +
    • I2C Master Receive Processes update to disable ACK before generate the STOP
    • +
    • Update to clear the POS bit in the CR1 register at the begging of all the HAL I2C processes
    • +
    • Add use of tmpreg variable in __HAL_I2C_CLEAR_ADDRFLAG() and __HAL_I2C_CLEAR_STOPFLAG() macro for compliancy with C++
    • +
  • +
  • HAL IrDA update +
      +
    • Add specific macros to manage the flags cleared only by a software sequence ◾__HAL_IRDA_CLEAR_PEFLAG() +
        +
      • __HAL_ IRDA _CLEAR_FEFLAG()
      • +
      • __HAL_ IRDA _CLEAR_NEFLAG()
      • +
      • __HAL_ IRDA _CLEAR_OREFLAG()
      • +
      • __HAL_ IRDA _CLEAR_IDLEFLAG()
      • +
    • +
    • Add several enhancements without affecting the driver functionalities +
        +
      • Remove the check on RXNE set after reading the Data in the DR register
      • +
      • Update HAL_IRDA_Transmit_IT() to enable IRDA_IT_TXE instead of IRDA_IT_TC
      • +
    • +
    • Add the following APIs used within DMA process ◾HAL_StatusTypeDef HAL_IRDA_DMAPause(IRDA_HandleTypeDef *hirda); +
        +
      • HAL_StatusTypeDef HAL_IRDA_DMAResume(IRDA_HandleTypeDef *hirda);
      • +
      • HAL_StatusTypeDef HAL_IRDA_DMAStop(IRDA_HandleTypeDef *hirda);
        +
      • +
      • void HAL_IRDA_TxHalfCpltCallback(IRDA_HandleTypeDef *hirda);
      • +
      • void HAL_IRDA_RxHalfCpltCallback(IRDA_HandleTypeDef *hirda);
      • +
    • +
    • DMA transmit process; the code has been updated to avoid waiting on TC flag under DMA ISR, IrDA TC interrupt is used instead. Below the update to be done on user application: +
        +
      • Configure and enable the USART IRQ in HAL_IRDA_MspInit() function
      • +
      • In stm32f2xx_it.c file, UASRTx_IRQHandler() function: add a call to HAL_IRDA_IRQHandler() function
      • +
    • +
    • IT transmit process; the code has been updated to avoid waiting on TC flag under IRDA ISR, IrDA TC interrupt is used instead. No impact on user application
    • +
    • Rename Macros: add prefix "__HAL" +
        +
      • __IRDA_ENABLE() by __HAL_IRDA_ENABLE()
      • +
      • __IRDA_DISABLE() by __HAL_IRDA_DISABLE()
      • +
    • +
    • Add new user macros to manage the sample method feature +
        +
      • __HAL_IRDA_ONE_BIT_SAMPLE_ENABLE()
      • +
      • __HAL_IRDA_ONE_BIT_SAMPLE_DISABLE()
      • +
    • +
    • HAL_IRDA_Transmit_IT(): update to remove the enable of the parity error interrupt
    • +
    • Add use of tmpreg variable in __HAL_IRDA_CLEAR_PEFLAG() macro for compliancy with C++
    • +
    • HAL_IRDA_Transmit_DMA() update to follow the right procedure “Transmission using DMA” in the reference manual +
        +
      • Add clear the TC flag in the SR register before enabling the DMA transmit request
      • +
    • +
  • +
  • HAL SPI update +
      +
    • SPI interface is used in synchronous polling mode: at high clock rates like SPI prescaler 2 and 4, calling
    • +
    • AL_SPI_TransmitReceive() returns with error HAL_TIMEOUT
    • +
    • HAL_SPI_TransmitReceive_DMA() does not clean up the TX DMA, so any subsequent SPI calls return the DMA error
    • +
    • HAL_SPI_Transmit_DMA() is failing when data size is equal to 1 byte
    • +
    • Add the following APIs used within the DMA process +
        +
      • HAL_StatusTypeDef HAL_SPI_DMAPause(SPI_HandleTypeDef *hspi);
      • +
      • HAL_StatusTypeDef HAL_SPI_DMAResume(SPI_HandleTypeDef *hspi);
      • +
      • HAL_StatusTypeDef HAL_SPI_DMAStop(SPI_HandleTypeDef *hspi);
      • +
      • void HAL_SPI_TxHalfCpltCallback(SPI_HandleTypeDef *hspi);
      • +
      • void HAL_SPI_RxHalfCpltCallback(SPI_HandleTypeDef *hspi);
      • +
      • void HAL_SPI_TxRxHalfCpltCallback(SPI_HandleTypeDef *hspi);
      • +
    • +
    • HAL_SPI_TransmitReceive_DMA() update to remove the DMA Tx Error Callback initialization when SPI RxOnly mode is selected
    • +
    • Add use of UNUSED(tmpreg) in __HAL_SPI_CLEAR_MODFFLAG(), __HAL_SPI_CLEAR_OVRFLAG(), __HAL_SPI_CLEAR_FREFLAG() to fix “Unused variable” warning with TrueSTUDIO.
    • +
    • Rename Literals: remove “D” from “DISABLED” and “ENABLED” +
        +
      • SPI_TIMODE_DISABLED by SPI_TIMODE_DISABLE
      • +
      • SPI_TIMODE_ENABLED by SPI_TIMODE_ENABLE
      • +
      • SPI_CRCCALCULATION_DISABLED by SPI_CRCCALCULATION_DISABLE
      • +
      • SPI_CRCCALCULATION_ENABLED by SPI_CRCCALCULATION_ENABLE
      • +
    • +
    • Add use of tmpreg variable in __HAL_SPI_CLEAR_MODFFLAG(), __HAL_SPI_CLEAR_FREFLAG() and __HAL_SPI_CLEAR_OVRFLAG() macros for compliancy with C++
    • +
    • HAL_SPI_Transmit_DMA()/HAL_SPI_Receive_DMA()/HAL_SPI_TransmitReceive_DMA() update to unlock the process before enabling the SPI peripheral
    • +
    • HAL_SPI_Transmit_DMA() update to manage correctly the DMA TX stream in SPI Full duplex mode
    • +
    • Section SPI_Exported_Functions_Group2 update to remove duplication in *.chm UM
    • +
    • Fix the wrong definition of HAL_SPI_ERROR_FLAG literal
    • +
  • +
  • HAL CRC update +
      +
    • These macros are added to read/write the CRC IDR register: __HAL_CRC_SET_IDR() and __HAL_CRC_GET_IDR()
    • +
  • +
  • __HAL_CRC_SET_IDR() macro implementation change to use WRITE_REG() instead of MODIFY_REG()
  • +
  • HAL LL SDMMC update +
      +
    • Use of CMSIS constants instead of magic values
    • +
    • Miscellaneous update in functions internal coding
    • +
    • IS_SDIO_ALL_INSTANCE() macro moved to CMSIS files
    • +
  • +
  • HAL NAND update +
      +
    • Fix issue of macros returning wrong address for NAND blocks
    • +
    • Fix issue for read/write NAND page/spare area
    • +
    • Rename NAND Address structure to NAND_AddressTypeDef instead of NAND_AddressTypedef
    • +
    • Update the used algorithm of these functions +
        +
      • HAL_NAND_Read_Page()
      • +
      • HAL_NAND_Write_Page()
      • +
      • HAL_NAND_Read_SpareArea()
      • +
      • HAL_NAND_Write_SpareArea()
      • +
    • +
    • HAL_NAND_Write_Page(): move initialization of tickstart before while loop
    • +
    • HAL_NAND_Erase_Block(): add whait until NAND status is ready before exiting this function
    • +
  • +
  • HAL NOR update +
      +
    • Add the NOR addressbank macro used within the API
    • +
    • Update NOR APIimplementation to avoid the use of NOR address bank hard coded
    • +
    • NOR Status literals renamed +
        +
      • NOR_SUCCESS by HAL_NOR_STATUS_SUCCESS
      • +
      • NOR_ONGOING by HAL_NOR_STATUS_ONGOING
      • +
      • NOR_ERROR by HAL_NOR_STATUS_ERROR
      • +
      • NOR_TIMEOUT by HAL_NOR_STATUS_TIMEOUT
      • +
    • +
    • HAL_NOR_GetStatus() update to fix Timeout issue and exit from waiting loop when timeout occurred
    • +
  • +
  • HAL PCCARD update
  • +
  • Rename PCCARD Address structure to HAL_PCCARD_StatusTypeDef instead of CF_StatusTypedef
  • +
  • PCCARD Status literals renamed +
      +
    • CF_SUCCESS by HAL_PCCARD_STATUS_SUCCESS
    • +
    • CF_ONGOING by HAL_PCCARD_STATUS_ONGOING
    • +
    • CF_ERROR by HAL_PCCARD_STATUS_ERROR
    • +
    • CF_TIMEOUT by HAL_PCCARD_STATUS_TIMEOUT
    • +
  • +
  • Update “CF” by “PCCARD” in functions, literals and macros
  • +
  • HAL HCD update +
      +
    • HCD_StateTypeDef structure members renamed
    • +
    • These macro are renamed +
        +
      • __HAL_GET_FLAG(HANDLE, INTERRUPT) by __HAL_HCD_GET_FLAG(HANDLE, INTERRUPT)
      • +
      • __HAL_IS_INVALID_INTERRUPT(HANDLE) by __HAL_HCD_IS_INVALID_INTERRUPT(HANDLE)
      • +
    • +
    • Update to use local variable in USB Host channel re-activation
    • +
  • +
  • HAL PCD update +
      +
    • HAL_PCD_SetTxFiFo() and HAL_PCD_SetRxFiFo() renamed into HAL_PCDEx_SetTxFiFo() and HAL_PCDEx_SetRxFiFo() and moved to the extension files stm32f2xx_hal_pcd_ex.h/.c
    • +
    • PCD_StateTypeDef structure members renamed
    • +
    • Fix incorrect masking of TxFIFOEmpty
    • +
    • stm32f2xx_ll_usb.c: fix issue in HS mode
    • +
    • New macros added +
        +
      • __HAL_PCD_IS_PHY_SUSPENDED()
      • +
      • __HAL_USB_HS_EXTI_GENERATE_SWIT()
      • +
      • __HAL_USB_FS_EXTI_GENERATE_SWIT()
      • +
    • +
    • These macro are renamed +
        +
      • __HAL_GET_FLAG(HANDLE, INTERRUPT) by __HAL_PCD_GET_FLAG(HANDLE, INTERRUPT)
      • +
      • __HAL_CLEAR_FLAG(HANDLE, INTERRUPT) by __HAL_PCD_CLEAR_FLAG(HANDLE, INTERRUPT)
        +
      • +
      • __HAL_IS_INVALID_INTERRUPT(HANDLE) by __HAL_PCD_IS_INVALID_INTERRUPT(HANDLE)
        +
      • +
      • __HAL_PCD_UNGATE_CLOCK(HANDLE) by __HAL_PCD_UNGATE_PHYCLOCK(HANDLE)
      • +
      • __HAL_PCD_GATE_CLOCK(HANDLE) by __HAL_PCD_GATE_PHYCLOCK(HANDLE)
      • +
    • +
    • Rename functions +
        +
      • HAL_PCD_ActiveRemoteWakeup() by HAL_PCD_ActivateRemoteWakeup()
      • +
      • HAL_PCD_DeActiveRemoteWakeup() by HAL_PCD_DeActivateRemoteWakeup()
      • +
    • +
    • Rename literals +
        +
      • USB_FS_EXTI_TRIGGER_RISING_EDGE by USB_OTG_FS_WAKEUP_EXTI_RISING_EDGE
      • +
      • USB_FS_EXTI_TRIGGER_FALLING_EDGE by USB_OTG_FS_WAKEUP_EXTI_FALLING_EDGE
      • +
      • USB_FS_EXTI_TRIGGER_BOTH_EDGE() by USB_OTG_FS_WAKEUP_EXTI_RISING_FALLING_EDGE
      • +
      • USB_HS_EXTI_TRIGGER_RISING_EDGE by USB_OTG_HS_WAKEUP_EXTI_RISING_EDGE
      • +
      • USB_HS_EXTI_TRIGGER_FALLING_EDGE by USB_OTG_HS_WAKEUP_EXTI_FALLING_EDGE
      • +
      • USB_HS_EXTI_TRIGGER_BOTH_EDGE by USB_OTG_HS_WAKEUP_EXTI_RISING_FALLING_EDGE
      • +
      • USB_HS_EXTI_LINE_WAKEUP by USB_OTG_HS_WAKEUP_EXTI_LINE
      • +
      • USB_FS_EXTI_LINE_WAKEUP by USB_OTG_FS_WAKEUP_EXTI_LINE
      • +
    • +
    • Rename USB EXTI macros (FS, HS referenced as SUBBLOCK here below) +
        +
      • __HAL_USB_SUBBLOCK_EXTI_ENABLE_IT() by __HAL_USB_OTG_SUBBLOCK_WAKEUP_EXTI_ENABLE_IT()
        +
      • +
      • __HAL_USB_SUBBLOCK_EXTI_DISABLE_IT() by __HAL_USB_OTG_SUBBLOCK_WAKEUP_EXTI_DISABLE_IT()
      • +
      • __HAL_USB_SUBBLOCK_EXTI_GET_FLAG() by __HAL_USB_OTG_SUBBLOCK_WAKEUP_EXTI_GET_FLAG()
      • +
      • __HAL_USB_SUBBLOCK_EXTI_CLEAR_FLAG() by __HAL_USB_OTG_SUBBLOCK_WAKEUP_EXTI_CLEAR_FLAG()
      • +
      • __HAL_USB_SUBBLOCK_EXTI_SET_RISING_EGDE_TRIGGER() by __HAL_USB_OTG_SUBBLOCK_WAKEUP_EXTI_ENABLE_RISING_EDGE()
      • +
      • __HAL_USB_SUBBLOCK_EXTI_SET_FALLING_EGDE_TRIGGER() by __HAL_USB_OTG_SUBBLOCK_WAKEUP_EXTI_ENABLE_FALLING_EDGE()
      • +
      • __HAL_USB_SUBBLOCK_EXTI_SET_FALLINGRISING_TRIGGER() by __HAL_USB_OTG_SUBBLOCK_WAKEUP_EXTI_ENABLE_RISING_FALLING_EDGE()
      • +
      • __HAL_USB_SUBBLOCK_EXTI_GENERATE_SWIT() by __HAL_USB_OTG_SUBBLOCK_WAKEUP_EXTI_GENERATE_SWIT()
      • +
    • +
    • HAL_PCD_IRQHandler API: fix the bad Configuration of Turnaround Time
    • +
  • +
  • HAL RNG update +
      +
    • Add new functions +
        +
      • HAL_RNG_GenerateRandomNumber(): to generate a 32-bits random number, return random value in argument and return HAL status.
      • +
      • HAL_RNG_GenerateRandomNumber_IT(): to start generation of the 32-bits random number, user should call the HAL_RNG_ReadLastRandomNumber() function under the HAL_RNG_ReadyCallback() to get the generated random value.
      • +
      • HAL_RNG_ReadLastRandomNumber(): to return the last random value stored in the RNG handle
      • +
    • +
    • HAL_RNG_GetRandomNumber(): return value update (obsolete), replaced by HAL_RNG_GenerateRandomNumber()
    • +
    • HAL_RNG_GetRandomNumber_IT(): wrong implementation (obsolete), replaced by HAL_RNG_GenerateRandomNumber_IT()
    • +
    • __HAL_RNG_CLEAR_FLAG() macro (obsolete), replaced by new __HAL_RNG_CLEAR_IT() macro
    • +
    • Add new define for RNG ready interrupt: RNG_IT_DRDY
    • +
  • +
  • HAL RTC update +
      +
    • Update HAL_RTCEx_SetWakeUpTimer() and HAL_RTCEx_SetWakeUpTimer_IT() functions to properly check on the WUTWF flag
    • +
    • HAL_RTC_GetTime() and HAL_RTC_GetDate(): add the comment below
    • +
      • +
      • @note You must call HAL_RTC_GetDate() after HAL_RTC_GetTime() to unlock the values
      • +
    • +
      • +
      • in the higher-order calendar shadow registers to ensure consistency between the time and date values.
      • +
    • +
      • +
      • Reading RTC current time locks the values in calendar shadow registers until Current date is read.
      • +
    • +
    • Rename literals: add prefix "__HAL" +
        +
      • FORMAT_BIN by RTC_FORMAT_BIN
      • +
      • FORMAT_BCD by RTC_FORMAT_BCD
      • +
    • +
    • Rename macros (ALARM, WAKEUPTIMER and TIMESTAMP referenced as SUBBLOCK here below) +
        +
      • __HAL_RTC_EXTI_ENABLE_IT() by __HAL_RTC_SUBBLOCK_EXTI_ENABLE_IT()
      • +
      • __HAL_RTC_EXTI_DISABLE_IT() by __HAL_RTC_SUBBLOCK_EXTI_DISABLE_IT()
      • +
      • __HAL_RTC_EXTI_CLEAR_FLAG() by __HAL_RTC_SUBBLOCK_EXTI_CLEAR_FLAG()
      • +
      • __HAL_RTC_EXTI_GENERATE_SWIT() by __HAL_RTC_SUBBLOCK_EXTI_GENERATE_SWIT()
      • +
    • +
    • Add new macros (ALARM, WAKEUPTIMER and TAMPER_TIMESTAMP referenced as SUBBLOCK here below) +
        +
      • __HAL_RTC_SUBBLOCK_GET_IT_SOURCE()
      • +
      • __HAL_RTC_SUBBLOCK_EXTI_ENABLE_EVENT()
      • +
      • __HAL_RTC_SUBBLOCK_EXTI_DISABLE_EVENT()
      • +
      • __HAL_RTC_SUBBLOCK_EXTI_ENABLE_FALLING_EDGE()
      • +
      • __HAL_RTC_SUBBLOCK_EXTI_DISABLE_FALLING_EDGE()
      • +
      • __HAL_RTC_SUBBLOCK_EXTI_ENABLE_RISING_EDGE()
      • +
      • __HAL_RTC_SUBBLOCK_EXTI_DISABLE_RISING_EDGE()
      • +
      • __HAL_RTC_SUBBLOCK_EXTI_ENABLE_RISING_FALLING_EDGE()
      • +
      • __HAL_RTC_SUBBLOCK_EXTI_DISABLE_RISING_FALLING_EDGE()
      • +
      • __HAL_RTC_SUBBLOCK_EXTI_GET_FLAG()
      • +
    • +
    • Update to use CMSIS mask definition instead of hardcoded values (EXTI_IMR_IM17, EXTI_IMR_IM19..)
    • +
    • __HAL_RTC_TAMPER_TIMESTAMP_EXTI_GET_FLAG() macro: fix implementation issue
    • +
    • __HAL_RTC_ALARM_GET_IT(), __HAL_RTC_ALARM_CLEAR_FLAG(), __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(), __HAL_RTC_TIMESTAMP_CLEAR_FLAG() and __HAL_RTC_TAMPER_CLEAR_FLAG() macros implementation changed: remove unused cast
    • +
    • IS_RTC_TAMPER() macro: update to use literal instead of hardcoded value
    • +
    • Update to define hardware independent literals names: +
        +
      • Rename RTC_TAMPERPIN_PC13 by RTC_TAMPERPIN_DEFAULT
      • +
      • Rename RTC_TAMPERPIN_PA0 by RTC_TAMPERPIN_POS1
      • +
      • Rename RTC_TAMPERPIN_PI8 by RTC_TAMPERPIN_POS1
      • +
      • Rename RTC_TIMESTAMPPIN_PC13 by RTC_TIMESTAMPPIN_DEFAULT
      • +
      • Rename RTC_TIMESTAMPPIN_PA0 by RTC_TIMESTAMPPIN_POS1
      • +
      • Rename RTC_TIMESTAMPPIN_PI8 by RTC_TIMESTAMPPIN_POS1
      • +
    • +
  • +
  • HAL SD update +
      +
    • Rename SD_CMD_SD_APP_STAUS by SD_CMD_SD_APP_STATUS
    • +
    • SD_PowerON() updated to add 1ms required power up waiting time before starting the SD initialization sequence
    • +
    • SD_DMA_RxCplt()/SD_DMA_TxCplt(): add a call to HAL_DMA_Abort()
    • +
    • HAL_SD_ReadBlocks() update to set the defined DATA_BLOCK_SIZE as SDIO DataBlockSize parameter
    • +
    • HAL_SD_ReadBlocks_DMA()/HAL_SD_WriteBlocks_DMA() update to call the HAL_DMA_Start_IT() function withDMA Datalength set to BlockSize/4 as the DMA is configured in word
    • +
  • +
  • HAL SMARTCARD update +
      +
    • Add specific macros to manage the flags cleared only by a software sequence ◾__HAL_SMARTCARD_CLEAR_PEFLAG() +
        +
      • __HAL_SMARTCARD_CLEAR_FEFLAG()
      • +
      • __HAL_SMARTCARD_CLEAR_NEFLAG()
      • +
      • __HAL_SMARTCARD_CLEAR_OREFLAG()
      • +
      • __HAL_SMARTCARD_CLEAR_IDLEFLAG()
      • +
    • +
    • Add several enhancements without affecting the driver functionalities +
        +
      • Add a new state HAL_SMARTCARD_STATE_BUSY_TX_RX and all processes has been updated accordingly
      • +
      • Update HAL_SMARTCARD_Transmit_IT() to enable SMARTCARD_IT_TXE instead of SMARTCARD_IT_TC
      • +
    • +
    • DMA transmit process; the code has been updated to avoid waiting on TC flag under DMA ISR, SMARTCARD TC interrupt is used instead. Below the update to be done on user application: +
        +
      • Configure and enable the USART IRQ in HAL_SAMRTCARD_MspInit() function
      • +
      • In stm32f2xx_it.c file, UASRTx_IRQHandler() function: add a call to HAL_SMARTCARD_IRQHandler() function
      • +
    • +
    • IT transmit process; the code has been updated to avoid waiting on TC flag under SMARTCARD ISR, SMARTCARD TC interrupt is used instead. No impact on user application
    • +
    • Rename macros: add prefix "__HAL" +
        +
      • __SMARTCARD_ENABLE() by __HAL_SMARTCARD_ENABLE()
      • +
      • __SMARTCARD_DISABLE() by __HAL_SMARTCARD_DISABLE()
      • +
      • __SMARTCARD_ENABLE_IT() by __HAL_SMARTCARD_ENABLE_IT()
      • +
      • __SMARTCARD_DISABLE_IT() by __HAL_SMARTCARD_DISABLE_IT()
      • +
      • __SMARTCARD_DMA_REQUEST_ENABLE() by __HAL_SMARTCARD_DMA_REQUEST_ENABLE()
      • +
      • __SMARTCARD_DMA_REQUEST_DISABLE() by __HAL_SMARTCARD_DMA_REQUEST_DISABLE()
      • +
    • +
    • Rename literals: remove “D” from “DISABLED” and “ENABLED” +
        +
      • SMARTCARD_NACK_ENABLED by SMARTCARD_NACK_ENABLE
      • +
      • SMARTCARD_NACK_DISABLED by SMARTCARD_NACK_DISABLE
      • +
    • +
    • Add new user macros to manage the sample method feature +
        +
      • __HAL_SMARTCARD_ONE_BIT_SAMPLE_ENABLE()
      • +
      • __HAL_SMARTCARD_ONE_BIT_SAMPLE_DISABLE()
      • +
    • +
    • Add use of tmpreg variable in __HAL_SMARTCARD_CLEAR_PEFLAG() macro for compliancy with C++
    • +
    • HAL_SMARTCARD_Transmit_DMA() update to follow the right procedure “Transmission using DMA” in the reference manual +
        +
      • Add clear the TC flag in the SR register before enabling the DMA transmit request
      • +
      • HAL_SMARTCARD_Transmit_IT() update to force the disable for the ERR interrupt to avoid the OVR interrupt
      • +
      • HAL_SMARTCARD_IRQHandler() update check condition for transmission end
      • +
      • Clean up: remove the following literals that aren’t used in smartcard mode +
          +
        • SMARTCARD_PARITY_NONE
        • +
        • SMARTCARD_WORDLENGTH_8B
        • +
        • SMARTCARD_STOPBITS_1
        • +
        • SMARTCADR_STOPBITS_2
        • +
      • +
    • +
  • +
  • HAL TIM update +
      +
    • HAL_TIM_IRQHandler(): update to check the input capture channel 3 and 4 in CCMR2 instead of CCMR1
    • +
    • __HAL_TIM_SET_PRESCALER() updated to use ‘=’ instead of ‘|=’
    • +
    • Add thefollowing macro in TIM HAL driver
    • +
    • __HAL_TIM_GET_COMPARE()
    • +
    • __HAL_TIM_GET_COUNTER()
    • +
    • __HAL_TIM_GET_AUTORELOAD()
    • +
    • __HAL_TIM_GET_CLOCKDIVISION()
    • +
    • __HAL_TIM_GET_ICPRESCALER()
    • +
    • Add TIM_CHANNEL_ALL as possible value for all Encoder Start/Stop APIs Description
    • +
    • HAL_TIM_OC_ConfigChannel() remove call to IS_TIM_FAST_STATE() assert macro
    • +
    • HAL_TIM_PWM_ConfigChannel() add a call to IS_TIM_FAST_STATE() assert macro to check the OCFastMode parameter
    • +
    • TIM_DMADelayPulseCplt() Update to set the TIM Channel before to call HAL_TIM_PWM_PulseFinishedCallback()
    • +
    • TIM_DMACaptureCplt() update to set the TIM Channel before to call HAL_TIM_IC_CaptureCallback()
    • +
    • HAL_TIM_IC_ConfigChannel() update to fix Timer CCMR1 register corruption when setting ICFilter parameter
    • +
    • HAL_TIM_DMABurst_WriteStop()/HAL_TIM_DMABurst_ReadStop() update to abort the DMA transfer for the specific TIM channel
    • +
    • Add new function for TIM Slave configuration in IT mode: HAL_TIM_SlaveConfigSynchronization_IT()
    • +
    • HAL_TIMEx_ConfigBreakDeadTime() add an assert check on Break & DeadTime parameters values
    • +
    • HAL_TIMEx_OCN_Start_IT() add the enable of Break Interrupt for all output modes
    • +
    • Add new macros to ENABLE/DISABLE URS bit in TIM CR1 register: +
        +
      • __HAL_TIM_URS_ENABLE()
      • +
      • __HAL_TIM_URS_DISABLE()
      • +
    • +
    • Add new macro for TIM Edge modification: __HAL_TIM_SET_CAPTUREPOLARITY()
    • +
  • +
  • HAL UART update +
      +
    • Add new macros to control CTS and RTS
    • +
    • Add specific macros to manage the flags cleared only by a software sequence ◾__HAL_UART_CLEAR_PEFLAG() +
        +
      • __HAL_UART_CLEAR_FEFLAG()
      • +
      • __HAL_UART_CLEAR_NEFLAG()
      • +
      • __HAL_UART_CLEAR_OREFLAG()
      • +
      • __HAL_UART_CLEAR_IDLEFLAG()
      • +
    • +
    • Remove the check on RXNE set after reading the Data in the DR register
    • +
    • Add IS_UART_LIN_WORD_LENGTH() and IS_UART_LIN_OVERSAMPLING() macros: to check respectively WordLength and OverSampling parameters in LIN mode
    • +
    • DMA transmit process; the code has been updated to avoid waiting on TC flag under DMA ISR, UART TC interrupt is used instead. Below the update to be done on user application: +
        +
      • Configure and enable the USART IRQ in HAL_UART_MspInit() function
      • +
      • In stm32f2xx_it.c file, USARTx_IRQHandler() function: add a call to HAL_UART_IRQHandler() function
      • +
    • +
    • IT transmit process; the code has been updated to avoid waiting on TC flag under UART ISR, UART TC interrupt is used instead. No impact on user application
    • +
    • Rename macros: +
        +
      • __HAL_UART_ONEBIT_ENABLE() by __HAL_UART_ONE_BIT_SAMPLE_ENABLE()
      • +
      • __HAL_UART_ONEBIT_DISABLE() by __HAL_UART_ONE_BIT_SAMPLE_DISABLE()
      • +
    • +
    • Rename literals: +
        +
      • UART_WAKEUPMETHODE_IDLELINE by UART_WAKEUPMETHOD_IDLELINE
      • +
      • UART_WAKEUPMETHODE_ADDRESSMARK by UART_WAKEUPMETHOD_ADDRESSMARK
      • +
    • +
    • Add use of tmpreg variable in __HAL_UART_CLEAR_PEFLAG() macro for compliancy with C++
    • +
    • HAL_UART_Transmit_DMA() update to follow the right procedure “Transmission using DMA” in the reference manual +
        +
      • Add clear the TC flag in the SR register before enabling the DMA transmit request
      • +
    • +
  • +
  • HAL USART update +
      +
    • Add specific macros to manage the flags cleared only by a software sequence ◾__HAL_USART_CLEAR_PEFLAG() +
        +
      • __HAL_USART_CLEAR_FEFLAG()
      • +
      • __HAL_USART_CLEAR_NEFLAG()
      • +
      • __HAL_USART_CLEAR_OREFLAG()
      • +
      • __HAL_USART_CLEAR_IDLEFLAG()
      • +
    • +
    • Update HAL_USART_Transmit_IT() to enable USART_IT_TXE instead of USART_IT_TC
    • +
    • DMA transmit process; the code has been updated to avoid waiting on TC flag under DMA ISR, USART TC interrupt is used instead. Below the update to be done on user application: +
        +
      • Configure and enable the USART IRQ in HAL_USART_MspInit() function
      • +
      • In stm32f2xx_it.c file, USARTx_IRQHandler() function: add a call to HAL_USART_IRQHandler() function
      • +
    • +
    • IT transmit process; the code has been updated to avoid waiting on TC flag under USART ISR, USART TC interrupt is used instead. No impact on user application
    • +
    • HAL_USART_Init() update to enable the USART oversampling by 8 by default in order to reach max USART frequencies
    • +
    • USART_DMAReceiveCplt() update to set the new USART state after checking on the old state
    • +
    • HAL_USART_Transmit_DMA()/HAL_USART_TransmitReceive_DMA() update to follow the right procedure “Transmission using DMA” in the reference manual +
        +
      • Add clear the TC flag in the SR register before enabling the DMA transmit request
      • +
    • +
    • Rename macros: +
        +
      • __USART_ENABLE() by __HAL_USART_ENABLE()
      • +
      • __USART_DISABLE() by __HAL_USART_DISABLE()
      • +
      • __USART_ENABLE_IT() by __HAL_USART_ENABLE_IT()
      • +
      • __USART_DISABLE_IT() by __HAL_USART_DISABLE_IT()
      • +
    • +
    • Rename literals: remove “D” from “DISABLED” and “ENABLED” +
        +
      • USART_CLOCK_DISABLED by USART_CLOCK_DISABLE
      • +
      • USART_CLOCK_ENABLED by USART_CLOCK_ENABLE
      • +
      • USARTNACK_ENABLED by USART_NACK_ENABLE
      • +
      • USARTNACK_DISABLED by USART_NACK_DISABLE
      • +
    • +
    • Add new user macros to manage the sample method feature +
        +
      • __HAL_USART_ONE_BIT_SAMPLE_ENABLE()
      • +
      • __HAL_USART_ONE_BIT_SAMPLE_DISABLE()
      • +
    • +
    • Add use of tmpreg variable in __HAL_USART_CLEAR_PEFLAG() macro for compliancy with C++
    • +
    • HAL_USART_Init() fix USART baud rate configuration issue: USART baud rate is twice Higher than expected
    • +
  • +
  • HAL WWDG update +
      +
    • Update macro parameters to use underscore: XXX
    • +
    • Use of CMSIS constants instead of magic values
    • +
    • Use MODIFY_REG macro in HAL_WWDG_Init()
    • +
    • Add IS_WWDG_ALL_INSTANCE in HAL_WWDG_Init() and HAL_WWDG_DeInit()
    • +
    • Add new parameter in __HAL_WWDG_ENABLE_IT() macro
    • +
    • Add new macros to manage WWDG IT & correction: +
        +
      • __HAL_WWDG_DISABLE()
      • +
      • __HAL_WWDG_DISABLE_IT()
      • +
      • __HAL_WWDG_GET_IT()
      • +
      • __HAL_WWDG_GET_IT_SOURCE()
      • +
    • +
  • +
  • HAL IWDG update +
      +
    • Use WRITE_REG instead of SET_BIT for all IWDG macros
    • +
    • __HAL_IWDG_CLEAR_FLAG removed: no IWDG flag cleared by access to SR register
    • +
    • Use MODIFY_REG macro in HAL_IWDG_Init()
    • +
    • Add IS_IWDG_ALL_INSTANCE in HAL_IWDG_Init()
    • +
    • Rename the defined IWDG keys: +
        +
      • KR_KEY_RELOAD by IWDG_KEY_RELOAD
      • +
      • KR_KEY_ENABLE by IWDG_KEY_ENABLE
      • +
      • KR_KEY_EWA by IWDG_KEY_WRITE_ACCESS_ENABLE
      • +
      • KR_KEY_DWA by IWDG_KEY_WRITE_ACCESS_DISABLE
      • +
    • +
    • Add new macro: __HAL_IWDG_RESET_HANDLE_STATE()
    • +
    • Update IWDG_ENABLE_WRITE_ACCESS() and IWDG_DISABLE_WRITE_ACCESS() as private macro
    • +
  • +
  • HAL LL FSMC update +
      +
    • Add WriteFifo and PageSize fields in the FSMC_NORSRAM_InitTypeDef structure
    • +
    • Update FSMC_NORSRAM_Init(), FSMC_NORSRAM_DeInit() and FSMC_NORSRAM_Extended_Timing_Init() functions
    • +
  • +
  • HAL LL USB update +
      +
    • Update USB_HostInit() and USB_DevInit() functions to support the VBUS Sensing B activation
    • +
    • USB_FlushTxFifo API: update to flush all Tx FIFO
    • +
    • Update to use local variable in USB Host channel re-activation
    • +
  • +
+
+
+
+ +
+

Main Changes

+
    +
  • Patch release : moved macros related to RNG from hal_rcc_ex.h to hal_rcc.h as RNG is present in all versions of the STM32F2
  • +
+
+
+
+ +
+

Main Changes

+
    +
  • First official release
  • +
+
+
+
+
+ + + diff --git a/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal.c b/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal.c index dd6e4d1cbb..767b393306 100644 --- a/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal.c +++ b/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal.c @@ -50,11 +50,11 @@ * @{ */ /** - * @brief STM32F2xx HAL Driver version number V1.2.3 + * @brief STM32F2xx HAL Driver version number V1.2.4 */ #define __STM32F2xx_HAL_VERSION_MAIN 0x01U /*!< [31:24] main version */ #define __STM32F2xx_HAL_VERSION_SUB1 0x02U /*!< [23:16] sub1 version */ -#define __STM32F2xx_HAL_VERSION_SUB2 0x03U /*!< [15:8] sub2 version */ +#define __STM32F2xx_HAL_VERSION_SUB2 0x04U /*!< [15:8] sub2 version */ #define __STM32F2xx_HAL_VERSION_RC 0x00U /*!< [7:0] release candidate */ #define __STM32F2xx_HAL_VERSION ((__STM32F2xx_HAL_VERSION_MAIN << 24U)\ |(__STM32F2xx_HAL_VERSION_SUB1 << 16U)\ diff --git a/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_adc_ex.c b/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_adc_ex.c index 30cc2f6474..e2ded61a8f 100644 --- a/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_adc_ex.c +++ b/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_adc_ex.c @@ -5,7 +5,7 @@ * @brief This file provides firmware functions to manage the following * functionalities of the ADC extension peripheral: * + Extended features functions - * + * @verbatim ============================================================================== ##### How to use this driver ##### @@ -15,8 +15,8 @@ (##) Enable the ADC interface clock using __HAL_RCC_ADC_CLK_ENABLE() (##) ADC pins configuration (+++) Enable the clock for the ADC GPIOs using the following function: - __HAL_RCC_GPIOx_CLK_ENABLE() - (+++) Configure these ADC pins in analog mode using HAL_GPIO_Init() + __HAL_RCC_GPIOx_CLK_ENABLE() + (+++) Configure these ADC pins in analog mode using HAL_GPIO_Init() (##) In case of using interrupts (e.g. HAL_ADC_Start_IT()) (+++) Configure the ADC interrupt priority using HAL_NVIC_SetPriority() (+++) Enable the ADC IRQ handler using HAL_NVIC_EnableIRQ() @@ -32,54 +32,43 @@ priority than the input stream. (#) Configure the ADC Prescaler, conversion resolution and data alignment using the HAL_ADC_Init() function. - + (#) Configure the ADC Injected channels group features, use HAL_ADC_Init() and HAL_ADC_ConfigChannel() functions. - - (#) Three operation modes are available within this driver : - + + (#) Three operation modes are available within this driver: + *** Polling mode IO operation *** ================================= - [..] - (+) Start the ADC peripheral using HAL_ADCEx_InjectedStart() + [..] + (+) Start the ADC peripheral using HAL_ADCEx_InjectedStart() (+) Wait for end of conversion using HAL_ADC_PollForConversion(), at this stage - user can specify the value of timeout according to his end application + user can specify the value of timeout according to his end application (+) To read the ADC converted values, use the HAL_ADCEx_InjectedGetValue() function. (+) Stop the ADC peripheral using HAL_ADCEx_InjectedStop() - - *** Interrupt mode IO operation *** + + *** Interrupt mode IO operation *** =================================== - [..] - (+) Start the ADC peripheral using HAL_ADCEx_InjectedStart_IT() + [..] + (+) Start the ADC peripheral using HAL_ADCEx_InjectedStart_IT() (+) Use HAL_ADC_IRQHandler() called under ADC_IRQHandler() Interrupt subroutine - (+) At ADC end of conversion HAL_ADCEx_InjectedConvCpltCallback() function is executed and user can - add his own code by customization of function pointer HAL_ADCEx_InjectedConvCpltCallback - (+) In case of ADC Error, HAL_ADCEx_InjectedErrorCallback() function is executed and user can + (+) At ADC end of conversion HAL_ADCEx_InjectedConvCpltCallback() function is executed and user can + add his own code by customization of function pointer HAL_ADCEx_InjectedConvCpltCallback + (+) In case of ADC Error, HAL_ADCEx_InjectedErrorCallback() function is executed and user can add his own code by customization of function pointer HAL_ADCEx_InjectedErrorCallback (+) Stop the ADC peripheral using HAL_ADCEx_InjectedStop_IT() - - - *** DMA mode IO operation *** - ============================== - [..] - (+) Start the ADC peripheral using HAL_ADCEx_InjectedStart_DMA(), at this stage the user specify the length - of data to be transferred at each end of conversion - (+) At The end of data transfer ba HAL_ADCEx_InjectedConvCpltCallback() function is executed and user can - add his own code by customization of function pointer HAL_ADCEx_InjectedConvCpltCallback - (+) In case of transfer Error, HAL_ADCEx_InjectedErrorCallback() function is executed and user can - add his own code by customization of function pointer HAL_ADCEx_InjectedErrorCallback - (+) Stop the ADC peripheral using HAL_ADCEx_InjectedStop_DMA() - + + *** Multi mode ADCs Regular channels configuration *** ====================================================== - [..] - (+) Select the Multi mode ADC regular channels features (dual or triple mode) - and configure the DMA mode using HAL_ADCEx_MultiModeConfigChannel() functions. - (+) Start the ADC peripheral using HAL_ADCEx_MultiModeStart_DMA(), at this stage the user specify the length - of data to be transferred at each end of conversion + [..] + (+) Select the Multi mode ADC regular channels features (dual or triple mode) + and configure the DMA mode using HAL_ADCEx_MultiModeConfigChannel() functions. + (+) Start the ADC peripheral using HAL_ADCEx_MultiModeStart_DMA(), at this stage the user specify the length + of data to be transferred at each end of conversion (+) Read the ADCs converted values using the HAL_ADCEx_MultiModeGetValue() function. - - + + @endverbatim ****************************************************************************** * @attention diff --git a/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_gpio.c b/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_gpio.c index cf8caaf3ee..4f80e5dc81 100644 --- a/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_gpio.c +++ b/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_gpio.c @@ -194,27 +194,6 @@ void HAL_GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_Init) if (iocurrent != 0x00u) { - /*--------------------- GPIO Mode Configuration ------------------------*/ - /* In case of Alternate function mode selection */ - if((GPIO_Init->Mode == GPIO_MODE_AF_PP) || (GPIO_Init->Mode == GPIO_MODE_AF_OD)) - { - /* Check the Alternate function parameters */ - assert_param(IS_GPIO_AF_INSTANCE(GPIOx)); - assert_param(IS_GPIO_AF(GPIO_Init->Alternate)); - - /* Configure Alternate function mapped with the current IO */ - temp = GPIOx->AFR[position >> 3u]; - temp &= ~(0xFu << ((position & 0x07u) * 4u)); - temp |= ((GPIO_Init->Alternate) << ((position & 0x07u) * 4u)); - GPIOx->AFR[position >> 3u] = temp; - } - - /* Configure IO Direction mode (Input, Output, Alternate or Analog) */ - temp = GPIOx->MODER; - temp &= ~(GPIO_MODER_MODE0 << (position * 2u)); - temp |= ((GPIO_Init->Mode & GPIO_MODE) << (position * 2u)); - GPIOx->MODER = temp; - /* In case of Output or Alternate function mode selection */ if((GPIO_Init->Mode == GPIO_MODE_OUTPUT_PP) || (GPIO_Init->Mode == GPIO_MODE_AF_PP) || (GPIO_Init->Mode == GPIO_MODE_OUTPUT_OD) || (GPIO_Init->Mode == GPIO_MODE_AF_OD)) @@ -240,6 +219,27 @@ void HAL_GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_Init) temp |= ((GPIO_Init->Pull) << (position * 2u)); GPIOx->PUPDR = temp; + /*--------------------- GPIO Mode Configuration ------------------------*/ + /* In case of Alternate function mode selection */ + if((GPIO_Init->Mode == GPIO_MODE_AF_PP) || (GPIO_Init->Mode == GPIO_MODE_AF_OD)) + { + /* Check the Alternate function parameters */ + assert_param(IS_GPIO_AF_INSTANCE(GPIOx)); + assert_param(IS_GPIO_AF(GPIO_Init->Alternate)); + + /* Configure Alternate function mapped with the current IO */ + temp = GPIOx->AFR[position >> 3u]; + temp &= ~(0xFu << ((position & 0x07u) * 4u)); + temp |= ((GPIO_Init->Alternate) << ((position & 0x07u) * 4u)); + GPIOx->AFR[position >> 3u] = temp; + } + + /* Configure IO Direction mode (Input, Output, Alternate or Analog) */ + temp = GPIOx->MODER; + temp &= ~(GPIO_MODER_MODE0 << (position * 2u)); + temp |= ((GPIO_Init->Mode & GPIO_MODE) << (position * 2u)); + GPIOx->MODER = temp; + /*--------------------- EXTI Mode Configuration ------------------------*/ /* Configure the External Interrupt or event for the current IO */ if((GPIO_Init->Mode & EXTI_MODE) == EXTI_MODE) @@ -327,7 +327,7 @@ void HAL_GPIO_DeInit(GPIO_TypeDef *GPIOx, uint32_t GPIO_Pin) /* Clear EXTI line configuration */ EXTI->IMR &= ~((uint32_t)iocurrent); EXTI->EMR &= ~((uint32_t)iocurrent); - + /* Clear Rising Falling edge configuration */ EXTI->RTSR &= ~((uint32_t)iocurrent); EXTI->FTSR &= ~((uint32_t)iocurrent); @@ -342,16 +342,16 @@ void HAL_GPIO_DeInit(GPIO_TypeDef *GPIOx, uint32_t GPIO_Pin) GPIOx->MODER &= ~(GPIO_MODER_MODER0 << (position * 2u)); /* Configure the default Alternate Function in current IO */ - GPIOx->AFR[position >> 3u] &= ~(0xFu << ((uint32_t)(position & 0x07u) * 4u)) ; + GPIOx->AFR[position >> 3u] &= ~(0xFu << ((uint32_t)(position & 0x07u) * 4u)); - /* Configure the default value for IO Speed */ - GPIOx->OSPEEDR &= ~(GPIO_OSPEEDER_OSPEEDR0 << (position * 2u)); + /* Deactivate the Pull-up and Pull-down resistor for the current IO */ + GPIOx->PUPDR &= ~(GPIO_PUPDR_PUPDR0 << (position * 2U)); /* Configure the default value IO Output Type */ - GPIOx->OTYPER &= ~(GPIO_OTYPER_OT_0 << position) ; + GPIOx->OTYPER &= ~(GPIO_OTYPER_OT_0 << position); - /* Deactivate the Pull-up and Pull-down resistor for the current IO */ - GPIOx->PUPDR &= ~(GPIO_PUPDR_PUPDR0 << (position * 2U)); + /* Configure the default value for IO Speed */ + GPIOx->OSPEEDR &= ~(GPIO_OSPEEDER_OSPEEDR0 << (position * 2u)); } position++; diff --git a/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_i2c.c b/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_i2c.c index 7610867fa8..fe95bd51d6 100644 --- a/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_i2c.c +++ b/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_i2c.c @@ -378,6 +378,8 @@ static void I2C_Slave_ADDR(I2C_HandleTypeDef *hi2c, uint32_t IT2Flags); static void I2C_Slave_STOPF(I2C_HandleTypeDef *hi2c); static void I2C_Slave_AF(I2C_HandleTypeDef *hi2c); +static void I2C_MemoryTransmit_TXE_BTF(I2C_HandleTypeDef *hi2c); + /* Private function to Convert Specific options */ static void I2C_ConvertOtherXferOptions(I2C_HandleTypeDef *hi2c); /** @@ -486,6 +488,10 @@ HAL_StatusTypeDef HAL_I2C_Init(I2C_HandleTypeDef *hi2c) /* Disable the selected I2C peripheral */ __HAL_I2C_DISABLE(hi2c); + /*Reset I2C*/ + hi2c->Instance->CR1 |= I2C_CR1_SWRST; + hi2c->Instance->CR1 &= ~I2C_CR1_SWRST; + /* Get PCLK1 frequency */ pclk1 = HAL_RCC_GetPCLK1Freq(); @@ -3303,7 +3309,11 @@ HAL_StatusTypeDef HAL_I2C_IsDeviceReady(I2C_HandleTypeDef *hi2c, uint16_t DevAdd /* Wait until SB flag is set */ if (I2C_WaitOnFlagUntilTimeout(hi2c, I2C_FLAG_SB, RESET, Timeout, tickstart) != HAL_OK) { - return HAL_ERROR; + if (hi2c->Instance->CR1 & I2C_CR1_START) + { + hi2c->ErrorCode = HAL_I2C_WRONG_START; + } + return HAL_TIMEOUT; } /* Send slave address */ @@ -4718,6 +4728,7 @@ void HAL_I2C_ER_IRQHandler(I2C_HandleTypeDef *hi2c) uint32_t sr1itflags = READ_REG(hi2c->Instance->SR1); uint32_t itsources = READ_REG(hi2c->Instance->CR2); uint32_t error = HAL_I2C_ERROR_NONE; + HAL_I2C_ModeTypeDef CurrentMode = hi2c->Mode; /* I2C Bus error interrupt occurred ----------------------------------------*/ if ((I2C_CHECK_FLAG(sr1itflags, I2C_FLAG_BERR) != RESET) && (I2C_CHECK_IT_SOURCE(itsources, I2C_IT_ERR) != RESET)) @@ -4740,7 +4751,7 @@ void HAL_I2C_ER_IRQHandler(I2C_HandleTypeDef *hi2c) /* I2C Acknowledge failure error interrupt occurred ------------------------*/ if ((I2C_CHECK_FLAG(sr1itflags, I2C_FLAG_AF) != RESET) && (I2C_CHECK_IT_SOURCE(itsources, I2C_IT_ERR) != RESET)) { - tmp1 = hi2c->Mode; + tmp1 = CurrentMode; tmp2 = hi2c->XferCount; tmp3 = hi2c->State; tmp4 = hi2c->PreviousState; @@ -4758,7 +4769,7 @@ void HAL_I2C_ER_IRQHandler(I2C_HandleTypeDef *hi2c) error |= HAL_I2C_ERROR_AF; /* Do not generate a STOP in case of Slave receive non acknowledge during transfer (mean not at the end of transfer) */ - if (hi2c->Mode == HAL_I2C_MODE_MASTER) + if ((CurrentMode == HAL_I2C_MODE_MASTER) || (CurrentMode == HAL_I2C_MODE_MEM)) { /* Generate Stop */ SET_BIT(hi2c->Instance->CR1, I2C_CR1_STOP); @@ -5083,59 +5094,7 @@ static void I2C_MasterTransmit_TXE(I2C_HandleTypeDef *hi2c) { if (hi2c->Mode == HAL_I2C_MODE_MEM) { - if (hi2c->EventCount == 0U) - { - /* If Memory address size is 8Bit */ - if (hi2c->MemaddSize == I2C_MEMADD_SIZE_8BIT) - { - /* Send Memory Address */ - hi2c->Instance->DR = I2C_MEM_ADD_LSB(hi2c->Memaddress); - - hi2c->EventCount += 2U; - } - /* If Memory address size is 16Bit */ - else - { - /* Send MSB of Memory Address */ - hi2c->Instance->DR = I2C_MEM_ADD_MSB(hi2c->Memaddress); - - hi2c->EventCount++; - } - } - else if (hi2c->EventCount == 1U) - { - /* Send LSB of Memory Address */ - hi2c->Instance->DR = I2C_MEM_ADD_LSB(hi2c->Memaddress); - - hi2c->EventCount++; - } - else if (hi2c->EventCount == 2U) - { - if (hi2c->State == HAL_I2C_STATE_BUSY_RX) - { - /* Generate Restart */ - hi2c->Instance->CR1 |= I2C_CR1_START; - } - else if (hi2c->State == HAL_I2C_STATE_BUSY_TX) - { - /* Write data to DR */ - hi2c->Instance->DR = *hi2c->pBuffPtr; - - /* Increment Buffer pointer */ - hi2c->pBuffPtr++; - - /* Update counter */ - hi2c->XferCount--; - } - else - { - /* Do nothing */ - } - } - else - { - /* Do nothing */ - } + I2C_MemoryTransmit_TXE_BTF(hi2c); } else { @@ -5230,6 +5189,77 @@ static void I2C_MasterTransmit_BTF(I2C_HandleTypeDef *hi2c) } } } + else if (hi2c->Mode == HAL_I2C_MODE_MEM) + { + I2C_MemoryTransmit_TXE_BTF(hi2c); + } + else + { + /* Do nothing */ + } +} + +/** + * @brief Handle TXE and BTF flag for Memory transmitter + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for I2C module + * @retval None + */ +static void I2C_MemoryTransmit_TXE_BTF(I2C_HandleTypeDef *hi2c) +{ + if (hi2c->EventCount == 0U) + { + /* If Memory address size is 8Bit */ + if (hi2c->MemaddSize == I2C_MEMADD_SIZE_8BIT) + { + /* Send Memory Address */ + hi2c->Instance->DR = I2C_MEM_ADD_LSB(hi2c->Memaddress); + + hi2c->EventCount += 2U; + } + /* If Memory address size is 16Bit */ + else + { + /* Send MSB of Memory Address */ + hi2c->Instance->DR = I2C_MEM_ADD_MSB(hi2c->Memaddress); + + hi2c->EventCount++; + } + } + else if (hi2c->EventCount == 1U) + { + /* Send LSB of Memory Address */ + hi2c->Instance->DR = I2C_MEM_ADD_LSB(hi2c->Memaddress); + + hi2c->EventCount++; + } + else if (hi2c->EventCount == 2U) + { + if (hi2c->State == HAL_I2C_STATE_BUSY_RX) + { + /* Generate Restart */ + hi2c->Instance->CR1 |= I2C_CR1_START; + } + else if (hi2c->State == HAL_I2C_STATE_BUSY_TX) + { + /* Write data to DR */ + hi2c->Instance->DR = *hi2c->pBuffPtr; + + /* Increment Buffer pointer */ + hi2c->pBuffPtr++; + + /* Update counter */ + hi2c->XferCount--; + } + else + { + /* Do nothing */ + } + } + else + { + /* Do nothing */ + } } /** @@ -5473,13 +5503,11 @@ static void I2C_Master_SB(I2C_HandleTypeDef *hi2c) hi2c->Instance->DR = I2C_7BIT_ADD_READ(hi2c->Devaddress); } - if ((hi2c->hdmatx != NULL) || (hi2c->hdmarx != NULL)) + if (((hi2c->hdmatx != NULL) && (hi2c->hdmatx->XferCpltCallback != NULL)) + || ((hi2c->hdmarx != NULL) && (hi2c->hdmarx->XferCpltCallback != NULL))) { - if ((hi2c->hdmatx->XferCpltCallback != NULL) || (hi2c->hdmarx->XferCpltCallback != NULL)) - { - /* Enable DMA Request */ - SET_BIT(hi2c->Instance->CR2, I2C_CR2_DMAEN); - } + /* Enable DMA Request */ + SET_BIT(hi2c->Instance->CR2, I2C_CR2_DMAEN); } } else @@ -6089,6 +6117,7 @@ static void I2C_ITError(I2C_HandleTypeDef *hi2c) { /* Declaration of temporary variable to prevent undefined behavior of volatile usage */ HAL_I2C_StateTypeDef CurrentState = hi2c->State; + uint32_t CurrentError; if ((hi2c->Mode == HAL_I2C_MODE_MASTER) && (CurrentState == HAL_I2C_STATE_BUSY_RX)) { @@ -6208,15 +6237,24 @@ static void I2C_ITError(I2C_HandleTypeDef *hi2c) HAL_I2C_ErrorCallback(hi2c); #endif /* USE_HAL_I2C_REGISTER_CALLBACKS */ } - /* STOP Flag is not set after a NACK reception */ + + /* STOP Flag is not set after a NACK reception, BusError, ArbitrationLost, OverRun */ + CurrentError = hi2c->ErrorCode; + + if (((CurrentError & HAL_I2C_ERROR_BERR) == HAL_I2C_ERROR_BERR) || \ + ((CurrentError & HAL_I2C_ERROR_ARLO) == HAL_I2C_ERROR_ARLO) || \ + ((CurrentError & HAL_I2C_ERROR_AF) == HAL_I2C_ERROR_AF) || \ + ((CurrentError & HAL_I2C_ERROR_OVR) == HAL_I2C_ERROR_OVR)) + { + /* Disable EVT, BUF and ERR interrupt */ + __HAL_I2C_DISABLE_IT(hi2c, I2C_IT_EVT | I2C_IT_BUF | I2C_IT_ERR); + } + /* So may inform upper layer that listen phase is stopped */ /* during NACK error treatment */ CurrentState = hi2c->State; if (((hi2c->ErrorCode & HAL_I2C_ERROR_AF) == HAL_I2C_ERROR_AF) && (CurrentState == HAL_I2C_STATE_LISTEN)) { - /* Disable EVT, BUF and ERR interrupt */ - __HAL_I2C_DISABLE_IT(hi2c, I2C_IT_EVT | I2C_IT_BUF | I2C_IT_ERR); - hi2c->XferOptions = I2C_NO_OPTION_FRAME; hi2c->PreviousState = I2C_STATE_NONE; hi2c->State = HAL_I2C_STATE_READY; @@ -6264,7 +6302,11 @@ static HAL_StatusTypeDef I2C_MasterRequestWrite(I2C_HandleTypeDef *hi2c, uint16_ /* Wait until SB flag is set */ if (I2C_WaitOnFlagUntilTimeout(hi2c, I2C_FLAG_SB, RESET, Timeout, Tickstart) != HAL_OK) { - return HAL_ERROR; + if (hi2c->Instance->CR1 & I2C_CR1_START) + { + hi2c->ErrorCode = HAL_I2C_WRONG_START; + } + return HAL_TIMEOUT; } if (hi2c->Init.AddressingMode == I2C_ADDRESSINGMODE_7BIT) @@ -6333,7 +6375,11 @@ static HAL_StatusTypeDef I2C_MasterRequestRead(I2C_HandleTypeDef *hi2c, uint16_t /* Wait until SB flag is set */ if (I2C_WaitOnFlagUntilTimeout(hi2c, I2C_FLAG_SB, RESET, Timeout, Tickstart) != HAL_OK) { - return HAL_ERROR; + if (hi2c->Instance->CR1 & I2C_CR1_START) + { + hi2c->ErrorCode = HAL_I2C_WRONG_START; + } + return HAL_TIMEOUT; } if (hi2c->Init.AddressingMode == I2C_ADDRESSINGMODE_7BIT) @@ -6370,7 +6416,11 @@ static HAL_StatusTypeDef I2C_MasterRequestRead(I2C_HandleTypeDef *hi2c, uint16_t /* Wait until SB flag is set */ if (I2C_WaitOnFlagUntilTimeout(hi2c, I2C_FLAG_SB, RESET, Timeout, Tickstart) != HAL_OK) { - return HAL_ERROR; + if (hi2c->Instance->CR1 & I2C_CR1_START) + { + hi2c->ErrorCode = HAL_I2C_WRONG_START; + } + return HAL_TIMEOUT; } /* Send header of slave address */ @@ -6406,7 +6456,11 @@ static HAL_StatusTypeDef I2C_RequestMemoryWrite(I2C_HandleTypeDef *hi2c, uint16_ /* Wait until SB flag is set */ if (I2C_WaitOnFlagUntilTimeout(hi2c, I2C_FLAG_SB, RESET, Timeout, Tickstart) != HAL_OK) { - return HAL_ERROR; + if (hi2c->Instance->CR1 & I2C_CR1_START) + { + hi2c->ErrorCode = HAL_I2C_WRONG_START; + } + return HAL_TIMEOUT; } /* Send slave address */ @@ -6485,7 +6539,11 @@ static HAL_StatusTypeDef I2C_RequestMemoryRead(I2C_HandleTypeDef *hi2c, uint16_t /* Wait until SB flag is set */ if (I2C_WaitOnFlagUntilTimeout(hi2c, I2C_FLAG_SB, RESET, Timeout, Tickstart) != HAL_OK) { - return HAL_ERROR; + if (hi2c->Instance->CR1 & I2C_CR1_START) + { + hi2c->ErrorCode = HAL_I2C_WRONG_START; + } + return HAL_TIMEOUT; } /* Send slave address */ @@ -6555,7 +6613,11 @@ static HAL_StatusTypeDef I2C_RequestMemoryRead(I2C_HandleTypeDef *hi2c, uint16_t /* Wait until SB flag is set */ if (I2C_WaitOnFlagUntilTimeout(hi2c, I2C_FLAG_SB, RESET, Timeout, Tickstart) != HAL_OK) { - return HAL_ERROR; + if (hi2c->Instance->CR1 & I2C_CR1_START) + { + hi2c->ErrorCode = HAL_I2C_WRONG_START; + } + return HAL_TIMEOUT; } /* Send slave address */ @@ -6588,8 +6650,14 @@ static void I2C_DMAXferCplt(DMA_HandleTypeDef *hdma) __HAL_I2C_DISABLE_IT(hi2c, I2C_IT_EVT | I2C_IT_ERR); /* Clear Complete callback */ - hi2c->hdmatx->XferCpltCallback = NULL; - hi2c->hdmarx->XferCpltCallback = NULL; + if (hi2c->hdmatx != NULL) + { + hi2c->hdmatx->XferCpltCallback = NULL; + } + if (hi2c->hdmarx != NULL) + { + hi2c->hdmarx->XferCpltCallback = NULL; + } if ((((uint32_t)CurrentState & (uint32_t)HAL_I2C_STATE_BUSY_TX) == (uint32_t)HAL_I2C_STATE_BUSY_TX) || ((((uint32_t)CurrentState & (uint32_t)HAL_I2C_STATE_BUSY_RX) == (uint32_t)HAL_I2C_STATE_BUSY_RX) && (CurrentMode == HAL_I2C_MODE_SLAVE))) { @@ -6712,8 +6780,14 @@ static void I2C_DMAError(DMA_HandleTypeDef *hdma) I2C_HandleTypeDef *hi2c = (I2C_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent; /* Derogation MISRAC2012-Rule-11.5 */ /* Clear Complete callback */ - hi2c->hdmatx->XferCpltCallback = NULL; - hi2c->hdmarx->XferCpltCallback = NULL; + if (hi2c->hdmatx != NULL) + { + hi2c->hdmatx->XferCpltCallback = NULL; + } + if (hi2c->hdmarx != NULL) + { + hi2c->hdmarx->XferCpltCallback = NULL; + } /* Ignore DMA FIFO error */ if (HAL_DMA_GetError(hdma) != HAL_DMA_ERROR_FE) @@ -6750,8 +6824,14 @@ static void I2C_DMAAbort(DMA_HandleTypeDef *hdma) HAL_I2C_StateTypeDef CurrentState = hi2c->State; /* Clear Complete callback */ - hi2c->hdmatx->XferCpltCallback = NULL; - hi2c->hdmarx->XferCpltCallback = NULL; + if (hi2c->hdmatx != NULL) + { + hi2c->hdmatx->XferCpltCallback = NULL; + } + if (hi2c->hdmarx != NULL) + { + hi2c->hdmarx->XferCpltCallback = NULL; + } /* Disable Acknowledge */ CLEAR_BIT(hi2c->Instance->CR1, I2C_CR1_ACK); @@ -6759,8 +6839,14 @@ static void I2C_DMAAbort(DMA_HandleTypeDef *hdma) hi2c->XferCount = 0U; /* Reset XferAbortCallback */ - hi2c->hdmatx->XferAbortCallback = NULL; - hi2c->hdmarx->XferAbortCallback = NULL; + if (hi2c->hdmatx != NULL) + { + hi2c->hdmatx->XferAbortCallback = NULL; + } + if (hi2c->hdmarx != NULL) + { + hi2c->hdmarx->XferAbortCallback = NULL; + } /* Disable I2C peripheral to prevent dummy data in buffer */ __HAL_I2C_DISABLE(hi2c); diff --git a/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_irda.c b/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_irda.c index c31e6978d1..bfcc32d7ab 100644 --- a/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_irda.c +++ b/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_irda.c @@ -1763,7 +1763,7 @@ void HAL_IRDA_IRQHandler(IRDA_HandleTypeDef *hirda) } /* IRDA Over-Run interrupt occurred -----------------------------------*/ - if (((isrflags & USART_SR_ORE) != RESET) && ((cr3its & USART_CR3_EIE) != RESET)) + if (((isrflags & USART_SR_ORE) != RESET) && (((cr1its & USART_CR1_RXNEIE) != RESET) || ((cr3its & USART_CR3_EIE) != RESET))) { hirda->ErrorCode |= HAL_IRDA_ERROR_ORE; } diff --git a/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_smartcard.c b/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_smartcard.c index 3e0e015e6c..70718b5c34 100644 --- a/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_smartcard.c +++ b/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_smartcard.c @@ -1566,7 +1566,7 @@ void HAL_SMARTCARD_IRQHandler(SMARTCARD_HandleTypeDef *hsc) } /* SMARTCARD Over-Run interrupt occurred -------------------------------*/ - if(((isrflags & SMARTCARD_FLAG_ORE) != RESET) && ((cr3its & USART_CR3_EIE) != RESET)) + if(((isrflags & SMARTCARD_FLAG_ORE) != RESET) && (((cr1its & USART_CR1_RXNEIE) != RESET) || ((cr3its & USART_CR3_EIE) != RESET))) { hsc->ErrorCode |= HAL_SMARTCARD_ERROR_ORE; } diff --git a/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_uart.c b/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_uart.c index d064c6f2e2..51bc8a3988 100644 --- a/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_uart.c +++ b/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_uart.c @@ -1039,6 +1039,10 @@ HAL_StatusTypeDef HAL_UART_Transmit(UART_HandleTypeDef *huart, uint8_t *pData, u huart->TxXferSize = Size; huart->TxXferCount = Size; + + /* Process Unlocked */ + __HAL_UNLOCK(huart); + while (huart->TxXferCount > 0U) { huart->TxXferCount--; @@ -1077,9 +1081,6 @@ HAL_StatusTypeDef HAL_UART_Transmit(UART_HandleTypeDef *huart, uint8_t *pData, u /* At end of Tx process, restore huart->gState to Ready */ huart->gState = HAL_UART_STATE_READY; - /* Process Unlocked */ - __HAL_UNLOCK(huart); - return HAL_OK; } else @@ -1125,6 +1126,9 @@ HAL_StatusTypeDef HAL_UART_Receive(UART_HandleTypeDef *huart, uint8_t *pData, ui huart->RxXferSize = Size; huart->RxXferCount = Size; + /* Process Unlocked */ + __HAL_UNLOCK(huart); + /* Check the remain data to be received */ while (huart->RxXferCount > 0U) { @@ -1169,9 +1173,6 @@ HAL_StatusTypeDef HAL_UART_Receive(UART_HandleTypeDef *huart, uint8_t *pData, ui /* At end of Rx process, restore huart->RxState to Ready */ huart->RxState = HAL_UART_STATE_READY; - /* Process Unlocked */ - __HAL_UNLOCK(huart); - return HAL_OK; } else @@ -2051,7 +2052,7 @@ void HAL_UART_IRQHandler(UART_HandleTypeDef *huart) } /* UART Over-Run interrupt occurred --------------------------------------*/ - if (((isrflags & USART_SR_ORE) != RESET) && ((cr3its & USART_CR3_EIE) != RESET)) + if (((isrflags & USART_SR_ORE) != RESET) && (((cr1its & USART_CR1_RXNEIE) != RESET) || ((cr3its & USART_CR3_EIE) != RESET))) { huart->ErrorCode |= HAL_UART_ERROR_ORE; } diff --git a/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_usart.c b/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_usart.c index ac5b65b1c3..81ca14571c 100644 --- a/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_usart.c +++ b/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_usart.c @@ -1788,7 +1788,7 @@ void HAL_USART_IRQHandler(USART_HandleTypeDef *husart) } /* USART Over-Run interrupt occurred -----------------------------------*/ - if (((isrflags & USART_SR_ORE) != RESET) && ((cr3its & USART_CR3_EIE) != RESET)) + if (((isrflags & USART_SR_ORE) != RESET) && (((cr1its & USART_CR1_RXNEIE) != RESET) || ((cr3its & USART_CR3_EIE) != RESET))) { husart->ErrorCode |= HAL_USART_ERROR_ORE; } diff --git a/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Src/stm32f2xx_ll_adc.c b/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Src/stm32f2xx_ll_adc.c index c95d2dcc2c..eaa0724d9d 100644 --- a/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Src/stm32f2xx_ll_adc.c +++ b/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Src/stm32f2xx_ll_adc.c @@ -264,7 +264,9 @@ #endif /* ADC_MULTIMODE_SUPPORT */ +#ifndef UNUSED #define UNUSED(x) ((void)(x)) +#endif /** * @} diff --git a/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Src/stm32f2xx_ll_gpio.c b/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Src/stm32f2xx_ll_gpio.c index 553f2185a8..b5ae92f75d 100644 --- a/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Src/stm32f2xx_ll_gpio.c +++ b/bsp/stm32/libraries/STM32F2xx_HAL/STM32F2xx_HAL_Driver/Src/stm32f2xx_ll_gpio.c @@ -223,9 +223,6 @@ ErrorStatus LL_GPIO_Init(GPIO_TypeDef *GPIOx, LL_GPIO_InitTypeDef *GPIO_InitStru if (currentpin != 0x00u) { - /* Pin Mode configuration */ - LL_GPIO_SetPinMode(GPIOx, currentpin, GPIO_InitStruct->Mode); - if ((GPIO_InitStruct->Mode == LL_GPIO_MODE_OUTPUT) || (GPIO_InitStruct->Mode == LL_GPIO_MODE_ALTERNATE)) { /* Check Speed mode parameters */ @@ -233,6 +230,12 @@ ErrorStatus LL_GPIO_Init(GPIO_TypeDef *GPIOx, LL_GPIO_InitTypeDef *GPIO_InitStru /* Speed mode configuration */ LL_GPIO_SetPinSpeed(GPIOx, currentpin, GPIO_InitStruct->Speed); + + /* Check Output mode parameters */ + assert_param(IS_LL_GPIO_OUTPUT_TYPE(GPIO_InitStruct->OutputType)); + + /* Output mode configuration*/ + LL_GPIO_SetPinOutputType(GPIOx, GPIO_InitStruct->Pin, GPIO_InitStruct->OutputType); } /* Pull-up Pull down resistor configuration*/ @@ -253,19 +256,12 @@ ErrorStatus LL_GPIO_Init(GPIO_TypeDef *GPIOx, LL_GPIO_InitTypeDef *GPIO_InitStru LL_GPIO_SetAFPin_8_15(GPIOx, currentpin, GPIO_InitStruct->Alternate); } } + + /* Pin Mode configuration */ + LL_GPIO_SetPinMode(GPIOx, currentpin, GPIO_InitStruct->Mode); } pinpos++; } - - if ((GPIO_InitStruct->Mode == LL_GPIO_MODE_OUTPUT) || (GPIO_InitStruct->Mode == LL_GPIO_MODE_ALTERNATE)) - { - /* Check Output mode parameters */ - assert_param(IS_LL_GPIO_OUTPUT_TYPE(GPIO_InitStruct->OutputType)); - - /* Output mode configuration*/ - LL_GPIO_SetPinOutputType(GPIOx, GPIO_InitStruct->Pin, GPIO_InitStruct->OutputType); - - } return (SUCCESS); } -- GitLab