Release Notes for STM32G4xx HAL Drivers

Copyright © 2019 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

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 reusability 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:

Update History

Main Changes

Maintenance Release

  • Add support for STM32G491xx and STM32G4A1 part numbers
  • General updates to fix known defects and enhancements implementation

  • HAL/LL GPIO update
    • Enhancement GPIO_TogglePin API to allow the toggling of many pins
    • Update GPIO initialization sequence to avoid unwanted pulse on GPIO Pin’s
  • HAL/LL HRTIM update
    • Constants renaming:
      • Rename HAL constants HRTIM_TIMEEVENT_… and HRTIM_TIMEEVENTRESETMODE_… respectively HRTIM_EVENTCOUNTER_… and HRTIM_EVENTCOUNTER_RSTMODE_… to reflect their relation to external event counters.
      • Rename LL constants LL_HRTIM_OUTPUTSET_TIM… and LL_HRTIM_OUTPUTRESET_TIM… to make them compliant to the CMSIS bits definitions they correspond to.
      • Warning: Possible compatibility break with CubeMX 5.6.0 and previous versions!
    • Constants removal:
      • Remove unused HAL constants HRTIM_RSYNCUPDATE_… and HRTIM_TIMEEVENTCOUNTER_….
      • Remove unused LL constant LL_HRTIM_RESETTRIG_OTHER5_CMP4 as the definition it corresponds to (HRTIM_RSTR_TIMFCMP4) exists neither in the CMSIS nor in the reference manual.
  • HAL/LL I2S update
    • Update HAL_I2S_DMAStop() API to be more safe
      • Add a check on BSY, TXE and RXNE flags before disabling the I2S
    • Update HAL_I2S_DMAStop() API to fix multi-call transfer issue(to avoid re-initializing the I2S for the next transfer).
      • Add __HAL_I2SEXT_FLUSH_RX_DR() and __HAL_I2S_FLUSH_RX_DR() macros to flush the remaining data inside DR registers.
      • Add new ErrorCode define: HAL_I2S_ERROR_BUSY_LINE_RX
  • HAL/LL SPI update
    • Update HAL_SPI_Init() API
      • To avoid setting the BaudRatePrescaler in case of Slave Motorola Mode
      • Use the bit-mask for SPI configuration
    • Update Transmit/Receive processes in half-duplex mode
      • Disable the SPI instance before setting BDIOE bit
    • Update SPI_DMAReceiveCplt() API to handle efficiently the repeated transfers.
      • Disable TX DMA request only in bidirectional receive mode.
    • Fix wrong timeout management
      • Calculate Timeout based on a software loop to avoid blocking issue if Systick is disabled
  • HAL SAI update
    • Update HAL_SAI_Init() API to correct the formula in case of SPDIF is wrong
  • HAL/LL ADC update
    • Update Channel & external trigger to support STM32G491/STM32G4A1 embedded with 3 ADC:
      • IS_ADC_EXTRIG, IS_ADC_CHANNEL, IS_ADC_EXTRIGINJ, ADC_IS_INDEPENDENT.
      • IS_LL_ADC_REG_TRIG_SOURCE, IS_LL_ADC_INJ_TRIG_SOURCE, __LL_ADC_IS_CHANNEL_INTERNAL_AVAILABLE.
    • Update note in ll_adc.h & hal_adc.h to highlight that the ADC with transfers DMA and ADC mode auto delay can work simultaneously.
  • HAL COMP update
    • Update Blanking sources to support STM32G491/STM32G4A1 embedded with 4 COMP:
      • IS_COMP_BLANKINGSRC_INSTANCE
  • HAL OPAMP update
    • Update hal_opamp_ex.c to support STM32G491/STM32G4A1 embedded with 4 OPAMP (OPAMP1/OPAMP2/OPAMP3/OPAMP6):
  • HAL FLASH update
    • Update FLASH Latency comment param to list all supported flash latency values.
    • Update FLASH_PAGE_NB to return the right page number(256 pages for devices embedded with 512KB flash size and 64 for devices embedded with 128KB flash size)
  • HAL/LL RCC update
    • Update Table 1. HCLK clock frequency for STM32G4xx devices to be aligned with referance manual RM0440
    • Update peripheral clock to support STM32G491/STM32G4A1 devices:
      • HAL_RCCEx_GetPeriphCLKConfig
      • IS_RCC_PERIPHCLOCK
  • HAL/LL TIM driver
    • Align HAL/LL TIM driver with latest updates and enhancements
    • Add new macros to enable and disable the fast mode when using the one pulse mode to output a waveform with a minimum delay
      • __HAL_TIM_ENABLE_OCxFAST() and __HAL_TIM_DISABLE_OCxFAST().
    • Update HAL_TIMEx_MasterConfigSynchronization() API to avoid functional errors and assert fails when using some TIM instances as input trigger.
      • Replace IS_TIM_SYNCHRO_INSTANCE() macro by IS_TIM_MASTER_INSTANCE() macro.
      • Add IS_TIM_SLAVE_INSTANCE() macro to check on TIM_SMCR_MSM bit.
    • Remove ‘register’ storage class specifier from LL TIM driver.
    • Add new API HAL_TIM_DMABurst_MultiWriteStart() allowing to configure the DMA Burst to transfer multiple Data from the memory to the TIM peripheral
    • Add new API HAL_TIM_DMABurst_MultiReadStart() allowing to configure the DMA Burst to transfer Data from the TIM peripheral to the memory
  • HAL/LL UART driver
    • 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 BRR calculation for ROM size gain
    • Remove ‘register’ storage class specifier from LL UART driver.
  • HAL/LL USART driver
    • Remove ‘register’ storage class specifier from LL USART driver.
  • HAL/LL USB driver
    • Fix USB Bulk transfer double buffer mode
    • Remove register keyword from USB defined macros as no more supported by c++ compiler
    • minor rework USBD_Start and USBD_Stop API, stop device to be handled by HAL_PCD_DeInit()
    • Correct some word spelling issues

