Skip to content

Commit

Permalink
system(U5) update STM32U5xx HAL Drivers to v1.4.0
Browse files Browse the repository at this point in the history
Included in STM32CubeU5 FW v1.4.0

Signed-off-by: Frederic Pillon <[email protected]>
  • Loading branch information
fpistm committed Nov 23, 2023
1 parent b2b9c8c commit e2b913a
Show file tree
Hide file tree
Showing 7 changed files with 447 additions and 336 deletions.
30 changes: 28 additions & 2 deletions system/Drivers/STM32U5xx_HAL_Driver/Inc/stm32u5xx_hal_adc.h
Original file line number Diff line number Diff line change
Expand Up @@ -2127,10 +2127,36 @@ __LL_ADC_CONVERT_DATA_RESOLUTION((__ADCx__), (__DATA__),\
#define __HAL_ADC_CALC_DATA_TO_VOLTAGE(__ADCx__, __VREFANALOG_VOLTAGE__, \
__ADC_DATA__, \
__ADC_RESOLUTION__) \
__LL_ADC_CALC_DATA_TO_VOLTAGE((__ADCx__), (__VREFANALOG_VOLTAGE__), \
(__ADC_DATA__), \
__LL_ADC_CALC_DATA_TO_VOLTAGE((__ADCx__), (__VREFANALOG_VOLTAGE__), \
(__ADC_DATA__), \
(__ADC_RESOLUTION__))

/**
* @brief Helper macro to calculate the voltage (unit: mVolt)
* corresponding to a ADC conversion data (unit: digital value)
* in differential ended mode.
* @note On STM32U5, this feature is available on ADC instances: ADC1, ADC2.
* @note Analog reference voltage (Vref+) must be either known from
* user board environment or can be calculated using ADC measurement
* and ADC helper macro @ref __LL_ADC_CALC_VREFANALOG_VOLTAGE().
* @param __ADCx__ ADC instance
* @param __VREFANALOG_VOLTAGE__ Analog reference voltage (unit: mV)
* @param __ADC_DATA__ ADC conversion data (resolution 12 bits)
* (unit: digital value).
* @param __ADC_RESOLUTION__ This parameter can be one of the following values:
* @arg @ref ADC_RESOLUTION_14B
* @arg @ref ADC_RESOLUTION_12B
* @arg @ref ADC_RESOLUTION_10B
* @arg @ref ADC_RESOLUTION_8B
* @retval ADC conversion data equivalent voltage value (unit: mVolt)
*/
#define __HAL_ADC_CALC_DIFF_DATA_TO_VOLTAGE(__ADCx__, __VREFANALOG_VOLTAGE__, \
__ADC_DATA__, \
__ADC_RESOLUTION__) \
__LL_ADC_CALC_DIFF_DATA_TO_VOLTAGE((__ADCx__), (__VREFANALOG_VOLTAGE__), \
(__ADC_DATA__), \
(__ADC_RESOLUTION__))

