# Release Notes for STM32G0xx HAL Drivers

Copyright © 2018 STMicroelectronics

# Purpose

The STM32Cube HAL and LL, an STM32 abstraction layer embedded software, ensure maximized portability across STM32 portfolio.

The Portable APIs layer provides a generic, multi instanced and simple set of APIs to interact with the upper layer (application, libraries and stacks). It is composed of native and extended APIs set. It is directly built around a generic architecture and allows the build-upon layers, like the middleware layer, to implement its functions without knowing in-depth the used STM32 device. This improves the library code re-usability and guarantees an easy portability on other devices and STM32 families.

The Low Layer (LL) drivers are part of the STM32Cube firmware HAL that provide basic set of optimized and one shot services. The Low layer drivers, contrary to the HAL ones are not Fully Portable across the STM32 families; the availability of some functions depend on the physical availability of the relative features on the product. The Low Layer (LL) drivers are designed to offer the following features:

- New set of inline function for direct and atomic register access
- One-shot operations that can be used by the HAL drivers or from application level.
- Fully Independent from HAL and can be used in standalone usage (without HAL drivers)
- Full features coverage of the all the supported peripherals.

# Update History

V1.4.6 / 15-December-2023

## Main Changes

### Maintenance release

- HAL code quality enhancement for MISRA-C Rule-8.13 by adding const qualifiers.
- HAL/LL GENERIC update
  - Fix the COMP EXTI line in the comments.
  - Allow redefinition of macro UNUSED(x).
  - Update of HAL_GetTickFreq() brief.
- HAL EXTI update
  - Fix computation of pExtiConfig->GPIOSel in HAL_EXTI_GetConfigLine().
  - Fix the wrong references in the “How to use this driver” section.
- HAL CRC update
  - Add filter in HAL_CRCEx_Polynomial_Set() to exclude even polynomials.
- HAL CRYP update
  - Update Crypt/Decrypt IT processes to avoid Computation Completed IRQ fires before the DINR pointer increment.
  - Update AES GCM in interrupt mode to avoid Computation Completed IRQ fires before the DINR pointer increment.
- LL ADC update
  - Remove useless action of conversion trigger change in function LL_ADC_DeInit(). Moreover, this action was not compliant with ADC enable state (cf reference manual).
- HAL DAC update
  - Fix incorrect word ‘surcharged’ in functions headers.
  - Fix HAL_GetTick() timeout vulnerability.
  - Updated DAC buffer calibration according to RM.
- HAL/LL RTC update
  - Optimize the way RSF flag is cleared in HAL_RTC_WaitForSynchro().
  - Correct misleading note about shadow registers.
  - Update HAL_RTC_XXX_GET_IT(), HAL_RTC_XXX_GET_FLAG(), and HAL_RTC_XXX_CLEAR_FLAG() macros with correct registers and bitmasks.
- HAL RCC update
  - Rework HAL_RCC_MCOConfig() API to support all RCC_MCOx parameter values (GPIO pins) from Datasheet.
  - Enclose in parentheses parameters of a group of macros to avoid Misra-C 2012 Rule-20.7 warnings.
  - Add else statement in the end of HAL_RCC_MCOConfig API to avoid Misra-C 2012 Rule-15.7 warnings.
  - Add defined(RCC_CCIPR_USART2SEL) for selecting the USART2 clock source in stm32g0xx_ll_rcc.h file.
- HAL PWR update
  - Update to support USB supply enable feature for STM32G0B0 devices.
- HAL CORTEX update
  - Update HAL_MPU_ConfigRegion() to allow the configuration of the MPU registers independently of the value of Enable/Disable field.
  - Add new APIs HAL_MPU_EnableRegion() / HAL_MPU_DisableRegion().
- HAL/LL TIM update
  - Remove useless check on IS_TIM_ADVANCED_INSTANCE() within LL_TIM_BDTR_Init() to fix Break Filter configuration problem with specific TIM instances.
  - Remove lock management from callback management functions.
  - Remove multiple volatile reads or writes in interrupt handler for better performance.
  - Improve HAL TIM driver’s operational behavior.
  - Assert check for the right channels.
  - Improve period configuration parameter check.
  - Remove unnecessary change of MOE bitfield in LL_TIM_BDTR_Init().
- HAL/LL LPTIM update
  - Apply the same naming rule to clear FLAG related functions.
  - Remove Lock management from callback management functions.
  - Remove redundant IS_LPTIM_AUTORELOAD macro.
- HAL FDCAN update
  - Fix GetIndex issue in HAL_FDCAN_GetRxMessage.