Development Toolchains and Compilers

  • IAR Embedded Workbench for ARM (EWARM) toolchain V8.40.1
  • RealView Microcontroller Development Kit (MDK-ARM) toolchain V5.29
  • STM32CubeIDE toolchain V1.4.0

Supported Devices

  • STM32G431/41xx
  • STM32G471xx
  • STM32G473/83xx
  • STM32G474/84xx
  • STM32G491/A1xx

Main Changes

Maintenance Release

  • General updates to fix known defects and enhancements implementation

  • HAL/LL CRYP update
    • Correct MISRA C:2012 warnings reported by rules 2.2_c, 10.1_R6, 10.3, 10.4_a, 10.6, 12.1, 13.5 15.7
    • Perform a new check mechanism on the cryp buffer size in Encryption et Decryption API
      • Add IS_CRYP_BUFFERSIZE() macro
    • Clean up the HAL_CRYP_Resume() API to avoid infinite loop due to an early interruption during resumption process
      • Remove __HAL_CRYP_ENABLE_IT() and __HAL_CRYP_ENABLE() API .
    • Add new parameter in the CRYP_HandleTypeDef structure
      • Add SizesSum_saved to save the SizesSum when processing is suspended
      • Update the HAL_CRYP_Suspend() and HAL_CRYP_Resume() API by adding this new parameter
    • Add missing interruptions re-enabling operations following an all flags clear-up in the CRYP_PhaseProcessingResume() API
    • Support AAD with all possible byte sizes, not only multiple of 4 bytes
      • Update CRYP_GCMCCM_SetHeaderPhase() API
      • Add new parameter HeaderWidthUnit in the CRYP_ConfigTypeDef structure which contains the Cryp Header Width Unit
      • Add new definition of the CRYP Header size Unit
        • CRYP_HEADERWIDTHUNIT_WORD
        • CRYP_HEADERWIDTHUNIT_BYTE
    • Support data encryption and decryption with length not only multiple of 16 bytes
      • Update IS_CRYP_BUFFERSIZE() macro
      • Update AES functions : CRYP_AES_ProcessData() / CRYP_AES_IT() / CRYP_AESCCM_Process() / CRYP_AESGCM_Process_DMA()
      • Update CRYP_GCMCCM_SetPayloadPhase_IT() API
  • HAL/LL FMAC update
    • General updates to comply to internal coding rules.
  • HAL GPIO update
    • Update the GPIO initialization sequence in HAL_GPIO_Init() API to avoid unwanted glitches on GPIO pins.
    • Add missing GPIO Alternate Function definitions:
      • GPIO_AF2_TIM16, GPIO_AF9_TIM8, GPIO_AF11_TIM8, GPIO_AF12_TIM1.
  • HAL HRTIM update
    • Update HAL_HRTIM_WaveformCompareConfig() to clear HRTIM_TIMxCR.DELCMP bitfield when the auto-delayed protection mode is disabled.
    • Correct some “HRTIM_OUTPUTSET_TIMxx” constant names which are not compliant with Timer Events Mapping specified in the reference manual
      • Remove HRTIM_OUTPUTSET_TIMCEV1_TIMACMP1, HRTIM_OUTPUTSET_TIMEEV5_TIMDCMP2 , HRTIM_OUTPUTRESET_TIMCEV1_TIMACMP1 and HRTIM_OUTPUTRESET_TIMEEV5_TIMDCMP2
      • Add HRTIM_OUTPUTSET_TIMEEV5_TIMCCMP2 and HRTIM_OUTPUTSET_TIMCEV2_TIMACMP3 , HRTIM_OUTPUTRESET_TIMCEV2_TIMACMP3 and HRTIM_OUTPUTRESET_TIMEEV5_TIMCCMP2
      • Update HRTIM_OUTPUTSET_TIMCEV2_TIMACMP2 and HRTIM_OUTPUTRESET_TIMCEV2_TIMACMP2 definitions
    • Update HAL_HRTIM_DLLCalibrationStart() and HAL_HRTIM_DLLCalibrationStart_IT() API by setting HRTIM state ready to avoid some unstable behavior of the TIMER E.
    • Add new check field in the IS_HRTIM_EVENTSRC() macro to check also on EVENT
    • Add a new check in the HAL_HRTIM_EventConfig() API on event and event source through the IS_HRTIM_EVENTSRC() macro
    • Remove UPDGAT bits reset from the HRTIM_TimingUnitWaveform_Control() API
    • Add a lock and unlock handle process in the HAL_HRTIM_SimpleOCChannelConfig() API
  • HAL I2C update
    • Update 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
    • Fix HAL I2C slave interrupt handling issue with I2C sequential transfers.
      • Update I2C_Slave_ISR_IT() and I2C_Slave_ISR_DMA() APIs to check on STOP condition and handle it before clearing the ADDR flag
  • HAL LPTIM update
    • Add a polling mechanism to check on LPTIM_FLAG_XXOK flags in different API
      • Add LPTIM_WaitForFlag() API to wait for flag set.
      • Perform new checks on HAL_LPTIM_STATE_TIMEOUT.
    • Apply digital filter for external clock for all LPTIM clock source.
      • Update HAL_LPTIM_Init() API
    • Correct the input1source and input2source selection
      • Update LL_LPTIM_SetInput1Src and LL_LPTIM_SetInput2Src
        • Remove WRITE_REG and replace it by MODIFY_REG
  • HAL/LL RTC update
    • Update API HAL_RTC_SetAlarm_IT() to allow changing alarm time “on the fly” simply by calling the API again.
    • Update API LL_RTC_BKP_SetRegister() and API LL_RTC_BKP_GetRegister() to comply to rules 2.2 and 13.2 of MISRAC-2012.
  • HAL SPI update
    • Update the “Rx DMA transfer complete callback” to disable the Tx DMA request only in case of full-duplex mode and not it in half-duplex mode.
  • HAL TIM update
    • Update Encoder interface mode to keep TIM_CCER_CCxNP bits low
      • Add TIM_ENCODERINPUTPOLARITY_RISING and TIM_ENCODERINPUTPOLARITY_FALLING definitions to determine encoder input polarity.
      • Add IS_TIM_ENCODERINPUT_POLARITY() macro to check the encoder input polarity.
      • Update HAL_TIM_Encoder_Init() API
        • Replace IS_TIM_IC_POLARITY() macro by IS_TIM_ENCODERINPUT_POLARITY() macro.
    • Provide new API to set and clear UIFREMAP
      • Add new definition for TIM Update Interrupt Flag Remap
        • TIM_UIFREMAP_DISABLE
        • TIM_UIFREMAP_ENABLE
      • Add new macro in HAL driver to enable and desable the Update Interrupt Flag Remap
        • __HAL_TIM_UIFREMAP_ENABLE()
        • __HAL_TIM_UIFREMAP_DISABLE()/__HAL_TIM_GET_UIFCPY macro
      • Add new mechanism to check whether the update interrupt flag (UIF) copy is set or not
        • Add the __HAL_TIM_GET_UIFCPY() macro in the HAL driver
        • Add LL_TIM_IsActiveUIFCPY() API in the LL driver
      • Add new macro to check on the Update Interrupt Flag Remap mode
        • IS_TIM_UIFREMAP_MODE()
    • Remove useless TIM trigger selector
    • Fix bug when using multiple DMA request to different channels of same timer
      • Introduce DMA burst state management mechanism
        • Add a new structure for DMA Burst States definition : HAL_TIM_DMABurstStateTypeDef
        • Update __HAL_TIM_RESET_HANDLE_STATE to support DMABurstState
        • Add a new API HAL_TIM_DMABurstState() to get the actual state of a DMA burst operation
        • Add DMABurstState, the DMA burst operation state, in the TIM_HandleTypeDef structure
        • Add new API TIM_DMAErrorCCxN() for TIM DMA error callback (complementary channel)
        • Add new API TIM_DMADelayPulseNCplt() for TIM DMA Delay Pulse complete callback (complementary channel)
    • Implement TIM channel state management mechanism
      • Add new macro
        • TIM_CHANNEL_STATE_SET_ALL and TIM_CHANNEL_N_STATE_SET_ALL
        • TIM_CHANNEL_STATE_SET and TIM_CHANNEL_N_STATE_SET
        • TIM_CHANNEL_STATE_GET and TIM_CHANNEL_N_STATE_GET
      • Add new API HAL_TIM_GetActiveChannel()
      • Add new API HAL_TIM_GetChannelState() to get actual state of the TIM channel
      • Add a new structure for TIM channel States definition : HAL_TIM_ChannelStateTypeDef
      • Update __HAL_TIM_RESET_HANDLE_STATE to support ChannelState and ChannelNState
      • Add a new element in the TIM_HandleTypeDef structure : ChannelState to manage TIM channel operation stat.
      • Add a new element in the TIM_HandleTypeDef structure : ChannelNState to manage TIM complementary channel operation state
  • HAL/LL USART update
    • Add support to the Receiver Timeout Interrupt in the HAL_USART_IRQHandler
    • Fix wrong value for SlaveMode field in USART handle after HAL_USARTEx_DisableSlaveMode() call
      • Set USART_SLAVEMODE_DISABLE instead of USART_SLAVEMODE_ENABLE
  • HAL USB update
    • Improve USB endpoint out re-enabling with double-buffer mode.
  • LL UTILS update
    • API UTILS_SetFlashLatency() renamed LL_SetFlashLatency() and set exportable.
    • API LL_PLL_ConfigSystemClock_HSI() and API LL_PLL_ConfigSystemClock_HSE() updated to set back the AHB prescaler to 1 after it has been temporarily set to 2 to avoid undershoot when configuring PLL at high frequencies.