/**
* @brief Helper macro to calculate analog reference voltage (Vref+)
* (unit: mVolt) from ADC conversion data of internal voltage
Expand Down
628 changes: 337 additions & 291 deletions system/Drivers/STM32U5xx_HAL_Driver/Inc/stm32u5xx_ll_adc.h

Large diffs are not rendered by default.

25 changes: 12 additions & 13 deletions system/Drivers/STM32U5xx_HAL_Driver/README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
# STM32CubeU5 HAL Driver MCU Component

![latest tag](https://img.shields.io/github/v/tag/STMicroelectronics/stm32u5xx_hal_driver.svg?color=brightgreen)

## Overview

**STM32Cube** is an STMicroelectronics original initiative to ease the developers life by reducing efforts, time and cost.
**STM32Cube** is a STMicroelectronics original initiative aimed at making life easier for developers by reducing effort, time and cost.

**STM32Cube** covers the overall STM32 products portfolio. It includes a comprehensive embedded software platform, delivered for each STM32 series.
* The CMSIS modules (core and device) corresponding to the ARM(tm) core implemented in this STM32 product
* The STM32 HAL-LL drivers : an abstraction drivers layer, the API ensuring maximized portability across the STM32 portfolio
* The BSP Drivers of each evaluation or demonstration board provided by this STM32 series
* A consistent set of middlewares components such as ThreadX, FileX, USBX, NetDuoX, OpenBootloader, USBPD, trustedfirmware, mbed-crypto, Network Library...
* A full set of software projects (basic examples, applications, and demonstrations) for each board provided for this STM32 series.
**STM32Cube** covers the overall STM32 products portfolio. It includes a comprehensive embedded software platform delivered for each STM32 series.
* The CMSIS modules (core and device) corresponding to the ARM(tm) core implemented in this STM32 product.
* The STM32 HAL-LL drivers, an abstraction layer offering a set of APIs ensuring maximized portability across the STM32 portfolio.
* The BSP drivers of each evaluation, demonstration, or nucleo board provided for this STM32 series.
* A consistent set of middleware libraries such as ThreadX, FileX, USBX, NetDuoX, OpenBootloader, USBPD, trustedfirmware, mbed-crypto, Network Library...
* A full set of software projects (basic examples, applications, and demonstrations) for each board, each project developed in three flavors using three toolchains (EWARM, MDK-ARM, and STM32CubeIDE).
* A new LPBAM utility which is a software helper that assists STM32U5 users in the elaboration of LPBAM scenarios.
* A development with three Toolchains and Compilers (IAR Embedded Workbench for ARM (EWARM), RealView Microcontroller Development Kit (MDK-ARM), and STM32CubeIDE).

Two models of publication are proposed for the STM32Cube embedded software:
* The monolithic **MCU Package** : all STM32Cube software modules of one STM32 series are present (Drivers, Middlewares, Projects, Utilities) in the repo (usual name **STM32Cubexx**, xx corresponding to the STM32 series)
* The **MCU component** : progressively from June 2021, each STM32Cube software module being part of the STM32Cube MCU Package, are delivered as an individual repo, allowing the user to select and get only the required software functions.
* The monolithic **MCU Package**: all STM32Cube software modules of one STM32 series are present (Drivers, Middleware, Projects, Utilities) in the repository (usual name **STM32Cubexx**, xx corresponding to the STM32 series).
* The **MCU component**: each STM32Cube software module being part of the STM32Cube MCU Package, is delivered as an individual repository, allowing the user to select and get only the required software functions.

## Description

Expand All @@ -34,6 +35,4 @@ The full **STM32CubeU5** MCU package is available [here](https://github.com/STMi

## Troubleshooting

If you have any issue with the **Software content** of this repo, you can [file an issue on Github](https://github.com/STMicroelectronics/stm32u5xx_hal_driver/issues/new/choose).

For any other question related to the product, the tools, the environment, you can submit a topic on the [ST Community/STM32 MCUs forum](https://community.st.com/s/group/0F90X000000AXsASAW/stm32-mcus).
Please refer to the [CONTRIBUTING.md](CONTRIBUTING.md) guide.
89 changes: 63 additions & 26 deletions system/Drivers/STM32U5xx_HAL_Driver/Release_Notes.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,53 @@ <h1 id="purpose">Purpose</h1>
<div class="col-sm-12 col-lg-8">
<h1 id="update-history">Update History</h1>
<div class="collapse">
<input type="checkbox" id="collapse-section6" checked aria-hidden="true"> <label for="collapse-section6" checked aria-hidden="true"><strong>V1.3.0 / 09-June-2023</strong></label>
<input type="checkbox" id="collapse-section7" checked aria-hidden="true"> <label for="collapse-section7" checked aria-hidden="true"><strong>V1.4.0 / 20-October-2023</strong></label>
<div>
<h2 id="main-changes">Main Changes</h2>
<ul>
<li><strong>HAL and LL drivers</strong> Maintenance Release for <strong>STM32U5XX</strong> devices</li>
<li>Update <strong>ADC</strong> HAL and LL drivers to fix known defects and add implementation enhancements</li>
<li>The HAL and LL drivers provided within this package are <strong>MISRA-C, MCU ASTYLE and CodeSonar compliant</strong>, and have been reviewed with a static analysis tool to eliminate possible run-time errors</li>
</ul>
<h3 id="hal-drivers-updates"><strong>HAL Drivers</strong> updates</h3>
<ul>
<li><strong>HAL ADC</strong> driver
<ul>
<li>Add new Helper macro for differential mode raw data to voltage conversion</li>
</ul></li>
<li><strong>HAL ADC_EX</strong> driver
<ul>
<li>Enhance calibration procedure implementation</li>
</ul></li>
</ul>
<h3 id="ll-drivers-updates"><strong>LL Drivers</strong> updates</h3>
<ul>
<li><strong>LL ADC</strong> driver
<ul>
<li>Add new Helper macro for differential mode raw data to voltage conversion</li>
</ul></li>
</ul>
<h2 id="known-limitations">Known Limitations</h2>
<ul>
<li>N/A</li>
</ul>
<h2 id="backward-compatibility">Backward compatibility</h2>
<ul>
<li>N/A</li>
</ul>
</div>
</div>
<div class="collapse">
<input type="checkbox" id="collapse-section6" aria-hidden="true"> <label for="collapse-section6" checked aria-hidden="true"><strong>V1.3.0 / 09-June-2023</strong></label>
<div>
<h2 id="main-changes-1">Main Changes</h2>
<ul>
<li><strong>HAL and LL drivers</strong> official Release for <strong>STM32U5F7xx/STM32U5G7xx</strong>, <strong>STM32U5F9xx/STM32U5G9xx</strong>, <strong>STM32U535xx/STM32U545xx, STM32U575xx/STM32U585xx, STM32U595xx/STM32U5A5xx</strong> and <strong>STM32U599xx/STM32U5A9xx</strong> devices</li>
<li>Add <strong>2 new HAL drivers</strong> : <strong>GFXTIM</strong> and <strong>JPEG</strong> highlighting the graphics aspect of STM32U5F7/STM32U5G7/STM32U5F9/STM32U5G9 devices</li>
<li>The HAL and LL drivers provided within this package are <strong>MISRA-C, MCU ASTYLE and CodeSonar compliant</strong>, and have been reviewed with a static analysis tool to eliminate possible run-time errors</li>
<li>General updates to fix known defects and implementation enhancements</li>
</ul>
<h3 id="hal-drivers-updates"><strong>HAL Drivers</strong> updates</h3>
<h3 id="hal-drivers-updates-1"><strong>HAL Drivers</strong> updates</h3>
<ul>
<li><strong>HAL CRYP</strong> driver
<ul>
Expand Down Expand Up @@ -87,7 +124,7 @@ <h3 id="hal-drivers-updates"><strong>HAL Drivers</strong> updates</h3>
<li>Add IS_TIM_CCX_CHANNEL define</li>
</ul></li>
</ul>
<h3 id="ll-drivers-updates"><strong>LL Drivers</strong> updates</h3>
<h3 id="ll-drivers-updates-1"><strong>LL Drivers</strong> updates</h3>
<ul>
<li><strong>LL PWR</strong> driver
<ul>
Expand Down Expand Up @@ -132,11 +169,11 @@ <h3 id="ll-drivers-updates"><strong>LL Drivers</strong> updates</h3>
</ul></li>
</ul>
<p>Note: HAL/LL Backward compatibility ensured by legacy defines.</p>
<h2 id="known-limitations">Known Limitations</h2>
<h2 id="known-limitations-1">Known Limitations</h2>
<ul>
<li>N/A</li>
</ul>
<h2 id="backward-compatibility">Backward compatibility</h2>
<h2 id="backward-compatibility-1">Backward compatibility</h2>
<ul>
<li>N/A</li>
</ul>
Expand All @@ -145,12 +182,12 @@ <h2 id="backward-compatibility">Backward compatibility</h2>
<div class="collapse">
<input type="checkbox" id="collapse-section5" aria-hidden="true"> <label for="collapse-section5" checked aria-hidden="true"><strong>V1.2.0 / 08-February-2023</strong></label>
<div>
<h2 id="main-changes-1">Main Changes</h2>
<h2 id="main-changes-2">Main Changes</h2>
<ul>
<li><strong>HAL and LL drivers</strong> Official Release for STM32U535xx / STM32U545xx, STM32U575xx / STM32U585xx, STM32U595xx, STM32U5A5xx, STM32U599xx and STM32U5A9xx devices.</li>
<li>Update STM32U545xx_User_Manual, STM32U585xx_User_Manual and STM32U5A9xx_User_Manual CHM User Manuals</li>
</ul>
<h3 id="hal-drivers-updates-1"><strong>HAL Drivers</strong> updates</h3>
<h3 id="hal-drivers-updates-2"><strong>HAL Drivers</strong> updates</h3>
<ul>
<li><strong>HAL ADC</strong> driver
<ul>
Expand Down Expand Up @@ -303,7 +340,7 @@ <h3 id="hal-drivers-updates-1"><strong>HAL Drivers</strong> updates</h3>
<li>Add HAL_HCD_HC_SetHubInfo and HAL_HCD_HC_ClearHubInfo macros</li>
</ul></li>
</ul>
<h3 id="ll-drivers-updates-1"><strong>LL Drivers</strong> updates</h3>
<h3 id="ll-drivers-updates-2"><strong>LL Drivers</strong> updates</h3>
<ul>
<li><strong>LL ADC</strong> driver
<ul>
Expand Down Expand Up @@ -345,11 +382,11 @@ <h3 id="ll-drivers-updates-1"><strong>LL Drivers</strong> updates</h3>
</ul></li>
</ul>
<p>Note: HAL/LL Backward compatibility ensured by legacy defines.</p>
<h2 id="known-limitations-1">Known Limitations</h2>
<h2 id="known-limitations-2">Known Limitations</h2>
<ul>
<li>N/A</li>
</ul>
<h2 id="backward-compatibility-1">Backward compatibility</h2>
<h2 id="backward-compatibility-2">Backward compatibility</h2>
<ul>
<li>N/A</li>
</ul>
Expand All @@ -358,7 +395,7 @@ <h2 id="backward-compatibility-1">Backward compatibility</h2>
<div class="collapse">
<input type="checkbox" id="collapse-section4" aria-hidden="true"> <label for="collapse-section4" checked aria-hidden="true"><strong>V1.1.0 / 16-February-2022</strong></label>
<div>
<h2 id="main-changes-2">Main Changes</h2>
<h2 id="main-changes-3">Main Changes</h2>
<ul>
<li><strong>HAL and LL drivers</strong> Maintenance Release for STM32U575xx / STM32U585xx devices and new support of STM32U595xx, STM32U5A5xx, STM32U599xx and STM32U5A9xx devices</li>
<li>Add <strong>New LTDC, GFXMMU, DSI, GPU2D HAL drivers</strong> highlighting the graphics aspect of STM32U595/STM32U5A5/STM32U599/STM32U5A9 devices</li>
Expand All @@ -367,7 +404,7 @@ <h2 id="main-changes-2">Main Changes</h2>
<li>General updates to fix known defects and implementation enhancements</li>
<li>The HAL and LL drivers provided within this package are <strong>MISRA-C, MCU ASTYLE and CodeSonar compliant</strong>, and have been reviewed with a static analysis tool to eliminate possible run-time errors</li>
</ul>
<h3 id="hal-drivers-updates-2"><strong>HAL Drivers</strong> updates</h3>
<h3 id="hal-drivers-updates-3"><strong>HAL Drivers</strong> updates</h3>
<ul>
<li>All the <strong>HAL</strong> drivers are updated to support both STM32U575/STM32U585 and STM32U595/STM32U5A5/STM32U599/STM32U5A9 devices</li>
<li><strong>HAL ADC</strong> driver
Expand Down Expand Up @@ -505,7 +542,7 @@ <h3 id="hal-drivers-updates-2"><strong>HAL Drivers</strong> updates</h3>
<li>Rework HAL_USART_DMAResume() function in order to use DMA instead of USART to resume data transfer</li>
</ul></li>
</ul>
<h3 id="ll-drivers-updates-2"><strong>LL Drivers</strong> updates</h3>
<h3 id="ll-drivers-updates-3"><strong>LL Drivers</strong> updates</h3>
<ul>
<li>All the <strong>LL</strong> drivers are updated to support both STM32U575/STM32U585 and STM32U595/STM32U5A5/STM32U599/STM32U5A9 devices</li>
<li><strong>LL ADC</strong> driver
Expand Down Expand Up @@ -576,11 +613,11 @@ <h3 id="ll-drivers-updates-2"><strong>LL Drivers</strong> updates</h3>
</ul></li>
</ul>
<p>Backward compatibility ensured by legacy defines</p>
<h2 id="known-limitations-2">Known Limitations</h2>
<h2 id="known-limitations-3">Known Limitations</h2>
<ul>
<li>N/A</li>
</ul>
<h2 id="backward-compatibility-2">Backward compatibility</h2>
<h2 id="backward-compatibility-3">Backward compatibility</h2>
<ul>
<li>N/A</li>
</ul>
Expand All @@ -589,11 +626,11 @@ <h2 id="backward-compatibility-2">Backward compatibility</h2>
<div class="collapse">
<input type="checkbox" id="collapse-section3" aria-hidden="true"> <label for="collapse-section3" checked aria-hidden="true"><strong>V1.0.2 / 14-October-2021</strong></label>
<div>
<h2 id="main-changes-3">Main Changes</h2>
<h2 id="main-changes-4">Main Changes</h2>
<ul>
<li>Patch release V1.0.2 of <strong>HAL and LL drivers</strong> for <strong>STM32U575xx / STM32U585xx</strong> devices</li>
</ul>
<h3 id="ll-drivers-updates-3"><strong>LL Drivers</strong> updates</h3>
<h3 id="ll-drivers-updates-4"><strong>LL Drivers</strong> updates</h3>
<ul>
<li><strong>LL DAC</strong> driver
<ul>
Expand All @@ -605,11 +642,11 @@ <h3 id="ll-drivers-updates-3"><strong>LL Drivers</strong> updates</h3>
</ul></li>
<li>Backward compatibility ensured by legacy defines</li>
</ul>
<h2 id="known-limitations-3">Known Limitations</h2>
<h2 id="known-limitations-4">Known Limitations</h2>
<ul>
<li>N/A</li>
</ul>
<h2 id="backward-compatibility-3">Backward compatibility</h2>
<h2 id="backward-compatibility-4">Backward compatibility</h2>
<ul>
<li>N/A</li>
</ul>
Expand All @@ -618,11 +655,11 @@ <h2 id="backward-compatibility-3">Backward compatibility</h2>
<div class="collapse">
<input type="checkbox" id="collapse-section2" aria-hidden="true"> <label for="collapse-section2" checked aria-hidden="true"><strong>V1.0.1 / 01-October-2021</strong></label>
<div>
<h2 id="main-changes-4">Main Changes</h2>
<h2 id="main-changes-5">Main Changes</h2>
<ul>
<li>Patch release V1.0.1 of <strong>HAL and LL drivers</strong> for <strong>STM32U575xx / STM32U585xx</strong> devices</li>
</ul>
<h3 id="hal-drivers-updates-3"><strong>HAL Drivers</strong> updates</h3>
<h3 id="hal-drivers-updates-4"><strong>HAL Drivers</strong> updates</h3>
<ul>
<li><strong>HAL ADC</strong> driver
<ul>
Expand Down Expand Up @@ -660,18 +697,18 @@ <h3 id="hal-drivers-updates-3"><strong>HAL Drivers</strong> updates</h3>
<li>Fix setting Flash latency from MSIRange in Oscillator Configuration</li>
</ul></li>
</ul>
<h3 id="ll-drivers-updates-4"><strong>LL Drivers</strong> updates</h3>
<h3 id="ll-drivers-updates-5"><strong>LL Drivers</strong> updates</h3>
<ul>
<li><strong>LL I2C</strong> driver
<ul>
<li>Add LL_I2C_EnableFastModePlus, LL_I2C_DisableFastModePlus and LL_I2C_IsEnabledFastModePlus APIs</li>
</ul></li>
</ul>
<h2 id="known-limitations-4">Known Limitations</h2>
<h2 id="known-limitations-5">Known Limitations</h2>
<ul>
<li>N/A</li>
</ul>
<h2 id="backward-compatibility-4">Backward compatibility</h2>
<h2 id="backward-compatibility-5">Backward compatibility</h2>
<ul>
<li>N/A</li>
</ul>
Expand All @@ -680,11 +717,11 @@ <h2 id="backward-compatibility-4">Backward compatibility</h2>
<div class="collapse">
<input type="checkbox" id="collapse-section1" aria-hidden="true"> <label for="collapse-section1" checked aria-hidden="true"><strong>V1.0.0 / 28-June-2021</strong></label>
<div>
<h2 id="main-changes-5">Main Changes</h2>
<h2 id="main-changes-6">Main Changes</h2>
<ul>
<li>First official release of <strong>HAL and LL drivers</strong> for <strong>STM32U575xx / STM32U585xx</strong> devices</li>
</ul>
<h2 id="known-limitations-5">Known Limitations</h2>
<h2 id="known-limitations-6">Known Limitations</h2>
<ul>
<li>N/A</li>
</ul>
Expand Down
4 changes: 2 additions & 2 deletions system/Drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@
* @{
*/
/**
* @brief STM32U5xx HAL Driver version number 1.3.0
* @brief STM32U5xx HAL Driver version number 1.4.0
*/
#define __STM32U5xx_HAL_VERSION_MAIN (0x01U) /*!< [31:24] main version */
#define __STM32U5xx_HAL_VERSION_SUB1 (0x03U) /*!< [23:16] sub1 version */
#define __STM32U5xx_HAL_VERSION_SUB1 (0x04U) /*!< [23:16] sub1 version */
#define __STM32U5xx_HAL_VERSION_SUB2 (0x00U) /*!< [15:8] sub2 version */
#define __STM32U5xx_HAL_VERSION_RC (0x00U) /*!< [7:0] release candidate */
#define __STM32U5xx_HAL_VERSION ((__STM32U5xx_HAL_VERSION_MAIN << 24U)\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,11 @@ HAL_StatusTypeDef HAL_ADCEx_Calibration_Start(ADC_HandleTypeDef *hadc, uint32_t

if (tmp_hal_status == HAL_OK)
{
/* Use a Data Memory Barrier instruction to avoid synchronization issues when accessing ADC registers */
MODIFY_REG(hadc->Instance->CR, ADC_CR_CALINDEX, 0x9UL << ADC_CR_CALINDEX_Pos);
MODIFY_REG(hadc->Instance->CALFACT2, 0x00FF0000UL, 0x00020000UL);
__DMB();
MODIFY_REG(hadc->Instance->CALFACT2, 0xFFFFFF00UL, 0x03021100UL);
__DMB();
SET_BIT(hadc->Instance->CALFACT, ADC_CALFACT_LATCH_COEF);

tmp_hal_status = ADC_Disable(hadc);
Expand Down
2 changes: 1 addition & 1 deletion system/Drivers/STM32YYxx_HAL_Driver_version.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* STM32L4: 1.13.4
* STM32L5: 1.0.5
* STM32MP1: 1.6.0
* STM32U5: 1.3.0
* STM32U5: 1.4.0
* STM32WB: 1.14.0
* STM32WL: 1.3.0

Expand Down

0 comments on commit e2b913a

Please sign in to comment.