- HAL FLASH update
  - Remove the plural form in the description of the __HAL_FLASH_CLEAR_FLAG macro.
  - Fix __HAL_FLASH_CLEAR_FLAG macro.
  - Fix timeout check in FLASH_WaitForLastOperation().
  - Update HAL_FLASH_Unlock/HAL_FLASH_Lock and HAL_FLASH_OB_Unlock/HAL_FLASH_OB_Lock functions to check BSY1, BSY2 and CFGBSY bits before performing Unlock/Lock sequence.
  - Fix Misra-C:2012 Rule-17.7 warnings: The return value of `FLASH_WaitForLastOperation()’ call is discarded.
- HAL UART update
  - Disable the Receiver Timeout Interrupt when data reception is completed.
  - Remove lock management from callback management functions.
  - Rework of UART_WaitOnFlagUntilTimeout() API to avoid being stuck forever when UART overrun error occurs and to enhance behavior.
  - Remove __HAL_LOCK() from HAL_xxx_RegisterCallback()/HAL_xxx_UnRegisterCallback().
  - Update initialisation sequence for TXINV, RXINV and TXRXSWAP settings.
  - Fix incorrect gState check in HAL_UART_RegisterRxEventCallback/HAL_UART_UnRegisterRxEventCallback to allow user Rx Event Callback registration when a transmit is ongoing.
  - Avoid RTOF flag to be cleared by a transmit process in polling mode.
- HAL USART update
  - Remove __HAL_LOCK() from HAL_xxx_RegisterCallback()/HAL_xxx_UnRegisterCallback().
- HAL IRDA update
  - Remove __HAL_LOCK() from HAL_xxx_RegisterCallback()/HAL_xxx_UnRegisterCallback().
- HAL SMARTCARD update
  - Correct USART3 clock source computation for smartcard initialisation.
  - Remove __HAL_LOCK() from HAL_xxx_RegisterCallback()/HAL_xxx_UnRegisterCallback().
- HAL/LL I2C update
  - Duplicate the test condition after timeout detection to avoid false timeout detection.
  - Update HAL_I2C_IsDeviceReady API to support 10_bit addressing mode: Update done on the macro I2C_GENERATE_START.
  - Update HAL I2C driver to prefetch data before starting the transmission: implementation of errata sheet workaround I2C2-190208 : Transmission stalled after first byte.
  - Update HAL I2C driver to disable all interrupts after end of transaction.
  - Update HAL_I2C_Init API to clear ADD10 bit in 7 bit addressing mode.
  - Update I2C_Slave_ISR_IT, I2C_Slave_ISR_DMA and I2C_ITSlaveCplt to prevent the call of HAL_I2C_ListenCpltCallback twice.
  - Solve Slave No stretch not functional by using HAL Slave interface.
  - Update HAL_I2C_Mem_Write_IT API to initialize XferSize at 0.
  - Update I2C_WaitOnRXNEFlagUntilTimeout to check I2C_FLAG_AF independently from I2C_FLAG_RXNE.
  - Remove the unusable code in function HAL_I2C_IsDeviceReady.
  - Update I2C_WaitOnFlagUntilTimeout to handle error case.
  - Update HAL_I2C_Slave_Transmit to check if the received NACK is the good one.
  - Update LL_I2C_HandleTranfer function to prevent undefined behavior of volatile usage before updating the CR2 register.
- HAL SMBUS update
  - Update HAL SMBUS driver to prefetch data before starting the transmission: implementation of errata sheet workaround I2C2-190208 : Transmission stalled after first byte
  - Update SMBUS_ITErrorHandler to flash TXDR just in case of error.
- HAL/LL SPI update
  - Fix driver to don’t update state in case of error (HAL_SPI_STATE_READY will be set only in case of HAL_TIMEOUT).
  - Update HAL_SPI_TransmitReceive API to set the bit CRCNEXT in case of one byte transaction.
  - Update IT API to enable interrupts after process unlock.
- HAL/LL USB update
  - hal_hcd.c/ll_usb.c: fix double buffer mode configuration in host mode for isochronous and bulk transfers.
  - ll_usb.h: use correct macro to clear RXBD register block numbers.
  - hcd.h: update delay before reading RXBD register.
  - hcd.c: prevent channel auto start of periodic interrupt transfer during NAK.
  - ll_usb.c: increase timeout value to allow core reset to complete.
- LL UTILS update
  - Fix a note about Ticks parameter.

## Known limitations

- USB HAL limitation: Double buffer mode is not functional with isochronous data transfers in host mode.

## Development Toolchains and Compilers

- IAR Embedded Workbench for ARM (EWARM) toolchain V8.50.9
- RealView Microcontroller Development Kit (MDK-ARM) toolchain V5.38
- STM32CubeIDE toolchain V1.14.0

## Supported Devices and boards

Supported Devices:

- STM32G0C1xx, STM32G0B1xx, STM32G0B0xx
- STM32G061xx, STM32G051xx, STM32G050xx
- STM32G081xx, STM32G071xx, STM32G070xx
- STM32G041xx, STM32G031xx, STM32G030xx

## Backward Compatibility

This release is compatible with the previous versions.

## Dependencies

V1.4.5 / 10-June-2022

## Main Changes

### Maintenance release

- General updates to fix known defects and enhancements implementation.
- HAL code quality enhancement for MISRA-C Rule-8.13 by adding const qualifiers

## Known limitations

- USB HAL limitation: Double buffer mode is not functional with isochronous data transfers in host mode.

## Development Toolchains and Compilers

- IAR Embedded Workbench for ARM (EWARM) toolchain V8.50.9
- RealView Microcontroller Development Kit (MDK-ARM) toolchain V5.31
- STM32CubeIDE toolchain (gcc9_2020_q2_update) v1.7.0

## Supported Devices and boards

Supported Devices:

- STM32G0C1xx, STM32G0B1xx, STM32G0B0xx
- STM32G061xx, STM32G051xx, STM32G050xx
- STM32G081xx, STM32G071xx, STM32G070xx
- STM32G041xx, STM32G031xx, STM32G030xx

## Backward Compatibility

This release is compatible with the previous versions.

## Dependencies

V1.4.4 / 01-April-2022

## Main Changes

### Maintenance release

- General updates to fix known defects and enhancements implementation.

- HAL/LL Drivers updates
  - HAL ADC updates
    - Update LL_ADC driver to prevent unused argument compilation warning.
    - Update to manage constraint: ADC must be disable to modify bitfields of register ADC_CFGR1 and ADC_CFGR2
    - In LL and HAL drivers, references to 3 ADC registers renamed to align on CMSIS and reference manual: {TR1, TR2, TR3} renamed {AWD1TR, AWD2TR, AWD3TR}.
  - HAL DAC updates
    - Add new HAL DAC APIs to start/stop conversion on both channels
      - HAL_DACEx_DualStart()
      - HAL_DACEx_DualStop()
  - HAL FLASH updates
    - Fix Wrong definition of FLASH operation error
      - HAL_FLASH_ERROR_OP value updated to FLASH_SR_OPERR instead of FLASH_SR_EOP
  - HAL/LL RCC updates
    - Enhance the PLL configuration in HAL_RCC_ClockConfig() API.
    - Add the following new APIs to check if PLL output mapped on different domain clock is enabled:
      - LL_RCC_PLL_IsEnabledDomain_ADC()
      - LL_RCC_PLL_IsEnabledDomain_I2S1()
      - LL_RCC_PLL_IsEnabledDomain_I2S2()
      - LL_RCC_PLL_IsEnabledDomain_RNG()
      - LL_RCC_PLL_IsEnabledDomain_FDCAN()
      - LL_RCC_PLL_IsEnabledDomain_USB()
      - LL_RCC_PLL_IsEnabledDomain_TIM1()
      - LL_RCC_PLL_IsEnabledDomain_TIM15()
      - LL_RCC_PLL_IsEnabledDomain_SYS()
    - Enhance the following APIs implementation to check the PLL output enable bit status:
      - LL_RCC_GetI2SClockFreq()
      - LL_RCC_GetTIMClockFreq()
      - LL_RCC_GetRNGClockFreq()
      - LL_RCC_GetADCClockFreq()
      - LL_RCC_GetUSBClockFreq()
  - HAL CEC updates
    - HAL code quality enhancement for MISRA-C Rule-8.13 by adding const qualifiers
  - HAL/LL TIM updates
    - Manage configuration of the Capture/compare DMA request source
    - Add related new exported constants (TIM_CCDMAREQUEST_CC, TIM_CCDMAREQUEST_UPDATE).
    - Create a new macro __HAL_TIM_SELECT_CCDMAREQUEST() allowing to program the TIMx_CR2.CCDS bitfield.
    - HAL code quality enhancement for MISRA-C Rule-8.13 by adding const qualifiers
    - __LL_TIM_CALC_PSC() macro update to round up the evaluate value when the fractional part of the division is greater than 0.5.
  - HAL LPTIM updates
    - Add check on PRIMASK register to prevent from enabling unwanted global interrupts within LPTIM_Disable() and LL_LPTIM_Disable()
    - HAL code quality enhancement for MISRA-C Rule-8.13 by adding const qualifiers
  - HAL UART updates
    - Add a check on the UART parity before enabling the parity error interruption.
    - Improve header description of UART_WaitOnFlagUntilTimeout() function
    - Add const qualifier for read only pointers.
    - Fix wrong cast when computing the USARTDIV value in UART_SetConfig().
    - HAL code quality enhancement for MISRA-C Rule-8.13 by adding const qualifiers
  - LL LPUART updates
    - TXFECF reference removed from LL LPUART driver.
  - HAL/LL USART updates
    - Add a check on the USART parity before enabling the parity error interrupt.
    - Improve header description of USART_WaitOnFlagUntilTimeout() function
    - Add const qualifier for read only pointers.
    - Fix compilation warnings generated with ARMV6 compiler
  - HAL IRDAL updates
    - Add a check on the IRDA parity before enabling the parity error interrupt.
    - Improve header description of IRDA_WaitOnFlagUntilTimeout() function
    - Add const qualifier for read only pointers.
    - Fix wrong cast when computing the USARTDIV value in IRDA_SetConfig().
  - HAL SMARTCARD updates
    - Improve header description of SMARTCARD_WaitOnFlagUntilTimeout() function
    - Add const qualifier for read only pointers.
    - Fix wrong cast when computing the USARTDIV value in SMARTCARD_SetConfig().
  - HAL I2C updates
    - Update to handle errors in polling mode.
      - Rename I2C_IsAcknowledgeFailed() to I2C_IsErrorOccurred() and correctly manage when error occurs.
    - Update to fix issue detected due to low system frequency execution (HSI).
    - Declare an internal macro link to DMA macro to check remaining data: I2C_GET_DMA_REMAIN_DATA
    - Timeout issue using HAL MEM interface through FreeRTOS
  - HAL SMBUS updates
    - Add the support of wake up capability.
    - Update to fix issue of mismatched data received by master in case of data size to be transmitted by the slave is greater than the data size to be received by the master.
      - Add flush on TX register.
  - HAL USB updates
    - HAL USB: fix Isochronous double buffer mode IN transfer issue
    - PCD: add supporting multi packets transfer on Interrupt endpoint
    - HAL: PCD: Set DCD timeout to minimum of 300ms before starting BCD primary detection process
    - HAL: PCD: software correction added to avoid unexpected STALL condition during EP0 multi packet OUT transfer.
  - LL UCPD updates
    - Correction of register accessed by LL_UCPD_ReadRxPaySize macro.
  - Documentation
    - "@ref" Doxygen tags removed from PDF User Manual

## Known limitations

- USB HAL limitation: Double buffer mode is not functional with isochronous data transfers in host mode.

## Development Toolchains and Compilers

- IAR Embedded Workbench for ARM (EWARM) toolchain V8.50.9
- RealView Microcontroller Development Kit (MDK-ARM) toolchain V5.31
- STM32CubeIDE toolchain (gcc9_2020_q2_update) v1.7.0

## Supported Devices and boards

Supported Devices:

- STM32G0C1xx, STM32G0B1xx, STM32G0B0xx
- STM32G061xx, STM32G051xx, STM32G050xx
- STM32G081xx, STM32G071xx, STM32G070xx
- STM32G041xx, STM32G031xx, STM32G030xx

## Backward Compatibility

This release is compatible with the previous versions.

## Dependencies

V1.4.3 / 15-December-2021

## Main Changes

### Maintenance release

- HAL/LL Drivers updates
  - HAL USB update
    - Footprint optimization in case USB double buffer mode not used, code protected with new define USE_USB_DOUBLE_BUFFER
    - Update to avoid multiple reads of USB ISR register
    - Add new API HAL_PCD_EP_Abort() to abort current USB endpoint transfer.
    - Adding support of Azure USBx middleware stack

## Known limitations

- USB HAL limitation: Double buffer mode is not functional with isochronous data transfers in host mode.

## Development Toolchains and Compilers

- IAR Embedded Workbench for ARM (EWARM) toolchain V8.50.9
- RealView Microcontroller Development Kit (MDK-ARM) toolchain V5.31
- STM32CubeIDE toolchain v1.7.0

## Supported Devices and boards

Supported Devices:

- STM32G0C1xx, STM32G0B1xx, STM32G0B0xx
- STM32G061xx, STM32G051xx, STM32G050xx
- STM32G081xx, STM32G071xx, STM32G070xx
- STM32G041xx, STM32G031xx, STM32G030xx ## Backward Compatibility

This release is compatible with the previous versions.

## Dependencies

V1.4.2 / 17-Juin-2021

## Main Changes

### Maintenance release

- General updates to fix known defects and enhancements implementation.

- HAL/LL Drivers updates

- HAL CEC update
  - Update HAL_CEC_IRQHandler() API to avoid appending an extra byte to the end of a message.
- HAL/LL SPI update
  - Fix MISRA-C 2012 Rule-13.2 error.
  - Update to set the FRXTH bit for 8bit data in LL_SPI_Init() API.
  - Update LL_SPI_TransmitData8() API to avoid casting the result to 8 bits.
- HAL RCC update
  - Update to fix HSI48 flag definition. Add missing STM32G0C1 specific MCO prescaler values to docstring. Update GetOscConfig() API to correct wrong HSIDiv value.
  - Add new API HAL_RCC_GetResetSource() to get all reset sources and clear flags for next reset.
- HAL DMA update
  - Update HAL_DMA_IRQHandler() API to set the DMA state before unlocking access to the DMA handle.
- HAL FLASH update
  - Clarification comment of the program type added to the HAL_FLASH_Program() and HAL_FLASH_Program_IT() APIs.
- HAL EXTI update
  - Update HAL_EXTI_GetConfigLine() API to set default configuration value of Trigger and GPIOSel before checking each corresponding registers.
- HAL/LL RTC update
  - Fix an error in IS_LL_RTC_MONTH leading to assert failure.
  - New APIs to subtract or add one hour to the calendar in one single operation without going through the initialization procedure (Daylight Saving):
    - HAL_RTC_DST_Add1Hour()
    - HAL_RTC_DST_Sub1Hour()
    - HAL_RTC_DST_SetStoreOperation()
    - HAL_RTC_DST_ClearStoreOperation()
    - HAL_RTC_DST_ReadStoreOperation()
  - DayLightSaving and StoreOperation interfaces from RTC_TimeTypeDef type and __HAL_RTC_DAYLIGHT_SAVING_TIME_ADD1H() and __HAL_RTC_DAYLIGHT_SAVING_TIME_SUB1H() macros are now deprecated.
- HAL CRYP update
  - Update HAL_CRYP_SetConfig() and HAL_CRYP_GetConfig() APIs to set/get the continent of KeyIVConfigSkip correctly. Resolve interrupt mode related GCM decryption issue causing wrong computation of decryption size. Update HAL_CRYP_InCpltCallback() API to fix an incorrect condition call at resumption time.
  - Update CRYP_AESCCM_Process_IT() API to manage header lengths in bytes or words when header length is less than 16 bytes.
- HAL COMP update
  - Update wait_loop_index computation so delay in us is always multiplicated by at least value “1”.
- HAL IWDG update
  - Update HAL_IWDG_Init() API in order to fix HAL_GetTick() timeout vulnerability issue.
- HAL/LL RCC update
  - Private functions made static.
  - Add missing STM32G0C1 specific MCO prescaler values to docstring.
  - Update to fix HSI48 flag definition.
  - Update GetOscConfig() API to correct wrong HSIDiv value.
  - Add LSI startup time in default IWDG timeout calculation (HAL_IWDG_DEFAULT_TIMEOUT).
  - Add new API HAL_RCC_GetResetSource() to get all reset sources and clear flags for next reset.
- HAL GPIO update
  - Update HAL_GPIO_Init() API to avoid the configuration of PUPDR register when Analog mode is selected.
- HAL I2C update
  - Update I2C_IsAcknowledgeFailed() API to avoid I2C in busy state if NACK received after transmitting register address.
- HAL SMBUS update
  - Add support for Fast Mode Plus to be SMBUS Rev3 compliant.
    - Add HAL_SMBUSEx_EnableFastModePlus() and HAL_SMBUSEx_DisableFastModePlus() APIs to manage Fm+.
- HAL RNG update
  - Update timeout mechanism to avoid false timeout detection in case of preemption.
- HAL UART update
  - Update HAL_UART_IRQHandler() API to handle receiver timeout interrupt.
  - Update UART receive processes (IT and DMA) to handle the UART receive’s timeout interrupt.
  - Fix erroneous UART’s handle state in case of error returned after DMA reception start within UART_Start_Receive_DMA().
  - Correction on UART ReceptionType management in case of ReceptionToIdle API are called from RxEvent callback.
  - Handling of UART concurrent register access in case of race condition between Tx and Rx transfers (HAL UART and LL LPUART).
  - Remove an invalid FIFO mode configuration from UART_SetConfig() as it is not is not member of UART_InitTypeDef Structure.
- HAL/LL USART update
  - Remove useless check on maximum BRR value by removing IS_LL_USART_BRR_MAX() macro.
  - LL_USART_ClockInit now supports clock phase and clock polarity configuration for SPI_Slave mode.
  - Handling of USART concurrent register access in case of race condition between Tx and Rx transfers.
  - Optimize stack usage for multiple APIs.
- HAL/LL TIM update
  - Update LL_TIM_GetCounterMode() API to return the correct counter mode.
  - Correct reversed description of TIM_LL_EC_ONEPULSEMODE One Pulse Mode.
  - Update HAL_TIMEx_OnePulseN_Start() and HAL_TIMEx_OnePulseN_Stop() APIs (polling and IT mode) to take into consideration all OutputChannel parameters.
  - Update timeout mechanism to avoid false timeout detection in case of preemption.
  - Update input capture measurement in DMA mode to avoid zero return values at high frequencies.
- HAL LPTIM update
  - Update HAL_LPTIM_Init() API implementation to configure digital filter for external clock when LPTIM is clocked by an internal clock source.
- HAL IWDG update
  - Update HAL_IWDG_Init() API in order to fix HAL_GetTick() timeout vulnerability issue.
  - Add LSI startup time in default IWDG timeout calculation (HAL_IWDG_DEFAULT_TIMEOUT).
- HAL/LL ADC update
  - Update wait_loop_index computation so delay in us is always multiplicated by at least value “1”.
  - Fix wrong internal regulator stabilization time to be aligned with the datasheet: 20us instead of 10us.
- HAL USB update
  - Add fix transfer complete for IN Interrupt transaction in single buffer mode.
  - stm32g0xx_hal_hcd.h/c updated to add #if #endif pre-processor directives for devices that do not support USB DRD feature.
  - Add fix transfer complete for IN Interrupt transaction in single buffer mode.

## Known limitations

- USB HAL limitation: Double buffer mode is not functional with isochronous data transfers in host mode.

## Development Toolchains and Compilers

- IAR Embedded Workbench for ARM (EWARM) toolchain V8.50.9
- RealView Microcontroller Development Kit (MDK-ARM) toolchain V5.31
- STM32CubeIDE toolchain v1.7.0

## Supported Devices and boards

Supported Devices:

- STM32G0C1xx, STM32G0B1xx, STM32G0B0xx
- STM32G061xx, STM32G051xx, STM32G050xx
- STM32G081xx, STM32G071xx, STM32G070xx
- STM32G041xx, STM32G031xx, STM32G030xx ## Backward Compatibility

This release is compatible with the previous versions.

## Dependencies

V1.4.1 / 25-February-2021

## Main Changes

### Patch release

Patch release of HAL and Low Layer drivers

Additional features

Headline
HAL FLASH driver update to support all STM32G0C1xx devices (with 128K dual bank and mono bank)

## Known limitations

- USB HAL limitation: Double buffer mode is not functional with isochronous data transfers in host mode.

## Development Toolchains and Compilers

- IAR Embedded Workbench for ARM (EWARM) toolchain V8.30.1
- RealView Microcontroller Development Kit (MDK-ARM) toolchain V5.29
- STM32CubeIDE toolchain v1.5.0

## Supported Devices and boards

Supported Devices:

- STM32G0C1xx, STM32G0B1xx, STM32G0B0xx
- STM32G061xx, STM32G051xx, STM32G050xx
- STM32G081xx, STM32G071xx, STM32G070xx
- STM32G041xx, STM32G031xx, STM32G030xx

## Backward Compatibility

This release is compatible with the previous versions.

## Dependencies

V1.4.0 / 29-October-2020

## Main Changes

### Maintenance release and Product Update

Official release of HAL and Low layers drivers introducing STM32G0C1xx/STM32G0B1xx/STM32G0B0xx devices and STM32G061xx/STM32G051xx/STM32G050xx devices.

Maintenance release of HAL and Low layers drivers supporting STM32G041xx/STM32G031xx/STM32G030xx and STM32G081xx/STM32G071xx/STM32G070xx devices.

New supported IP on STM32G0C1xx/B1xx/B0xx devices
CRS
DMA2
FDCAN
FLASH DUAL BANK
USB

New instances/features on STM32G0C1xx/B1xx/B0xx devices (not exhaustive)
I2C3, SPI3, LPUART2, USART5, USART6, COMP3, TIM4, TAMPER3, WAKEUP_PIN5, MCO2, PVM/VDDIO2, HSI48

New supported IP on STM32G061xx/G051xx/50xx devices
COMP1, COMP2
DAC
TIM6, TIM7, TIM15

Fixed bug list

Headline
[Codespell] Correct misspelled words in HAL/LL drivers
[ADC] Typo correction in comments
[ADC] HAL ADC value from channel TempSensor wrong at 1st read
[ADC] LL [GithHub][HAL_LL] Issue with ‘register’ storage class specifier, should be removed
[ADC] ADC must manage CCRDY flag during configuration
[ADC] Robustness improvement - Parameter SequencerLength can be discarded depending on sequencer config
[ADC] Create two functions to ease configuration of internal channels
[ADC] ADC AUTDLY and DMA
[COMP] LL [GithHub][HAL_LL] Issue with ‘register’ storage class specifier, should be removed
[COMP] Improve PDF document generation
[COMP] HAL wrong PINS described in comment for COMPx_INM
[COMP] Fix MISRA C 2012 issues : MISRAC2012-Rule-10.4
[CRYP] Correction for Official NIST CCM test pattern enciphering failing when header length is null
[CRYP] GCM/GMAC/CCM data header feed in DMA mode
[CRYP] Fix CRYP HAL driver to manage GCM header lengths not multiple of 4 bytes in 8-bit, 16-bit and 32-bit data types.
[CRYP] GCM: handling of AUD with size not multiple of 4 bytes not properly handle in CRYP_AESGCM_Process_IT
[CRYP] Misleading API comments related to data length
[CRYP] Restriction regarding size field on HAL_CRYP_Encrypt_DMA, HAL_CRYP_Decrypt_DMA API
[CRYP][Doc] Move ASCII table outside the files header
[CRYP] Code Sonar issue detected in HAL_CRYP_Resume
[CRYP] Resumption issue when an authentication algorithm suspends another authentication algorithm
[CRYP] Payloads sum not saved in case of suspend / resume of GCM ciphering - API update
[CRYP] AES GCM: Need to support data encrypt/decrypt with length not multiple of 16 bytes - API update
[CRYP] AES GCM: handling of ADD with size not multiple of 4 bytes - API update
[CRYP][MISRA C:2012] Fix warnings affecting rules 2.2_c, 10.1_R6, 10.3, 10.4_a, 10.6, 12.1, 13.5 15.7 - API update
[CRS] Wrong value for CRS_HSI48CALIBRATION_DEFAULT
[DMA] LOCK UNLOCK process to modify, as LOCK is done at Start and UNLOCK is done at Completion processus
[DMA] Exti interrupt doesn’t need to be enabled when it used as the DMAMUX synchronization
[DMAMUX] correct warning during chm generation
[DMA] LL_DMA_ClearFlag_GIx : add text informing user not to clear GIx when channel on
[DMA] two requests are missing for TIM16 and TIM17 (i.e. renaming according to RM)
[EXTI] Use of LINE as a macro parameter conflicts with standard C usage
[FLASH] Correction in macro __HAL_FLASH_GET_FLAG
[FLASH] Use CMSIS feature switches instead of devices switches to define OPTIONBYTE_ALL & OB_USER_ALL
[FLASH] Wrong ECC management in HAL FLASH driver
[FLASH] Move FLASH_SIZE define from hal flash.h to cmsis device file
[G0 512K][FLASH] Remove FLASH_FLAG_ALL_ERRORS
[G0 512K][FLASH] Add new API for dual bank, new option bytes
[G0 512K][FLASH] Update to handle swap bank in pcrop config and implement sticky2 area
[HAL] Replace devices switches by CMSIS feature switch when possible
[HAL] Add FDCAN & USB (HCD/PCD) inclusion in hal_conf_template.h
[HAL] HAL - Tick priority handling in HAL_Init_Tick() is TIM/RTC time base template
[HAL] [McuAStyle] - HAL and LL code update for obvious rules violation
[LL GENERIC] Support of new ARM compiler Keil V6 (AC5-like warnings mode)
[HAL GENERIC] Use all G0 Family common Timer in stm32g0xx_hal_timebase_tim_template.h
[HAL GENERIC] Correct regression on HAL_SetTickFreq
[HAL GENERIC][MISRA C 2012] uwTickFreq cast in (uint32_t) in HAL_InitTick() to avoid MISRA issue
[HAL GENERIC] Add new API HAL_GET_PENDING_IT() to determine interrupt source per line
[GPIO] HAL - Update initialization sequence in HAL_GPIO_Init to avoid a glitch (Sw workaround)
[GPIO] LL - LL_GPIO_Init() generate undesired pulse
[GPIO] HAL - bug on HAL_GPIO_TogglePin: doesn’t allow toggle multiple pin
[GPIO-LL] Correct issue with LL_GPIO_TogglePin function
[GPIO] HAL_GPIO_DeInit() bug on EXTI management
[I2C] LL - [GithHub][HAL_LL] Issue with ‘register’ storage class specifier, should be removed
[I2C] I2C slave interrupt handling issue
[I2C][MISRAC2012-Rule-2.2_c] Value assigned to variable `tmpITFlags’ is never used
[I2C] Incorrectly enable interrupts in I2C_Enable_IRQ routine when InterruptRequest = I2C_XFER_CPLT_IT
[I2C] HardFault in I2C_DMAXferCplt
[I2C] Sequential transfer MAX_NBYTE_SIZE correspond to no reload
[I2C] Correct compilation Warning: variable "tmp" was set but never used
[I2C][CHM generation] @ref IS_xxx macro can’t be resolved since CMSIS file is not included
[IWDG] LL - IWDG start-up timeout insufficiently low
[LPTIM] Digital filter for external clock should be configured also when LPTIM is clocked by an internal clock source
[LPTIM] LPTIM related EXTI interrupts should be handled from within the driver
[PWR] HAL PVD API should me moved to extension file
[PWR] PWR_WAKEUP_PIN5 should be defined only if PWR_CR3_EWUP5 is defined
[RCC] RCC_CCIPR2_USBFSSEL renaming in RCC_CCIPR2_USBSEL
[RCC] Improve CHM/PDF Document generation
[RCC] LL - Add API LL_RCC_PLL_ConfigDomain_FDCAN(), LL_RCC_PLL_EnableDomain_FDCAN(), LL_RCC_PLL_DisableDomain_FDCAN()
[RCC] LL - STM32G0xx_ll_rcc.h bug with ADC clock selection
[RCC] LL - FW is missing some RCC LL defines for due to addition of RCC_CFGR_MCOPRE_3 & RCC_CFGR_MCOSEL_3 bits
[RCC] HAL - stm32g0xx_hal_rcc_ex.h #if (macro) -> #if defined(macro)
[RCC] HAL [MISRA C 2012] Correction for new warning MISRAC2012-Rule-15.7
[RCC] RCC_CCIPR2_CK48MSEL renaming in RCC_CCIPR2_USBFSSEL
[RCC] [McuAStyle] - HAL and LL code update for obvious rules violation
[RTC] LL/HAL - Issue with ‘register’ storage class specifier, should be removed
[RCC] Constants RCC_CFGR_ shall be removed from CMSIS
[RTC] wrong reference to RTC, use RTCx instead
[RTC] Correct RTC_HOURFORMAT12_PM definition
[RTC] Correction in HAL_RTC_GetAlarm() - wrong shift mask used to get TimeFormat
[RTC] Correction in HAL_RTCEx_TimeStampIRQHandler()
[SMARTCARD] HAL - No repetition after NACK is received in smartcard T=0
[SMARTCARD] remove SMARTCARD default PCLK1 clock source on USART2, since USART2 is a basic instance with no SMARTCARD.
[SMBUS] Implement SMBus "wrong PEC" fix in driver
[SMBUS] [MISRAC2012] struct __SMBUS_HandleTypeDef is wrongly used in all static functions
[SPI] Problematic timeout management inside SPI DMA xfer complete handler (interrupt context)
[SPI] Correct problematic timeout management inside SPI DMA xfer complete handler (interrupt context)
[SPI] HAL - Issue in 3wires communication (Need Disable / Enable SPI
[SPI] HAL - BaudRatePrescaler: Assert must not be call in Slave Motorola mode + Add Mask
[SPI] HAL - SPI Tx DMA request is disabled in Rx DMA transfer complete callback function
[SPI] HAL - [I2S] HAL_I2S_DMAStop doesn’t check the BSY flag as described in RM0390
[SPI] HAL - MISRA C 2012 - regression on I2S
[SPI] HAL - HAL_SPI_Receive doesn’t work after HAL_SPI_Transmit in half-duplex mode
[SPI] LL/HAL Issue with ‘register’ storage class specifier, should be removed
[SPI] SPI Tx DMA request is disabled in Rx DMA transfer complete callback function
[SPI] SPI driver unaligned data
[SYSCFG-HAL]The function LL_SYSCFG_EnableDBATT() shall be removed
[TIM] All HAL_TIM_xxx_Start functions systematically access the TIMx_SMCR register even though the TIMx instance cannot be used as slave timer
[TIM] TIM DMA burst mode should be enhanced
[TIM] Wrong references to TIM_DMABASE_AF1 and TIM_DMABASE_AF2
[TIM] HAL_TIM_DMABurst_(Read/Write)Stop returns HAL_ERROR when called while DMA transfer is completed
[TIM] LL/HAL Issue with ‘register’ storage class specifier, should be removed
[TIM] LL - COUNTERMODE defines are inverted for TIM_CR1_CMS in ll_tim.h
[TIM] HAL - Order of disabling in `HAL_TIM_IC_Stop_DMA` function
[TIM] Wrong instance parameter check in encoder mode - Replace IS_TIM_CC2_INSTANCE by IS_TIM_ENCODER_INTERFACE_INSTANCE
[TIM] Correct RepetitionCounter value
[TIM] Provide API to set and clear UIFREMAP
[TIM] Remove Useless define in ll_tim.h
[TIM] Bug in HAL libraries when using multiple DMA request to different channels of same timer
[UART] Implementation of HAL UART enhanced reception services (ReceptionToIdle) API update
[UART] LL/HAL Issue with ‘register’ storage class specifier, should be removed
[UART] HAL MISRA C 2012 - regression on UART
[UART] HAL Rework BRR register value computation in HAL_UART_Init() for ROM size gain
[UART] Add Receiver Timeout to UART HAL flags and IRQ macros
New functions added:
void HAL_UART_ReceiverTimeout_Config(UART_HandleTypeDef *huart, uint32_t TimeoutValue)
HAL_StatusTypeDef HAL_UART_EnableReceiverTimeout(UART_HandleTypeDef *huart)
HAL_StatusTypeDef HAL_UART_DisableReceiverTimeout(UART_HandleTypeDef *huart)
New definition HAL_UART_ERROR_RTO, UART_FLAG_RTOF, UART_IT_RTO, UART_CLEAR_RTOF
New macro IS_UART_RECEIVER_TIMEOUT_VALUE()
[UART] Deadlock scenario while mixing polling Transmit and IT Receive requests
[USART] Fix typos introduced in some APIs descriptions
[USART] [CHM documentation] @ref IS_xxx macro can’t be resolved since CMSIS file is not included
[USART] LL/HAL Issue with ‘register’ storage class specifier, should be removed
[USART][CHM documentation] @ref IS_xxx macro can’t be resolved since CMSIS file is not included
[VREFBUF] G0 Family has only one VREBUF calibration point, Range 1
[WWDG] HAL Correct header to improve PDF generation
[UCPD] LL Allow UCPD HBIT Clock divider and prescaler configuration
[UCPD] Change default values for CFGR1 registers
[UCPD] Missing defines for UCPD in UM2570
[UCPD] LL_UCPD_IMR_RXERR should be removed
[UTILS] Turn UTILS_SetFlashLatency() into public function
[UTILS] Rename UTILS_SetFlashLatency() into LL_SetFlashLatency()

## Known limitations

- USB HAL limitation: Double buffer mode is not functional with isochronous data transfers in host mode.

## Development Toolchains and Compilers

- IAR Embedded Workbench for ARM (EWARM) toolchain V8.30.1
- RealView Microcontroller Development Kit (MDK-ARM) toolchain V5.29
- STM32CubeIDE toolchain v1.5.0

## Supported Devices and boards

Supported Devices:

- STM32G0C1xx, STM32G0B1xx, STM32G0B0xx
- STM32G061xx, STM32G051xx, STM32G050xx
- STM32G081xx, STM32G071xx, STM32G070xx
- STM32G041xx, STM32G031xx, STM32G030xx

## Backward Compatibility

This release is compatible with the previous versions.

## Dependencies

V1.3.0 / 25-June-2019

## Main Changes

### Maintenance release

Maintenance release of HAL and Low layers drivers supporting STM32G041xx/STM32G031xx/STM32G030xx and STM32G081xx/STM32G071xx/STM32G070xx devices.

Fixed bugs list

Headline
[FLASH HAL] Add Missing clear of End Of Operation flag in HAL FLASH_WaitForLastOperation() function
[GPIO HAL] Correct issue on EXTI management in HAL_GPIO_DeInit()
[IWDG] Update comments ti improve document generation
[RNG HAL] Correct wrong bits used for Seed and Clock errors detection (CEI and SEI)
[RNG] Add new definition for RNG error type : HAL_RNG_ERROR_BUSY, HAL_RNG_ERROR_SEED, HAL_RNG_ERROR_CLOCK
[RNG] Update comments area to reflect Data Ready status behavior
[SYSCFG LL] Correct wrong bit definition used for LL_SYSCFG_UCPD2_STROBE
[TIM HAL] Master Slave Mode (MSM) configurable: add @note in TIM_MasterConfigTypeDef
[TIM HAL] Configure fast mode for One pulse mode: add new __HAL_TIM_DISABLE_OCxFAST() & __HAL_TIM_ENABLE_OCxFAST() macros
[TIM HAL] Configure IT for break and dead-time API: add @note HAL_TIMEx_ConfigBreakDeadTime()
[TIM HAL] Remove useless uint16_t cast when clearing bit
[USART/UART/IRDA/SMARTCARD HAL] Correction to avoid using macros with function calls as argument in PPP_SetConfig()
[USART/UART/IRDA/SMARTCARD HAL] Fix minor doxygen issues to improve CHM document generation
[USART/UART/IRDA HAL] Improve API description in HAL_PPP_Transmit/Receive() and HAL_PPP_Transmit/Receive()
[IRDA/SMARTCARD HAL] In PPP_HandleTypeDef, ErrorCode field is now declared in volatile (__IO added)
[USART LL] Update Macros __LL_USART_DIV_SAMPLING8() and __LL_USART_DIV_SAMPLING16 to use uint32_t
[USART LL] Change USART_PRESCALER_TAB[] table definition from uint16_t to uint32_t
[USART LL] [MISRAC2012-Rule-18.1_b/d] array out of bounds in LL_USART_SetBaudRate()
[SMARTCARD HAL] [MISRAC2012-Rule-13.5] The right-hand operand of a logical && or || operator shall not contain side effects

## Development Toolchains and Compilers

- IAR Embedded Workbench for ARM (EWARM) toolchain V8.20.2
- RealView Microcontroller Development Kit (MDK-ARM) toolchain V5.25
- System Workbench STM32 (SW4STM32) toolchain V2.7.2

## Supported Devices and boards

Supported Devices:

- STM32G081xx, STM32G071xx, STM32G070xx
- STM32G041xx, STM32G031xx, STM32G030xx

## Backward Compatibility

This release is compatible with the previous versions.

## Dependencies

V1.2.0 / 05-April-2019

## Main Changes

### Maintenance release and product update

First release of HAL and Low layers drivers to introduce support of STM32G041xx/STM32G031xx/STM32G030xx devices.

Maintenance release of HAL and Low layers drivers supporting STM32G081xx/STM32G071xx/STM32G070xx devices.

Additional features

Headline
HAL, LL Drivers update to support STM32G041xx, STM32G031xx, STM32G030xx

Fixed bugs list

Headline
[HAL] Correct possible issue within HAL_SetTickFreq()function
[HAL RCC] Use variable uwTickPrio instead TICK_INT_PRIORITY to not overwrite Tick priority
[HAL RCC] Use LL macro __LL_RCC_CALC_PCLK1_FREQ() in HAL_RCC_GetPCLK1Freq() to solve misra c 2012 issues
[LL ADC] LL function LL_ADC_SetCommonFrequencyMode() is useless in STM32G0, kept for legacy purpose.
[HAL DAC] Rename HAL_DAC_MSP_INIT_CB_ID/HAL_DAC_MSP_DEINIT_CB_ID in HAL_DAC_MSPINIT_CB_ID/HAL_DAC_MSPDEINIT_CB_ID
[HAL DAC] Internal function DAC_DMAConvCpltCh1(), DAC_DMAErrorCh1(), DAC_DMAHalfConvCpltCh1() moved to hal_dac_ex.c
[HAL DAC] Use DAC driver define instead of CMSIS bit to check if software trigger enabled in HAL_DAC_Start()
[HAL FLASH] HAL flash driver improvement : typo, comments correction, add U suffix, used CMSIS define instead of hard coded value, use HAL macro instead of direct register access
[HAL FLASH] Clear FLASH_IT_ECCC flag when disabling End of Operation and Error interrupts in HAL_FLASH_IRQHandler()
[HAL GPIO] Correct compilation warning with new IAR 8.30.1 in IS_GPIO_PIN() macro
[HAL GPIO] Enhance re-entrance robustness for HAL_GPIO_TogglePin() API
[LL PWR] Correct definition of LL_PWR_MODE_STOP0 and LL_PWR_MODE_STOP1
[LL PWR] Correct definition of registers address-based accesses, which MUST be volatile
[HAL RTC] Add management of INITF flag rising occurrence too early when entering init mode
[HAL RTC] Correct WUTWF flag management in HAL_RTCEx_SetWakeUpTimer() API
[HAL RTC] Rename RTC_IT_MASK into RTC_FLAG_MASK
[HAL RTC] Replace hard coded values by CMSIS _Pos definition
[HAL TIM] Align DMA Burst defines with the reference manual: Add TIM_DMABASE_TISEL definition
[LL TIM] Remove parenthesis on REG parameter in LL_LPTIM_WriteReg() and LL_LPTIM_ReadReg() to avoid compilation failure after MISRA correction
[HAL DMA] Add clean of Callbacks in HAL_DMA_DeInit() and remove it from HAL_DMA_Init()

## Development Toolchains and Compilers

- IAR Embedded Workbench for ARM (EWARM) toolchain V8.20.2
- RealView Microcontroller Development Kit (MDK-ARM) toolchain V5.25
- System Workbench STM32 (SW4STM32) toolchain V2.7.2

## Supported Devices and boards

Supported Devices:

- STM32G081xx, STM32G071xx, STM32G070xx
- STM32G041xx, STM32G031xx, STM32G030xx

## Backward Compatibility

This release is compatible with the previous versions.

## Dependencies

V1.1.0 / 06-February-2019

## Main Changes

### Maintenance release and product update

Maintenance release of HAL and Low layers drivers to support STM32G071xx/STM32G081xx/STM32G070xx devices.

Additional features

Headline
MISRAC2012 implementation in CEC/CRYP/WWDG/RNG/I2S/SPI/UTILS/IWDG/USART/UART/I2C

Fixed bugs list

Headline
[LL ADC] compilation warning in stm32g0xx_ll_adc.h with MDK-ARM
[LL ADC] Wrong commentary in stm32g0xx_ll_adc.h
[LL ADC] missing to fill ADC_CFGR2_CKMODE in LL_ADC_Init ()
[LL ADC] redefinition of registers address MUST be volatile (_IO)
[LL ADC] Potential infinite wait in while loop of LL_ADC_DeInit()
[ADC] Embedded SW code comments or document must use ‘’Peripheral’’ rather than ‘’IP’’
[LL COMP] redefinition of registers address MUST be volatile (_IO)
[HAL CYRP] Support several call to decrypt API without initialize Key and IVR - API update
[HAL CRYP] Add possibility to not set key in HAL CRYP interface
[LL DMA] IS_LL_DMA_PERIPHREQUEST macro is not aligned with the max number of request
[FLASH][MISRAC2012-Rule-8.5_b] Multiple declarations of externally-linked object
[FLASH]Program DoubleWord fails (PGAERR) when using STRD assembly instruction
[I2C][MISRAC2012] MISRAC2012-Rule-2.2c and 17.8 when ITFlags is modified
[HAL I2C] Issue using HAL_I2C_Slave_Sequential_Receive_DMA, STOPF arrives too early versus DMA cplt message
[LL RCC] Correct EXTERNAL_CLOCK_VALUE
[HAL RCC][CodeSonar] HAL_RCCEx_GetPeriphCLKFreq - Useless Assignment
[HAL RCC] MCU hangs after some stop/wakeup cycles
[HAL RCC] __HAL_RCC_PLLxx_CONFIG() macros shall preserve output clock(s) enable state
[LL UART][CodeSonar] Cast alter value (LL_LPUART_ReceiveData8)
[LL UART][CodeSonar] Uninitialized Variable (LL_LPUART_GetBaudRate)
[LL USART][CodeSonar] Cast alter value (LL_USART_ReceiveData8)

## Supported Devices and boards

Supported Devices:

- STM32G081xx
- STM32G071xx
- STM32G070xx

## Backward Compatibility

This release is compatible with the previous versions.

## Dependencies

V1.0.0 / 26-October-2018

## Main Changes

### First release

First official release of HAL and Low layers drivers to support STM32G071xx/STM32G081xx/STM32G070xx

## Supported Devices and boards

Supported Devices:

- STM32G081xx
- STM32G071xx
- STM32G070xx

## Dependencies