Skip to content

Commit bb2df46

Browse files
committed
system(g4) update STM32G4xx HAL Drivers to v1.2.7
Included in STM32CubeG4 FW v1.6.3 Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parent 992f502 commit bb2df46

7 files changed

Lines changed: 253 additions & 197 deletions

File tree

system/Drivers/STM32G4xx_HAL_Driver/Inc/stm32g4xx_hal_hrtim.h

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1617,17 +1617,25 @@ typedef void (* pHRTIM_TIMxCallbackTypeDef)(HRTIM_HandleTypeDef *hhrtim, /*!<
16171617

16181618
/** @defgroup HRTIM_Deadtime_Prescaler_Ratio HRTIM Dead-time Prescaler Ratio
16191619
* @{
1620-
* @brief Constants defining division ratio between the timer clock frequency
1621-
* (fHRTIM) and the dead-time generator clock (fDTG)
1620+
* @brief Constants defining the prescaler value for the deadtime generator time step (tDTG) relative to the
1621+
* HR-Timer clock period (tHRTIM).
1622+
* @note A customer reported that the HRTIM deadtime prescaler defines in
1623+
* stm32g4xx_ll_hrtim.h were swapped between the multiplication (MUL) and
1624+
* division (DIV) settings (for example, MUL8 and DIV8 values were reversed).
1625+
* The legacy naming is intentionally kept for backward compatibility, even
1626+
* though it does not strictly match the reference manual. Renaming these
1627+
* constants would introduce a breaking API change, which may lead to
1628+
* incorrect deadtime programming and potential safety issues due to deadtime
1629+
* violations in existing applications.
16221630
*/
1623-
#define HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV8 (0x00000000U) /*!< fDTG = fHRTIM / 8U */
1624-
#define HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV4 (HRTIM_DTR_DTPRSC_0) /*!< fDTG = fHRTIM / 4U */
1625-
#define HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV2 (HRTIM_DTR_DTPRSC_1) /*!< fDTG = fHRTIM / 2U */
1626-
#define HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV1 (HRTIM_DTR_DTPRSC_1 | HRTIM_DTR_DTPRSC_0) /*!< fDTG = fHRTIM */
1627-
#define HRTIM_TIMDEADTIME_PRESCALERRATIO_MUL2 (HRTIM_DTR_DTPRSC_2) /*!< fDTG = fHRTIM * 2U */
1628-
#define HRTIM_TIMDEADTIME_PRESCALERRATIO_MUL4 (HRTIM_DTR_DTPRSC_2 | HRTIM_DTR_DTPRSC_0) /*!< fDTG = fHRTIM * 4U */
1629-
#define HRTIM_TIMDEADTIME_PRESCALERRATIO_MUL8 (HRTIM_DTR_DTPRSC_2 | HRTIM_DTR_DTPRSC_1) /*!< fDTG = fHRTIM * 8U */
1630-
#define HRTIM_TIMDEADTIME_PRESCALERRATIO_MUL16 (HRTIM_DTR_DTPRSC_2 | HRTIM_DTR_DTPRSC_1 | HRTIM_DTR_DTPRSC_0) /*!< fDTG = fHRTIM * 16U */
1631+
#define HRTIM_TIMDEADTIME_PRESCALERRATIO_MUL8 (0x00000000U) /*!< tDTG = tHRTIM / 8U */
1632+
#define HRTIM_TIMDEADTIME_PRESCALERRATIO_MUL4 (HRTIM_DTR_DTPRSC_0) /*!< tDTG = tHRTIM / 4U */
1633+
#define HRTIM_TIMDEADTIME_PRESCALERRATIO_MUL2 (HRTIM_DTR_DTPRSC_1) /*!< tDTG = tHRTIM / 2U */
1634+
#define HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV1 (HRTIM_DTR_DTPRSC_1 | HRTIM_DTR_DTPRSC_0) /*!< tDTG = tHRTIM */
1635+
#define HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV2 (HRTIM_DTR_DTPRSC_2) /*!< tDTG = tHRTIM * 2U */
1636+
#define HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV4 (HRTIM_DTR_DTPRSC_2 | HRTIM_DTR_DTPRSC_0) /*!< tDTG = tHRTIM * 4U */
1637+
#define HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV8 (HRTIM_DTR_DTPRSC_2 | HRTIM_DTR_DTPRSC_1) /*!< tDTG = tHRTIM * 8U */
1638+
#define HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV16 (HRTIM_DTR_DTPRSC_2 | HRTIM_DTR_DTPRSC_1 | HRTIM_DTR_DTPRSC_0) /*!< tDTG = tHRTIM * 16U */
16311639
/**
16321640
* @}
16331641
*/
@@ -3223,14 +3231,14 @@ typedef void (* pHRTIM_TIMxCallbackTypeDef)(HRTIM_HandleTypeDef *hhrtim, /*!<
32233231
((TIMEVENTLATCH) == HRTIM_TIMEVENTLATCH_ENABLED))
32243232

32253233
#define IS_HRTIM_TIMDEADTIME_PRESCALERRATIO(PRESCALERRATIO)\
3226-
(((PRESCALERRATIO) == HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV8) || \
3227-
((PRESCALERRATIO) == HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV4) || \
3228-
((PRESCALERRATIO) == HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV2) || \
3229-
((PRESCALERRATIO) == HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV1) || \
3230-
((PRESCALERRATIO) == HRTIM_TIMDEADTIME_PRESCALERRATIO_MUL2) || \
3234+
(((PRESCALERRATIO) == HRTIM_TIMDEADTIME_PRESCALERRATIO_MUL8) || \
32313235
((PRESCALERRATIO) == HRTIM_TIMDEADTIME_PRESCALERRATIO_MUL4) || \
3232-
((PRESCALERRATIO) == HRTIM_TIMDEADTIME_PRESCALERRATIO_MUL8) || \
3233-
((PRESCALERRATIO) == HRTIM_TIMDEADTIME_PRESCALERRATIO_MUL16))
3236+
((PRESCALERRATIO) == HRTIM_TIMDEADTIME_PRESCALERRATIO_MUL2) || \
3237+
((PRESCALERRATIO) == HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV1) || \
3238+
((PRESCALERRATIO) == HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV2) || \
3239+
((PRESCALERRATIO) == HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV4) || \
3240+
((PRESCALERRATIO) == HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV8) || \
3241+
((PRESCALERRATIO) == HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV16))
32343242

32353243
#define IS_HRTIM_TIMDEADTIME_RISINGSIGN(RISINGSIGN)\
32363244
(((RISINGSIGN) == HRTIM_TIMDEADTIME_RISINGSIGN_POSITIVE) || \

system/Drivers/STM32G4xx_HAL_Driver/Inc/stm32g4xx_ll_hrtim.h

Lines changed: 46 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1273,16 +1273,25 @@ static const uint32_t REG_MASK_TAB_CPT[] =
12731273

12741274
/** @defgroup HRTIM_LL_EC_DT_PRESCALER DEADTIME PRESCALER
12751275
* @{
1276-
* @brief Constants defining division ratio between the timer clock frequency (fHRTIM) and the deadtime generator clock (fDTG).
1277-
*/
1278-
#define LL_HRTIM_DT_PRESCALER_DIV8 0x00000000U /*!< fDTG = fHRTIM / 8 */
1279-
#define LL_HRTIM_DT_PRESCALER_DIV4 (HRTIM_DTR_DTPRSC_0) /*!< fDTG = fHRTIM / 4 */
1280-
#define LL_HRTIM_DT_PRESCALER_DIV2 (HRTIM_DTR_DTPRSC_1) /*!< fDTG = fHRTIM / 2 */
1281-
#define LL_HRTIM_DT_PRESCALER_DIV1 (HRTIM_DTR_DTPRSC_1 | HRTIM_DTR_DTPRSC_0) /*!< fDTG = fHRTIM */
1282-
#define LL_HRTIM_DT_PRESCALER_MUL2 (HRTIM_DTR_DTPRSC_2) /*!< fDTG = fHRTIM * 2 */
1283-
#define LL_HRTIM_DT_PRESCALER_MUL4 (HRTIM_DTR_DTPRSC_2 | HRTIM_DTR_DTPRSC_0) /*!< fDTG = fHRTIM * 4 */
1284-
#define LL_HRTIM_DT_PRESCALER_MUL8 (HRTIM_DTR_DTPRSC_2 | HRTIM_DTR_DTPRSC_1) /*!< fDTG = fHRTIM * 8 */
1285-
#define LL_HRTIM_DT_PRESCALER_MUL16 (HRTIM_DTR_DTPRSC_2 | HRTIM_DTR_DTPRSC_1 | HRTIM_DTR_DTPRSC_0) /*!< fDTG = fHRTIM * 16 */
1276+
* @brief Constants defining the prescaler value for the deadtime generator time step (tDTG) relative to the
1277+
* HR-Timer clock period (tHRTIM).
1278+
* @note A customer reported that the HRTIM deadtime prescaler defines in
1279+
* stm32g4xx_ll_hrtim.h were swapped between the multiplication (MUL) and
1280+
* division (DIV) settings (for example, MUL8 and DIV8 values were reversed).
1281+
* The legacy naming is intentionally kept for backward compatibility, even
1282+
* though it does not strictly match the reference manual. Renaming these
1283+
* constants would introduce a breaking API change, which may lead to
1284+
* incorrect deadtime programming and potential safety issues due to deadtime
1285+
* violations in existing applications.
1286+
*/
1287+
#define LL_HRTIM_DT_PRESCALER_MUL8 0x00000000U /*!< tDTG = tHRTIM / 8 */
1288+
#define LL_HRTIM_DT_PRESCALER_MUL4 (HRTIM_DTR_DTPRSC_0) /*!< tDTG = tHRTIM / 4 */
1289+
#define LL_HRTIM_DT_PRESCALER_MUL2 (HRTIM_DTR_DTPRSC_1) /*!< tDTG = tHRTIM / 2 */
1290+
#define LL_HRTIM_DT_PRESCALER_DIV1 (HRTIM_DTR_DTPRSC_1 | HRTIM_DTR_DTPRSC_0) /*!< tDTG = tHRTIM */
1291+
#define LL_HRTIM_DT_PRESCALER_DIV2 (HRTIM_DTR_DTPRSC_2) /*!< tDTG = tHRTIM * 2 */
1292+
#define LL_HRTIM_DT_PRESCALER_DIV4 (HRTIM_DTR_DTPRSC_2 | HRTIM_DTR_DTPRSC_0) /*!< tDTG = tHRTIM * 4 */
1293+
#define LL_HRTIM_DT_PRESCALER_DIV8 (HRTIM_DTR_DTPRSC_2 | HRTIM_DTR_DTPRSC_1) /*!< tDTG = tHRTIM * 8 */
1294+
#define LL_HRTIM_DT_PRESCALER_DIV16 (HRTIM_DTR_DTPRSC_2 | HRTIM_DTR_DTPRSC_1 | HRTIM_DTR_DTPRSC_0) /*!< tDTG = tHRTIM * 16 */
12861295
/**
12871296
* @}
12881297
*/
@@ -2836,7 +2845,8 @@ __STATIC_INLINE uint32_t LL_HRTIM_IsDisabledOutput(const HRTIM_TypeDef *HRTIMx,
28362845
* @arg @ref LL_HRTIM_ADCTRIG_SRC6810_TIMF_PER
28372846
* @retval None
28382847
*/
2839-
__STATIC_INLINE void LL_HRTIM_ConfigADCTrig(const HRTIM_TypeDef *HRTIMx, uint32_t ADCTrig, uint32_t Update, uint32_t Src)
2848+
__STATIC_INLINE void LL_HRTIM_ConfigADCTrig(const HRTIM_TypeDef *HRTIMx, uint32_t ADCTrig, uint32_t Update,
2849+
uint32_t Src)
28402850
{
28412851
__IO uint32_t *padcur = (__IO uint32_t *)((uint32_t)((uint32_t)(&HRTIMx->sCommonRegs.CR1) +
28422852
REG_OFFSET_TAB_ADCUR[ADCTrig]));
@@ -6133,7 +6143,8 @@ __STATIC_INLINE uint32_t LL_HRTIM_TIM_GetIdlePushPullStatus(const HRTIM_TypeDef
61336143

61346144
* @retval None
61356145
*/
6136-
__STATIC_INLINE void LL_HRTIM_TIM_SetEventFilter(const HRTIM_TypeDef *HRTIMx, uint32_t Timer, uint32_t Event, uint32_t Filter)
6146+
__STATIC_INLINE void LL_HRTIM_TIM_SetEventFilter(const HRTIM_TypeDef *HRTIMx, uint32_t Timer, uint32_t Event,
6147+
uint32_t Filter)
61376148
{
61386149
uint32_t iTimer = (uint8_t)(POSITION_VAL(Timer) - POSITION_VAL(LL_HRTIM_TIMER_A));
61396150
uint32_t iEvent = (uint8_t)(POSITION_VAL(Event) - POSITION_VAL(LL_HRTIM_EVENT_1));
@@ -6984,7 +6995,8 @@ __STATIC_INLINE uint32_t LL_HRTIM_TIM_IsEnabledDualDacTrigger(const HRTIM_TypeDe
69846995
* @param Threshold This parameter can be a number between Min_Data=0 and Max_Data=63
69856996
* @retval None
69866997
*/
6987-
__STATIC_INLINE void LL_HRTIM_TIM_SetEventCounterThreshold(const HRTIM_TypeDef *HRTIMx, uint32_t Timer, uint32_t EventCounter,
6998+
__STATIC_INLINE void LL_HRTIM_TIM_SetEventCounterThreshold(const HRTIM_TypeDef *HRTIMx, uint32_t Timer,
6999+
uint32_t EventCounter,
69887000
uint32_t Threshold)
69897001
{
69907002
uint32_t iTimer = (uint8_t)(POSITION_VAL(Timer) - POSITION_VAL(LL_HRTIM_TIMER_A));
@@ -7050,7 +7062,8 @@ __STATIC_INLINE uint32_t LL_HRTIM_TIM_GetEventCounterThreshold(const HRTIM_TypeD
70507062
* @arg @ref LL_HRTIM_EVENT_10
70517063
* @retval None
70527064
*/
7053-
__STATIC_INLINE void LL_HRTIM_TIM_SetEventCounterSource(const HRTIM_TypeDef *HRTIMx, uint32_t Timer, uint32_t EventCounter,
7065+
__STATIC_INLINE void LL_HRTIM_TIM_SetEventCounterSource(const HRTIM_TypeDef *HRTIMx, uint32_t Timer,
7066+
uint32_t EventCounter,
70547067
uint32_t Event)
70557068
{
70567069
uint32_t iTimer = (uint8_t)(POSITION_VAL(Timer) - POSITION_VAL(LL_HRTIM_TIMER_A));
@@ -7123,7 +7136,8 @@ __STATIC_INLINE uint32_t LL_HRTIM_TIM_GetEventCounterSource(const HRTIM_TypeDef
71237136
* @arg @ref LL_HRTIM_EE_COUNTER_RSTMODE_CONDITIONAL
71247137
* @retval None
71257138
*/
7126-
__STATIC_INLINE void LL_HRTIM_TIM_SetEventCounterResetMode(const HRTIM_TypeDef *HRTIMx, uint32_t Timer, uint32_t EventCounter,
7139+
__STATIC_INLINE void LL_HRTIM_TIM_SetEventCounterResetMode(const HRTIM_TypeDef *HRTIMx, uint32_t Timer,
7140+
uint32_t EventCounter,
71277141
uint32_t Mode)
71287142
{
71297143
uint32_t iTimer = (uint8_t)(POSITION_VAL(Timer) - POSITION_VAL(LL_HRTIM_TIMER_A));
@@ -7227,7 +7241,8 @@ __STATIC_INLINE void LL_HRTIM_TIM_EnableEventCounter(const HRTIM_TypeDef *HRTIMx
72277241
* @arg @ref LL_HRTIM_EE_COUNTER_B
72287242
* @retval None
72297243
*/
7230-
__STATIC_INLINE void LL_HRTIM_TIM_DisableEventCounter(const HRTIM_TypeDef *HRTIMx, uint32_t Timer, uint32_t EventCounter)
7244+
__STATIC_INLINE void LL_HRTIM_TIM_DisableEventCounter(const HRTIM_TypeDef *HRTIMx, uint32_t Timer,
7245+
uint32_t EventCounter)
72317246
{
72327247
uint32_t iTimer = (uint8_t)(POSITION_VAL(Timer) - POSITION_VAL(LL_HRTIM_TIMER_A));
72337248
__IO uint32_t *pReg = (__IO uint32_t *)((uint32_t)((uint32_t)(&HRTIMx->sTimerxRegs[iTimer].EEFxR3)));
@@ -7312,14 +7327,14 @@ __STATIC_INLINE void LL_HRTIM_DT_Config(const HRTIM_TypeDef *HRTIMx, uint32_t Ti
73127327
* @arg @ref LL_HRTIM_TIMER_E
73137328
* @arg @ref LL_HRTIM_TIMER_F
73147329
* @param Prescaler This parameter can be one of the following values:
7315-
* @arg @ref LL_HRTIM_DT_PRESCALER_DIV8
7316-
* @arg @ref LL_HRTIM_DT_PRESCALER_DIV4
7317-
* @arg @ref LL_HRTIM_DT_PRESCALER_DIV2
7318-
* @arg @ref LL_HRTIM_DT_PRESCALER_DIV1
7319-
* @arg @ref LL_HRTIM_DT_PRESCALER_MUL2
7320-
* @arg @ref LL_HRTIM_DT_PRESCALER_MUL4
73217330
* @arg @ref LL_HRTIM_DT_PRESCALER_MUL8
7322-
* @arg @ref LL_HRTIM_DT_PRESCALER_MUL16
7331+
* @arg @ref LL_HRTIM_DT_PRESCALER_MUL4
7332+
* @arg @ref LL_HRTIM_DT_PRESCALER_MUL2
7333+
* @arg @ref LL_HRTIM_DT_PRESCALER_DIV1
7334+
* @arg @ref LL_HRTIM_DT_PRESCALER_DIV2
7335+
* @arg @ref LL_HRTIM_DT_PRESCALER_DIV4
7336+
* @arg @ref LL_HRTIM_DT_PRESCALER_DIV8
7337+
* @arg @ref LL_HRTIM_DT_PRESCALER_DIV16
73237338
* @retval None
73247339
*/
73257340
__STATIC_INLINE void LL_HRTIM_DT_SetPrescaler(const HRTIM_TypeDef *HRTIMx, uint32_t Timer, uint32_t Prescaler)
@@ -7342,14 +7357,14 @@ __STATIC_INLINE void LL_HRTIM_DT_SetPrescaler(const HRTIM_TypeDef *HRTIMx, uint3
73427357
* @arg @ref LL_HRTIM_TIMER_E
73437358
* @arg @ref LL_HRTIM_TIMER_F
73447359
* @retval Prescaler This parameter can be one of the following values:
7345-
* @arg @ref LL_HRTIM_DT_PRESCALER_DIV8
7346-
* @arg @ref LL_HRTIM_DT_PRESCALER_DIV4
7347-
* @arg @ref LL_HRTIM_DT_PRESCALER_DIV2
7348-
* @arg @ref LL_HRTIM_DT_PRESCALER_DIV1
7349-
* @arg @ref LL_HRTIM_DT_PRESCALER_MUL2
7350-
* @arg @ref LL_HRTIM_DT_PRESCALER_MUL4
73517360
* @arg @ref LL_HRTIM_DT_PRESCALER_MUL8
7352-
* @arg @ref LL_HRTIM_DT_PRESCALER_MUL16
7361+
* @arg @ref LL_HRTIM_DT_PRESCALER_MUL4
7362+
* @arg @ref LL_HRTIM_DT_PRESCALER_MUL2
7363+
* @arg @ref LL_HRTIM_DT_PRESCALER_DIV1
7364+
* @arg @ref LL_HRTIM_DT_PRESCALER_DIV2
7365+
* @arg @ref LL_HRTIM_DT_PRESCALER_DIV4
7366+
* @arg @ref LL_HRTIM_DT_PRESCALER_DIV8
7367+
* @arg @ref LL_HRTIM_DT_PRESCALER_DIV16
73537368
*/
73547369
__STATIC_INLINE uint32_t LL_HRTIM_DT_GetPrescaler(const HRTIM_TypeDef *HRTIMx, uint32_t Timer)
73557370
{
@@ -10095,7 +10110,7 @@ __STATIC_INLINE uint32_t LL_HRTIM_FLT_IsEnabledBlanking(const HRTIM_TypeDef *HRT
1009510110
{
1009610111
uint32_t iFault = (uint8_t)POSITION_VAL(Fault);
1009710112
const __IO uint32_t *pReg = (__IO uint32_t *)((uint32_t)((uint32_t)(&HRTIMx->sCommonRegs.FLTINR3) +
10098-
REG_OFFSET_TAB_FLTINR[iFault]));
10113+
REG_OFFSET_TAB_FLTINR[iFault]));
1009910114
uint32_t temp; /* MISRAC-2012 compliance */
1010010115
temp = READ_BIT(*pReg, (uint32_t)(HRTIM_FLTINR3_FLT1BLKE) << REG_SHIFT_TAB_FLTxE[iFault]) >> REG_SHIFT_TAB_FLTxE[iFault];
1010110116

system/Drivers/STM32G4xx_HAL_Driver/LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
2424
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
2525
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2626
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27-
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

system/Drivers/STM32G4xx_HAL_Driver/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# STM32CubeG4 HAL Driver MCU Component
22

3-
![tag](https://img.shields.io/badge/tag-v1.2.6-brightgreen.svg)
3+
![tag](https://img.shields.io/badge/tag-v1.2.7-brightgreen.svg)
44

55
## Overview
66

@@ -33,4 +33,4 @@ The full **STM32CubeG4** MCU package is available [here](https://github.com/STMi
3333

3434
## Troubleshooting
3535

36-
Please refer to the [CONTRIBUTING.md](CONTRIBUTING.md) guide.
36+
Please refer to the [CONTRIBUTING.md](CONTRIBUTING.md) guide.

0 commit comments

Comments
 (0)