Development Toolchains and Compilers

  • IAR Embedded Workbench for ARM (EWARM) toolchain V8.32.3
  • RealView Microcontroller Development Kit (MDK-ARM) toolchain V5.27.1
  • STM32CubeIDE toolchain v1.3.0

Supported Devices

  • STM32G431/41xx
  • STM32G471xx
  • STM32G473/83xx
  • STM32G474/84xx

Main Changes

Maintenance Release

Maintenance release of HAL (Hardware Abstraction Layer) and LL (Low layers) drivers to support STM32G431/41xx, STM32G471xx, STM32G473/83xx and STM32G474/84xx.

Contents

Additional features and changes :
Headline
General: Support of device STM32G483xx in HAL and LL drivers
COMP: Suppress Deglitcher mode - Not supported on STM32G4 series
HAL: Change naming of the IRQn 2 to RTC_TAMP_LSECSS_IRQn
HRTIM: HRTIM_OUTPUTRESET_TIMAEVx renamed to HRTIM_OUTPUTRESET_TIMEVx
TIM: Add new macro to configure fast mode
TIM: Master Slave Mode (MSM) is now configurable
Bugs fix :
Headline
General : redefinition of registers with adjusted address MUST be volatile
DMA : DMA2 instance cannot be configured in LL drivers
GPIO: HAL_GPIO_DeInit() bug on EXTI management
GPIO: Compilation warning with IAR v8.30
HAL: Correct potential issue within HAL_SetTickFreq() function
HRTIM: HRTIM_TIMxCR.DELCMP isn’t systematically programmed
HRTIM: Fault source programming isn’t wrong in HAL_HRTIM_FaultConfig
HRTIM : Useless Assignment at function HAL_HRTIM_SimpleOCChannelConfig
RCC: Should not overwrite Tick priority
RTC: HAL_RTCEx_SetWakeUpTimer WUTWF management reworked to be aligned with Reference Manual
RTC: INITF can rise too early when entering init mode just after exiting
RTC : fix issue in define with STM32L4 LL RTC month macros
RTC : Remove ALRBWF and ALRAWF bits
TIM: CodeSonar warnings about useless assignment in HAL_TIMEx_ConfigBreakInput()

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

  • STM32G431/41xx
  • STM32G471xx
  • STM32G473/83xx
  • STM32G474/84xx

Main Changes

First release

First official release of HAL (Hardware Abstraction Layer) and LL (Low layers) drivers to support STM32G431/41xx, STM32G471xx, STM32G473/83xx and STM32G474/84xx.

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

  • STM32G431/41xx
  • STM32G471xx
  • STM32G473xx
  • STM32G474/84xx