Licensed by ST under BSD 3-Clause license (the "License"). You may not use this package except in compliance with the License. You may obtain a copy of the License at:
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 provides a 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 depends 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 functions for direct and atomic register access
One-shot operations that can be used by the HAL drivers or from application level
Full independence from HAL and standalone usage (without HAL drivers)
Full features coverage of all the supported peripherals
Update History
Main Changes
Patch release to fix known defects and enhancements implementation.
Contents
HAL updates
HAL EXTI update
Update HAL_EXTI_GetConfigLine() API to set default configuration value of Trigger and GPIOSel before checking each corresponding registers.
HAL GPIO driver
Update HAL_GPIO_Init() API to avoid the configuration of PUPDR register when Analog mode is selected.
HAL ADC update
Update timeout mechanism to avoid false timeout detection in case of preemption.
Update LL_ADC driver to prevent unused argument compilation warning.
HAL/LL DAC update
Fix compilation error when USE_DAC_REGISTER_CALLBACKS is activated.
Remove ‘register’ storage class specifier from LL DAC driver.
Update LL_ADC_DMA_GetRegAddr() API to prevent unused argument compilation warning.
Update HAL timeout mechanism to avoid false timeout detection in case of preemption.
HAL IWDG update
Update HAL_IWDG_Init() API in order to fix HAL_GetTick() timeout vulnerability issue.
HAL/LL RTC update
Update __RTC_…(__HANDLE__, …) macros to access registers through (__HANDLE__)->Instance pointer and avoid “unused variable” warnings.
Correct month management in IS_LL_RTC_MONTH() macro.
Update implementations of LL_RTC_BAK_SetRegister() and LL_RTC_BAK_GetRegister() to comply to MISRAC rule 17.4.
HAL TIM update
Update HAL_TIMEx_OnePulseN_Start and HAL_TIMEx_OnePulseN_Stop (pooling and IT mode) to take into consideration all OutputChannel parameters.
Update input capture measurement in DMA mode to avoid zero return values at high frequencies.
Correct reversed description of TIM_LL_EC_ONEPULSEMODE One Pulse Mode.
HAL LPTIM update
Update HAL_LPTIM_Init implementation to configure digital filter for external clock when LPTIM is clocked by an internal clock source.
HAL I2C update
Update I2C_IsAcknowledgeFailed() API to avoid I2C in busy state if NACK received after transmitting register address.
LL USART update
Remove useless check on maximum BRR value by removing IS_LL_USART_BRR_MAX() macro.
Handling of UART concurrent register access in case of race condition between Tx and Rx transfers (HAL UART and LL LPUART)
HAL SMBUS update
Add the support of wake up capability.
HAL/LL SPI update
Update to fix MISRA-C 2012 Rule-13.2
Update LL_SPI_TransmitData8() API to avoid casting the result to 8 bits.
HAL UART update
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).
HAL RNG update
Update timeout mechanism to avoid false timeout detection in case of preemption.
HAL USB_FS update
HAL PCD: add fix transfer complete for IN Interrupt transaction in single buffer mode.
Race condition in USB PCD control endpoint receive ISR.
Main Changes
General updates to fix known defects and enhancements implementation
Add new HAL EXTI driver
Add new HAL SMBUS extended driver to support SMBUS fast Mode Plus.
Remove HAL LPTIM Extended driver to move its contain to HAL LPTIM header file.
Correct MISRA-C 2012: Rule-10.5, Rule-10.4_a, Rule-2.7 and Rule-21.1
Remove useless casts
Contents
HAL driver
Update HAL driver to allow user to change systick period to 1ms, 10 ms or 100 ms:
Add the following new 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).
Update HAL_Init_Tick() API to proporely store the priority when using the non-default time base.
Add new defines for ARM compiler V6:
__weak
__packed
__NOINLINE
HAL/LL ADC update
Update HAL_ADC_Stop_DMA() API to check if DMA state is Busy before calling HAL_DMA_Abort() API to avoid DMA internal error.
Update LL_ADC_REG_Init() API to avoid enabling continuous mode and discontinuous mode simultaneously.
HAL/LL IWDG update
Update HAL_IWDG_DEFAULT_TIMEOUT define value to consider LSI value instead of hardcoded value
HAL/LL WWDG update
Update WWDG frequency, min and max timeout values
Update HAL WWDG driver description
HAL CORTEX update
Update IS_NVIC_PREEMPTION_PRIORITY macro in order to prevent PreemptPriority assert failure
HAL/LL PWR update
Reset bit ULP before entering in low power modes in case ULP=1 and EN_VREFINT = 1.
Update HAL_PWR_EnterSLEEPMode() and HAL_PWR_EnterSTOPMode() APIs
HAL/LL RTC update
Optimize HAL implementation Daylight saving feature to subtract or add one hour to the calendar in one single operation without going through the initialization procedure:
Update SPI Transmit/Receive APIs with assert for 8-bit.
Update SPI_DMAReceiveCplt() API to handle efficiently the repeated transfers.
Disable TX DMA request only in bidirectional receive mode
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
Fix wrong timeout management
Calculate Timeout based on a software loop to avoid blocking issue if Systick is disabled
Update to implement Erratasheet: BSY bit may stay high at the end of a data transfer in Slave mode.
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 SMBUS update
Add support of Fast Mode Plus to be SMBus rev 3 compliant.
Add HAL_SMBUSEx_EnableFastModePlus() and HAL_SMBUSEx_DisableFastModePlus() APIs to manage Fm+.
HAL/LL TIM update
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 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.
Update driver to handle channel state and DMA burst state independently allowing to use multiple DMA request with 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 HAL_TIM_DMABurstStateTypeDef enumeration
Add DMABurstState, the DMA burst operation state, to the TIM_HandleTypeDef structure
Implement TIM channel state management mechanism
Add new private macro
TIM_CHANNEL_STATE_SET_ALL
TIM_CHANNEL_STATE_SET
TIM_CHANNEL_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
Add HAL_TIM_ChannelStateTypeDef enumeration
Add ChannelState to the TIM_HandleTypeDef structure to manage TIM channel operation state
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.
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
Remove “register” “C” keyword: The register storage class specifier was deprecated in C++11 and removed in C++17
Correct inverted values of LL_TIM_COUNTERMODE_CENTER_DOWN and LL_TIM_COUNTERMODE_CENTER_UP
Remove extra DMABurst Base Addresses not consistent with reference manual
Move the TIM input remapping TIM3_TI4_GPIOC9_AF2 and TIM3_TI1_GPIO definition from USB section
Update LL_TIM_GetCounterMode() implementation to return adequate values to the routine expected ones.
LL LPTIM update
Fix typos introduced in some comments
Remove useless check on LPTIM2 instance introduced in the driver not consistent with the referance manual
Update HAL_LPTIM_Init implementation to configure digital filter for external clock when LPTIM is clocked by an internal clock source
Add a polling mechanism to check on LPTIM_FLAG_XXOK flags in different API
Add LPTIM_WaitForFlag() to wait for flag set.
Perform new checks on HAL_LPTIM_STATE_TIMEOUT.
HAL/LL IRDA update
Align HAL IRDA driver with latest updates and enhancements
Optimize HAL IRDA to avoid using macros as argument of function calls
Update description of “HAL_IRDA_Transmit_XXX”, “HAL_IRDA_Receive_XXX” APIs with more details about the data size management
HAL/LL SMARTCARD update
Update HAL_SMARTCARD_Transmit(), HAL_SMARTCARD_Transmit_IT(), HAL_SMARTCARD_Transmit_DMA() and SMARTCARD_EndTransmit_IT() APIs implementation to fix an issue when No repetition after NACK is received in smartcard T=0
Optimize HAL SMARTCARD to avoid using macros as argument of function calls
HAL/LL UART update
Implementation of ReceptionToIdle reception services enhancement
Align the HAL UART driver with latest updates and enhancements to support the new enhancement of ReceptionToIdle
Add HAL_UART_RxTypeTypeDef to the UART_HandleTypeDef structure to identify the type of ongoing Reception
Add UART Reception Event Callback registration features
Add HAL_UART_RegisterRxEventCallback, HAL_UART_UnRegisterRxEventCallback and HAL_UARTEx_RxEventCallback APIs
Add pUART_RxEventCallbackTypeDef pointer to a UART Rx Event specific callback function
Add a set of APIs specific to Reception to Idle transfer in different mode
Add HAL_UARTEx_ReceiveToIdle API to receive an amount of data in blocking mode till either the expected number of data is received or an IDLE event occurs.
Add HAL_UARTEx_ReceiveToIdle_IT() API to receive an amount of data in interrupt mode till either the expected number of data is received or an IDLE event occurs.
Add HAL_UARTEx_ReceiveToIdle_DMA() API to receive an amount of data in DMA mode till either the expected number of data is received or an IDLE event occurs.
Update impelmentation of HAL_UART_Receive(), HAL_UART_Receive_IT() and HAL_UART_Receive_DMA() to support the new enhancement of ReceptionToIdle
Add UART_Start_Receive_IT() to start Receive operation in interrupt mode
Add UART_Start_Receive_DMA() to start Receive operation in DMA mode.
Rework BRR register value computation in HAL_UART_Init() for code footprint size optimization
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.
Add RTO (Receiver Time Out) support to UART HAL flags and IRQ macros
Add HAL_UART_ERROR_RTO define of Receiver Timeout error to the UART Error Definition section
Add UART_FLAG_RTOF define of Receiver Timeout flag to the UART Flags section
Add UART_IT_RTO define of Receiver Timeout interruption to the UART interrupts definition
Add UART_CLEAR_RTOF define of Receiver Timeout clear flag to the UART Clear Flags section
Implementation of a new macro IS_UART_RECEIVER_TIMEOUT_VALUE to check the receiver timeout value
Add new APIs HAL_UART_DisableReceiverTimeout(), HAL_UART_DisableReceiverTimeout() to Enable/Disable the UART receiver timeout feature.
Add new API HAL_UART_ReceiverTimeout_Config() to update on the fly the receiver timeout value in RTOR register
Update HAL_UART_IRQHandler() to handle UART_ISR_RTOF flag and IT
LL LPUART update
Remove “register” “C” keyword: The register storage class specifier was deprecated in C++11 and removed in C++17
Align LL LPUART driver with latest updates and enhancements
HAL/LL USART update
Add RTO (Receiver Time Out) support to USART HAL flags and IRQ macros
Add HAL_USART_ERROR_RTO define of Receiver Timeout error to the USART Error Definition section
Add USART_FLAG_RTOF define of Receiver Timeout flag to the USART Flags section
Add USART_CLEAR_RTOF define of Receiver Timeout clear flag to the USART Clear Flags section
Update HAL_USART_IRQHandler to add support to the Receiver Timeout Interruption
Optimize HAL USART to avoid using macros as argument of function calls
Update description of “HAL_USART_Transmit_XXX”, “HAL_USART_Receive_XXX” APIs with more details about the data size management
Fix typos introduced in some APIs descriptions
Remove “register” “C” keyword: The register storage class specifier was deprecated in C++11 and removed in C++17
LL UTILS update
UTILS_SetFlashLatency() API renamed to LL_SetFlashLatency() and set exportable.
Main Changes
General updates to fix known defects and enhancements implementation
Contents
HAL Generic update
Add new template driver to configure timebase using TIMER :
stm32l0xx_hal_timebase_tim_template.c
HAL/LL GPIO update
Update GPIO initialization sequence to avoid unwanted pulse on GPIO Pin’s.
Update HAL_GPIO_TogglePin() API to improve robustness: allow multi Pin’s toggling
HAL/LL I2C update
Update HAL_I2C_ER_IRQHandler() API to fix acknowledge failure issue with I2C memory IT processes
Add stop condition generation when NACK occurs.
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
Update Sequential transfer APIs to adjust xfermode condition.
Replace hi2c->XferCount < MAX_NBYTE_SIZE by hi2c->XferCount <= MAX_NBYTE_SIZE which corresponds to a case without reload
HAL/LL USB driver
Bug fix: USB_ReadPMA() and USB_WritePMA() by ensuring 16-bits access to USB PMA memory
Bug fix: correct USB RX count calculation
Fix USB Bulk transfer double buffer mode
Remove register keyword from USB defined macros as no more supported by C++ compiler
Minor rework on USBD_Start() and USBD_Stop() APIs: stopping device will be handled by HAL_PCD_DeInit() API.
Remove non used API for USB device mode.
Main Changes
Patch release
Update of HAL driver to include latest corrections and ensure compatibility with legacy code.
The V1.10.2 version contains all the updates implemented in V1.10.1 version. For more details, please refer to the History.
Contents
HAL
Updated HAL_GetUID() functions to correct address offset.
Legacy
Updated stm32_hal_legacy.h file to add missing definitions and ensure compatibility with legacy code.
Main Changes
Patch release
Update of HAL FLASH, RCC and SPI drivers to include latest corrections
Contents
HAL RCC
Updated HAL_RCC_OscConfig() to add missing checks and to modify return status.
HAL FLASH
Updated HAL_FLASH_Unlock() and HAL_FLASH_OB_Unlock() to handle interrupts disabling.
Updated FLASH_OB_GetRDP() to return the correct RDP level.
HAL SPI
Updated HAL SPI driver to handle STM32L0 erratasheets.
Main Changes
Major maintenance release
Add support of new L0 Value Line devices
Add support of HAL callback registration feature
Add several enhancements implementation
Fix known defects to be aligned with others STM32 series
Contents
HAL/LL generic
Add support of HAL callback registration feature
The feature disabled by default is available for the following HAL drivers:
The feature may be enabled individually per HAL PPP driver by setting the corresponding definition USE_HAL_PPP_REGISTER_CALLBACKS to 1U in stm32l0xx_hal_conf.h project configuration file (template file stm32l0xx_hal_conf_template.h available from Drivers/STM32L0xx_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().
Updated HAL/LL Driver compliancy with MISRA C 2004 rules
MISRA C 2004 rules 10.4, 11.4, 12.4
Updated HAL/LL Driver compliancy with MISRA C 2012 rules
MISRA C 2012 rules 16.3, 17.4, 21.1
Corrected Doxygen tags in macros description to have generate correct CHM format.
stm32l0xx_hal_def.h
Updated file to avoid compiler warnings from __packed definitions.
Updated UNUSED() macro to fix compilation warning with g++ compiler.
Replaced include stdio.h by stddef.h.
Updated __RAM_FUNC define to not impose function type.
stm32l0xx_hal_conf_template.h
Updated default MSI_VALUE reset value set in SystemCoreClock.
Added USE_SPI_CRC definition to be aligned with SPI driver.
HAL
Added HAL_GetUIDw0(), HAL_GetUIDw1() and HAL_GetUIDw2() for 96-bit UID.
Modified default HAL_Delay implementation to guarantee minimum delay.
Add HAL_UART_RegisterCallback() and HAL_UART_UnRegisterCallback() APIs
Add callback identifiers in HAL_UART_CallbackIDTypeDef enumerated typedef
Add HAL_USART_RegisterCallback() and HAL_USART_UnRegisterCallback() APIs
Add callback identifiers in HAL_USART_CallbackIDTypeDef enumerated typedef
LL UTILS
Corrected LL_GetUID_Word2 function to fix error in UID flash location.
Fixed mismatch return type in LL_GetPackageType(void).
Update UTILS_MAX_FREQUENCY_SCALE3 value.
HAL USB
Aligned HAL USB driver with latest updates and enhancements.
Upgrade to USB Device Library v2.5.1.
HAL WWDG
ligned HAL WWDG driver with latest updates and enhancements.
dd callback registration feature
Add HAL_WWDG_RegisterCallback() and HAL_WWDG_UnRegisterCallback() APIs
Add callback identifiers in HAL_WWDG_CallbackIDTypeDef enumerated typedef
Main Changes
Internal release
Main Changes
Maintenance release
Contents
HAL/LL generic
Updated :
Removed DATE and VERSION fields from header files.
Updated CHM User Manual for Drivers/STM32L0xx_HAL_Driver.
LL ADC
Updated LL ADC driver to exclude __LL_ADC_CALC_TEMPERATURE macro for STM32L011xx devices.
HAL COMP
Updated HAL_COMP_Init manage default case as LPTIM1 for COMP1 and LPTIM2 for COMP2.
HAL/LL I2C
Replaced POSITION val notion by associated I2C_xxx_pos CMSIS definition.
Updated LL_I2C_Init() function to add condition to test the value of OwnAddress1 before calling the inline LL function LL_I2C_EnableOwnAddress1().
Updated implementation of I2C_TransferConfig() function.
HAL PCD
Removed the lock/unlock from HAL_PCD_EP_Receive/HAL_PCD_EP_Transmit functions.
Main Changes
Patch release
Contents
HAL LCD
Update of stm32l0xx_hal_lcd.h to avoid C++ compilation errors.
Main Changes
Maintenance release
Contents
HAL generic
Updated HAL Driver compliancy with MISRA C 2004 rules:
MISRA C 2004 rule 2.2 (source code shall only use /* */ style comments)
MISRA C 2004 rule 5.2 (tmpreg variable shall not be used inside MACRO)
MISRA C 2004 rule 10.3 (illegal explicit conversion from type unsigned int to uint16_t *)
MISRA C 2004 rule 10.4 (value of a complex expression of floating type shall only be cast to a floating type that is narrower or of the same size)
MISRA C 2004 rule 10.6 (U suffix applied to all constants of unsigned type)
MISRA C 2004 rule 12.6 (logical operators should not be confused with bitwise operators)
MISRA C 2004 rule 14.3 (a null statement shall only occur on a line by itself)
MISRA C 2004 rule 14.8 (statement forming the body of a switch, while, do while or for statement shall be a compound statement)
MISRA C 2004 rule 14.9 (if {expression} / else construct shall be followed by a compound statement)
MISRA C 2004 rule 19.10 (in function-like macro definition, each instance of a parameter shall be enclosed in parenthesis)
MISRA C 2004 rule 19.11 (all macro identifiers in preprocessor directives shall be defined before use)
MISRA C 2004 rule 19.15 (precautions shall be taken in order to prevent the contents of a header file being included twice)
HAL/LL ADC
Corrected ADC_SAMPLETIME_xCYCLE_5 naming to be aligned to reference manual.
Enabled management of low power auto-wait: flags must be cleared by user when fetching ADC conversion data.
Disabled DMA transfer during ADC calibration.
HAL CRC
Updated HAL_CRC_DeInit() function (restored IDR Register to Reset value).
HAL COMP
Updated HAL_COMP_Init() function to clear EXTI interrupt mode in case comparator is re-configured in mode trigger none.
Updated HAL_COMP_IRQHandler() function in window mode, so that both EXTI flags are cleared and HAL_COMP_TriggerCallback() function is called only once.
Updated HAL COMP init() function: VrefInt startup delay is taken into account, with delay of duration COMP_DELAY_VOLTAGE_SCALER_STAB_US.
Updated HAL_COMPEx_EnableVREFINT() by adding Wait Time.
HAL DMA
Provided new function HAL_DMA_Abort_IT() to abort current DMA transfer under interrupt mode without polling for DMA enable bit.
HAL FLASH
Updated HAL_FLASH_IRQHandler(), HAL_FLASHEx_Erase_IT(), HAL_FLASH_Program_IT(), and HAL_FLASHEx_Erase_IT() functions.
Renamed HAL_FLASHRAMFUNC_GetError() sto HAL_FLASHEx_GetError().
HAL GPIO
Updated IS_GPIO_PIN() macro to cover full u32 bits.
Updated HAL_GPIO_DeInit() function to configure GPIO port mode register to input state.
HAL I2C
Aligned HAL I2C driver with the new state machine definition.
Added support of repeated start feature with the following new APIs
HAL_I2C_Master_Sequential_Transmit_IT(), HAL_I2C_Master_Sequential_Receive_IT() and HAL_I2C_Master_Abort_IT(),
HAL_I2C_Slave_Sequential_Transmit_IT() and HAL_I2C_Slave_Sequential_Receive_IT()
HAL_I2C_EnableListen_IT() and HAL_I2C_DisableListen_IT()
New user callbacks HAL_I2C_ListenCpltCallback() and HAL_I2C_AddrCallback()
Reworked DMA end process and I2C error management during DMA transfer.
Updated WaitOnFlag management (timeout measurement should be always cumulative).
Optimized HAL_I2C_XX_IRQHandler() functions (read status registers only once).
Added error management in case of DMA transfer through HAL_DMA_Abort_IT() and DMA XferAbortCallback().
Updated HAL_I2CEx_EnableFastModePlus() enabling fast mode plus driving capability through CFGR2 register.
Disabled I2C_OARx_EN bit before any configuration in OAR1 or 2 in HAL_I2C_Init().
Add I2C_FIRST_AND_NEXT_FRAME for I2C Sequential transfer options: allow to manage a sequence with start condition, address and data to transfer without a final stop condition, an then permit a call to the same master sequential interface several times.
Updated HAL_I2C_Master_Sequential_Transmit_IT() function (wrong state check).
Updated I2C driver to reset state to LISTEN before calling HAL_I2C_Slave_Sequential_Transmit_IT() function.
HAL I2S
Updated LL_I2S_Init() function to use default ou computed values for prescaler.
HAL IWDG
Overall driver rework for better implementation
Removed HAL_IWDG_Start(), HAL_IWDG_MspInit() and HAL_IWDG_GetState() APIs.
HAL PWR
Added new HAL_PWREx_GetVoltageRange()function returning Voltage Scaling range, to be aligned with L1 serie.
HAL RCC
Aligned HAL RCC driver with others series.
Renamed RCC_PLLMUL_x to RCC_PLL_MULx and RCC_PLLDIV_x to RCC_PLL_DIVx, to be aligned with L1 serie.
Updated declaration of HAL_RCC_NMI_IRQHandler() function.
Updated HAL IRQHandler and callbacks API for CRS management.
HAL SMBUS
Aligned driver with others series: fix known defects and added several enhancements implementation.
Added support of new feature Zone Read/Write.
HAL SPI
Added missing __IO in SPI_HandleTypeDef definition.
HAL TIM
Corrected TIM22_ETR_GPIO and TIM22_ETR_LSE definitions for STM32L011xx and STM32L021xx devices.
HAL UART-USART / IRDA / SMARTCARD
Added missing __IO in UART/USART/IRDA/SMARTCARD_HandleTypeDef definition (for TxXferCount and RxXferCount).
Modified UART/SMARTCARD configuration sequence order in HAL_UART/SMARTCARD_Init() function, to avoid issue on Transmit line when UART/SMARTCARD_SetConfig() is called before UART/SMARTCARD_AdvFeatureConfig().
Removed RXNE check in UART/USART/IRDA/SMARTCARD_Receive_IT() function, as RXNE is already cleared by reading RDR, or by writing 1 to RXFRQ in the RQR register.
Reviewed UART/IRDA/SMARTCARD state machine to avoid cases where UART/IRDA/SMARTCARD state is overwritten by UART/IRDA/SMARTCARD IRQ.
Ensure proper alignment of data pointer in Transmit and Receive functions to avoid toolchain compilation hardfault.
Optimized WaitOnFlag management in HAL_UART/USART/IRDA/SMARTCARD_Transmit() function.
Optimized all HAL IRQ Handler routines.
Implemented new APIs for HAL UART/USART/IRDA/SMARTCARD Abort management: HAL_PPP_Abort(), HAL_PPP_AbortTransmit(), HAL_PPP_AbortReceive(), HAL_PPP_Abort_IT(), HAL_PPP_AbortTransmit_IT(), HAL_PPP_AbortReceive_IT().
Added definition of USART_STOPBITS_0_5 (in addition to 1, 1.5, 2 stop bits).
Updated USART_GETCLOCKSOURCE() macro definition in order to reflect USART instances availability on L0 devices.
Updated HAL_UART_Init() that can not be performed on USART4 and USART5 instances for L07x/L08x.
HAL USB
Added missing USB_CNTR_SOFM in the setting of wInterrupt_Mask global variable.
Updated HAL_PCD_ActivateRemoteWakeup() and HAL_PCD_DeActivateRemoteWakeup() functions to check on LPM state before USB resume.
HAL WWDG
Overall driver rework 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.
Main Changes
Maintenance release
Contents
HAL/LL COMP update
Added missing definition for COMP_INPUT_PLUS_IO6 and LL_COMP_INPUT_PLUS_IO6, supported by STM32L0 Category1 (STM32L011xx, STM32L021xx).
Removed COMP_INVERTINGINPUT_IO3 definition.
Renamed COMP_INVERTINGINPUT_IO2 to COMP_INPUT_MINUS_DAC1_CH2.
The EXTI set-up is now managed by HAL_COMP_Init() function, using updated definitions of COMP_TRIGGERMODE_xxx.
Therefore, the functions HAL_COMP_Start_IT() and HAH_COMP_Stop_IT() have been removed.
In any mode, the application must use HAL_COMP_Start() and HAL_COMP_Stop().
For information, this update was already available in V1.6.0.
HAL RTC update
Updated HAL_RTCEx_SetWakeUpTimer_IT() function by adding clear of Wake-Up flag before enabling the interrupt.
Added new __HAL_SYSCFG_VLCD_CAPA_CONFIG() macro to configure the VLCD Decoupling capacitance connection.
Added new __HAL_SYSCFG_GET_VLCD_CAPA_CONFIG() macro to return the decoupling of LCD capacitance configured by user.
Added LCD Voltage output buffer enable macro definitions.
Main Changes
Maintenance release
First official release supporting the Low Level drivers for the STM32L0xx family:
Low Layer drivers APIs provide register level programming: they require deep knowledge of peripherals described in STM32L0xx Reference Manual.
Low Layer drivers are available for: ADC, COMP, CORTEX, CRC, CRS,DAC, DMA, EXTI, GPIO, I2C, IWDG, LPTIM, LPUART, PWR, RCC, RNG, RTC, SPI, TIM, USART, WWDG peripherals and additional Low Level Bus, System and Utilities APIs.
Low Layer drivers APIs are implemented as static inline function in new Inc/stm32l0xx_ll_ppp.h files for PPP peripherals, there is no configuration file and each stm32l0xx_ll_ppp.h file must be included in user code.
Contents
Updates of the HAL
HAL_SYSCFG_EnableVREFINT() and HAL_SYSCFG_DisableVREFINT() functions and HAL_VREFINT_Cmd macro suppressed since VREFINT is managed by the system.
Several updates on dedicated HAL as specified in the list below. The major changes concerns HAL_COMP and HAL_UART.
HAL update
Change the way the APB AHB prescaler table is defined inside the HAL.
Change the variable ‘uwTick’ from ‘static’ to ‘global’.
Compliancy with MISRA C 2004 rule 10.6 (A “U” suffix shall be applied to all constants of unsigned type)
Compliancy with MISRA C 2004 rule 16.4. (The identifiers used in the declaration and definition of a function shall be identical)
HAL COMP update
Major rework on the lock and on the state machine associated to the COMP HAL.
Optimization of several functions and uniformization of the driver within the whole STM32 family.
HAL CRYPT update
Correct the usage of several compilation switches related to STM32L081xx.
HAL DMA update
Add the following macro : HAL_DMA_GET_COUNTER.
HAL FLASH update
Update the two following macros : __HAL_FLASH_PREFETCH_BUFFER_ENABLE and __HAL_FLASH_PREFETCH_BUFFER_DISABLE.
HAL IRDA update
Improve management of the EIE bits for Tx and Rx transfers.
HAL I2C update
Allow I2C transmission with data size equal to 0.
Add new macro IS_I2C_WAKEUP_FROMSTOP_INSTANCE.
HAL LPTIM update
Update of the LPTIM driver in order to support the exti line 23.
HAL UART update
Improve UART state machine behavior in case of interrupts.
Update the macros UART_DIV_SAMPLING8 and UART_DIV_SAMPLING16 to correct UART baudrate calculation
Add an RXDATA flush request inside the UART_Receive_IT function when the RxState is not in reception state.
HAL RCC update
Correct the setup of the global variable ‘SystemCoreClock’.
Update of the CRS interrupt sources.
Renamed RCC_CRS_SYNCWARM into RCC_CRS_SYNCWARN and renamed RCC_CRS_TRIMOV into RCC_CRS_TRIMOVF.
Main Changes
Maintenance release
Contents
Main HAL updates
Compliancy with MISRA coding rules (MISRA C 2004 rule 10.5 except for hal_pcd.c file and MISRA C 2004 rule 5.3).
Several functions inside the HAL have been updated in order to prevent unused argument compilation warnings.
The startup timeout value for many clocks (as HSE, HSI, LSI, MSI, PLL) have been updated to reach a more accurate value (alignement to the Datasheet).
The macro __HAL_CORTEX_SYSTICKCLK_CONFIG() has been removed since this service is already covered by the function HAL_SYSTICK_CLKSourceConfig().
HAL update
Update the SYSCFG_BOOT_SYSTEMFLASH definition. (SYSCFG_BOOT_SYSTEMFLASH is now equal to SYSCFG_CFGR1_BOOT_MODE_0 instead of SYSCFG_CFGR1_MEM_MODE_0)
The HSE_STARTUP_TIMEOUT is now equal to 100 instead of 5000.
HAL I2C update
Update the HAL_I2C_Slave_Receive function. Store last data received when requested.
Improvement of the HAL_I2C_MasterReceive function. Error management update. (HAL_ERROR detection versus HAL_TIMEOUT)
Improvement of the I2C_MasterTransmit_ISR function. Adding of several error checks, unlock of the process when requested.
Improvement of the I2C_MasterReceive_DMA function. Adding of several error checks and abort DMA when requested.
HAL UART update
Update the check of parameters inside the function HAL_LIN_SendBreak().
Correction of an error present on the V1.4.0 release. On the V1.4.0 release, the clock used inside the function USART_SetConfig(..) was never set.
HAL DMA update
Update the DMA_handler structure in order to be MISRA-C 2004 rule 5.3 compliant.
HAL SPI update
Update the SPI_handler structure in order to be MISRA-C 2004 rule 5.3 compliant.
HAL RCC update
Update support of RCC_MC03 when requested.
Update support of dynamic HSE prescaler configuration for LCD/RTC peripherals.
Some updates inside the HAL_RCC_ClockConfig function.
Some updates inside the HAL_RCC_MCOConfig function. The enabling of the MCO clocks (__MC01_CLK_ENABLE() or __MCO2_CLK_ENABLE()) is done separately depending on the MCO selected.
The function HAL_RCCEx_GetPeriphCLKFreq() has been reworked.
The function HAL_RCCEx_PeriphCLKConfig() has been updated. A new error is now detected when trying to update the HSE divider dynamically.
HAL TSC update
Several updates inside the HAL_TSC_Start function and HAL_TSC_Init function. Check of input parameters
HAL ADC update
The channel 16 (ADC_CHANNEL_16) is not available on all devices.
HAL CORTEX update
The macro __HAL_CORTEX_SYSTICKCLK_CONFIG(..) has been removed since this service is already covered by the function HAL_SYSTICK_CLKSourceConfig().
HAL FLASH update
The restriction which was present on V1.4.0 and linked to the OPTVERR bit usage on STM32L031xx and STM32L041xx has been removed.
This is due to the fact that the new STM32L031xx/STM32L041xx devices supports now this feature.
On the first revision of the STM32L031xx/STM32L031xx devices (RevID = 0x1000 retrieved via HAL_GetREVID()), the OPTVERR bit was not functional. The OPTVERR (Option valid error bit) is set by hardware when, during an Option byte loading, there was a mismatch for one or more configurations.
Main Changes
Maintenance release
This release includes the support of the support of STM32L011xx and STM32L021xx devices
On STM32L011xx/STM32L021xx, compared to STM32L07xxx/STM32L08xxx, some of the main differences are listed hereafter :
SRAM size set to 2KB (instead of 20KB)
Flash size set to 16KB (instead of 192KB)
GPIO available :A,B,C (instead of A,B,C,D,E,H)
Timers available : TIM2,TIM21,LPTIM1 (instead of TIM2,TIM3,TIM6,TIM7,TIM21,TIM22,LPTIM1)
Contents
HAL COMP update
Update of the non inverting inputs available on the whole L0 family.
HAL RCC update
Usage of a common PLLMulTable[] defined in system_stm32l0xx.c.
Update in the definition of the different tampers.
Minor renaming of several macros.
HAL TIMER update
Handle lock initialization in all TIM init functions.
HAL LCD update
Add support of new MuxSegment field inside the init structure.
HAL DMA update
Alignment of the different channels within the L0 family.
Main Changes
Major maintenance release
Major update of the HAL API :
all MACROs and LITERALs values have been reworked to align all STM32 Families as much as possible
Important information : A stm32_hal_legacy.h file has been added to the FW package in order to support the old MACROs and LITERAL values used in the previous versions of customer applications
In HAL MACROs definitions : do { } while(0) have been used in multi statement macros
This release includes the support of the support of STM32L031xx and STM32L041xx devices On STM32L031xx/STM32L041xx, compared to STM32L07xxx/STM32L08xxx, the main differences are as follow :
SRAM size set to 8KB (instead of 20KB)
Flash size set to 32KB (instead of 192KB)
GPIO available :A,B,C,H (instead of A,B,C,D,E,H)
Timers available : TIM2,TIM21,TIM22,LPTIM1 (instead of TIM2,TIM3,TIM6,TIM7,TIM21,TIM22,LPTIM1)
Contents
HAL ADC update
ADC assert param needs to be more specific for discontinuous mode, nb of discont conversions
ADC external trigger definition is not complete Flag EOS should not be reset in HAL_ADC_GetValue()
ADC poll for event must return timeout instead of error
ADC state machine update - States with bitfields are now used for a more accurate status
ADC run in LPrun mode needs SYSCFG buffers enabled
ADC_CLOCK_SYNC_PCLK_DIVx was not correct
Remove WaitLoopIndex at the beginning of the function HAL_ADC_Enable
ADC parameter “ADC_SOFTWARE_START” for compatibility with other STM32 devices
ADC poll for conversion must return error status in case of ADC-DMA mode
ADC identical error code returned generates confusion
Issue observed with ADC start simultaneous commands
The HAl_Delay() is not required when ADVREGEN is set
RTC alignment of different HAL_RTC_XXIRQHandler() implementations
RTC Bits Mask literals to be used in macro definition
RTC macro __HAL_RTC_TAMPER_GET_IT() issue in param: INTERRUPT@arg list
RTC wrong description of the subsecond item of RTC_TimeTypeDef structure in the header file
RTC WUTWF is not reliable
HAL_RTC_GetTime function does not return the actual subfraction
[STM32L031xx/STM32L041xx] RTC macros renaming for RTC_OUTPUT_REMAP_XX and RTC_TIMESTAMPPIN_XX
Enhance @note describing the use of HAL RTC APIs
HAL SPI update
SPI HAL_SPI_TransmitReceive_DMA() Remove DMA Tx Callback in case of RxOnly mode
SPI HandleTypeDef.ErrorCode must be typed uint32_t
Warnings with True Studio IDE (tempreg variable not used)
HAL TIM update
TIM problem to use ETR as OCrefClear source
TIM Wrong remaping of the TIM2_ETR
TIM register BDTR does not exist
The assert on trigger polarity for TI1F_ED should be removed
TIM Add macros to ENABLE/DISABLE URS bit in TIM CR1 register
TIM HAL_TIM_OC_ConfigChannel() / HAL_TIM_PWM_ConfigChannel() Missed/Unused assert param to be added/removed
TIM Remove HAL_TIM_SlaveConfigSynchronization_DMA() from HAL_TIM API
TIM Trigger DMA request should be activated when working with a slave mode
TIM Timer Register Corruption using HAL_TIM_IC_ConfigChannel
TIM DMA transfer should be aborted when stopping a DMA burst
Add “TIM_CHANNEL_ALL” as an argument for all Encoder Start/Stop process in the comment section
HAL_TIM_DMADelayPulseCplt callback missing information
HAL_TIM_DMACaptureCplt callback missing information
TIM Trigger DMA request should be activated when working with a slave mode
TIM Trigger interrupt should be activated when working with a slave mode
__HAL_TIM_PRESCALER() shall be corrected: use ‘=’ instead of ‘|=’
HAL UART/USART update
UART Incorrect UART speed setting on HSI clock
Wrong Baud Rate calculation in case of OVER8
UART missing closing bracket in header file
UART Circular mode when transmitting data not well supported
UART/LPUART number of stop bits to correct
USART Incorrect number of stop bits definition
UART HAL_UART_IRQHandler function not clearing correctly the interrupt flags
USART Setting of BRR register bit3:0 not inline with RM when OVER8 sampling mode is used
UART UART_WaitOnFlagUntilTimeout should not assign UART handle state to HAL_UART_STATE_TIMEOUT
USART Wrong values used as parameter of __HAL_USART_CLEAR_IT() in HAL_USART_IRQHandler()
USART BRR setting is wrong compared to Baudrate value
USART HAL_USART_Init() update to reach max frequencies (enable oversampling by 8)
USART USART_DMAReceiveCplt() Update to set the USART state after performing the test on it
UART The code associated to several macros need to be completed
USART UART DMA implementation issue: missed clear the TC bit in the SR
Wrong USART_IT_CM defined value
Issue with Lin mode data length
Wrong description for Interrupt mode IO operation within HAL UART driver
Change UART_DMATransmitCplt- new implementation to remove WaitOnFlag in ISR
Change UART TX-IT implementation to remove WaitOnFlag in ISR
The IS_UART_OVERSAMPLING(SAMPLING) is not called in UART_SetConfig()
HAL UART enhancement: remove the check on RXNE flag after reading the DR register
UART/USART/IRDA/SMARTCARD transmit process enhancement to use TXE instead of TC
Add MACRO to UART HAL to control CTS and RTS from the customer application
HAL PCD update
HAL_PCD_EP_Transmit() not functional
HAL PCD clear flag macros configuration
Bad IN/OUT EndPoint parameter array size
HAL PCD miss #define for ep0_mps parameter
USB HAL PCD missing #define PCD_SPEED_HIGH
Main Changes
Official release
This release includes the support of the STM32L071xx, STM32L072xx, STM32L073xx, STM32L082xx, STM32L083xx devices
Fix known defects and add several enhancements implementation
Contents
HAL Flash** update
Flash : 192K Dual Bank
HAL TIM** update
4 new instances : TIM3, TIM7, TIM21, TIM22
HAL USART** update
2 new instances : USART 4, USART 5
HAL I2C** update
1 new instance I2C3
HAL GPIO** update
GPIO Port E
HAL DAC** update
A second channel has been introduced
HAL FIREWALL introduction
Known Limitations
Introduced a FW patch to deactivate the HW SPI-V2.3 correction in case of I2S PCM Short mode usage (Please refer to the STM32L073xx Errata Sheet for more details). In this use case, we come back to the HW SPI 2.2 behavior which is correct for the I2S PCM short mode
Main Changes
Official release
Contents
HAL generic** update
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
When USE_RTOS == 1 (in stm32l0xx_hal_conf.h), the __HAL_LOCK() is not defined instead of being defined empty
Use "__IO const" instead of "__I", to avoid any compilation issue when __cplusplus switch is defined
Add new functions for the DBGMCU module
HAL_EnableDBGSleepMode()
HAL_DisableDBGSleepMode()
HAL_EnableDBGStopMode()
HAL_DisableDBGStopMode()
HAL_EnableDBGStandbyMode()
HAL_DisableDBGStandbyMode()
Miscellaneous comments update
HAL FLASH** update
Add new functions: HAL_FLASHEx_OB_SelectPCROP() and HAL_FLASHEx_OB_DeSelectPCROP()
Some functions was renamed and moved to the extension files (stm32l0xx_hal_flash_ex.h/.c)
Rename FLASH_HalfPageProgram() into HAL_FLASHEx_HalfPageProgram()
Rename FLASH_EnableRunPowerDown() into HAL_FLASHEx_EnableRunPowerDown()
Rename FLASH_DisableRunPowerDown() into HAL_FLASHEx_DisableRunPowerDown()
Rename all HAL_DATA_EEPROMEx_xxx() functions into HAL_FLASHEx_DATAEEPROM_xxx()
Note: aliases has been added to keep compatibility with previous version
HAL GPIO** update
Remove IS_GET_GPIO_PIN macro
Add a new function HAL_GPIO_LockPin()
Private Macro __HAL_GET_GPIO_SOURCE renamed into GET_GPIO_SOURCE
HAL DMA** update
Fix in HAL_DMA_PollForTransfer() to set error code HAL_DMA_ERROR_TE in case of HAL_ERROR status
HAL PWR** update
HAL_PWR_PVDConfig(): 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 RCC** update
Allow to calibrate the HSI when it is used as system clock source
Fix implementation of IS_RCC_OSCILLATORTYPE() macro
HAL ADC** update
Update ADC internal channels mapping: TEMPSENSOR connected to ADC_CHANNEL_18 and VLCD mapped to ADC_CHANNEL_16
Skip polling for ADRDY flag when Low Power Auto Off mode is enabled
HAL COMP** update
Add LPTIMConnection field in the COMP_InitTypeDef structure.
Add new defines: COMP_LPTIMCONNECTION_DISABLED, COMP_LPTIMCONNECTION_ENABLED
Add new macro IS_COMP_LPTIMCONNECTION
HAL LPTIM** update
Add CKPOL configuration for encoder mode
HAL WWDG** update
Miscellaneous minor update on the source code
HAL IWDG** update
Miscellaneous minor update on the source code
HAL CRC** update
Some functions was renamed and moved to the extension files (stm32l0xx_hal_crc_ex.h/.c)
HAL_CRC_Input_Data_Reverse() renamed into HAL_CRCEx_Input_Data_Reverse()
HAL_CRC_Output_Data_Reverse() renamed into HAL_CRCEx_Output_Data_Reverse()
Note: aliases has been added to keep compatibility with previous version
HAL CRYP** update
HAL_CRYP_ComputationCpltCallback() renamed into HAL_CRYPEx_ComputationCpltCallback() and moved to the extension files (stm32l0xx_hal_cryp_ex.h/.c)
Note: alias has been added to keep compatibility with previous version
HAL I2C** update
Add management of NACK event in Master transmitter mode and Slave transmitter/receiver modes (only in polling mode), in that case the current transfer is stopped.
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
HAL SPI** update
Bugs fix
SPI interface is used in synchronous polling mode: at high clock rates like SPI prescaler 2 and 4, calling HAL_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