Skip to content

Commit 2373913

Browse files
djiatsaf-sterwango
authored andcommitted
stm32cube: stm32h7rsxx: drivers: src: update hal-ll src driver
synchronize hal-ll src files with the correct h7rs cube repository history. Signed-off-by: Fabrice DJIATSA <[email protected]>
1 parent 6ecaca6 commit 2373913

15 files changed

+117
-97
lines changed

stm32cube/stm32h7rsxx/drivers/src/stm32h7rsxx_hal_cryp.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7112,7 +7112,7 @@ static HAL_StatusTypeDef CRYP_GCMCCM_SetHeaderPhase(CRYP_HandleTypeDef *hcryp, u
71127112
{
71137113
/* Enter last bytes, padded with zeros */
71147114
tmp = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount);
7115-
tmp &= mask[(hcryp->Init.DataType * 2U) + (headersize_in_bytes % 4U)];
7115+
tmp &= mask[(SAES_CONV_DATATYPE(hcryp->Init.DataType) * 2U) + (headersize_in_bytes % 4U)];
71167116
((SAES_TypeDef *)(hcryp->Instance))->DINR = tmp;
71177117
loopcounter++;
71187118
/* Pad the data with zeros to have a complete block */
@@ -7378,7 +7378,7 @@ static HAL_StatusTypeDef CRYP_GCMCCM_SetHeaderPhase_DMA(CRYP_HandleTypeDef *hcry
73787378
{
73797379
/* Enter last bytes, padded with zeros */
73807380
tmp = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount);
7381-
tmp &= mask[(hcryp->Init.DataType * 2U) + (headersize_in_bytes % 4U)];
7381+
tmp &= mask[(SAES_CONV_DATATYPE(hcryp->Init.DataType) * 2U) + (headersize_in_bytes % 4U)];
73827382
((SAES_TypeDef *)(hcryp->Instance))->DINR = tmp;
73837383
loopcounter++;
73847384
/* Pad the data with zeros to have a complete block */
@@ -7667,7 +7667,7 @@ static void CRYP_GCMCCM_SetHeaderPhase_IT(CRYP_HandleTypeDef *hcryp)
76677667
{
76687668
/* Enter last bytes, padded with zeros */
76697669
tmp = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount);
7670-
tmp &= mask[(hcryp->Init.DataType * 2U) + (headersize_in_bytes % 4U)];
7670+
tmp &= mask[(SAES_CONV_DATATYPE(hcryp->Init.DataType) * 2U) + (headersize_in_bytes % 4U)];
76717671
((SAES_TypeDef *)(hcryp->Instance))->DINR = tmp;
76727672
loopcounter++;
76737673
hcryp->CrypHeaderCount++;

stm32cube/stm32h7rsxx/drivers/src/stm32h7rsxx_hal_eth.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1990,7 +1990,7 @@ void HAL_ETH_IRQHandler(ETH_HandleTypeDef *heth)
19901990
if ((mac_flag & ETH_MAC_LPI_IT) != 0U)
19911991
{
19921992
/* Get MAC LPI interrupt source and clear the status register pending bit */
1993-
heth->MACLPIEvent = READ_BIT(heth->Instance->MACPCSR, 0x0000000FU);
1993+
heth->MACLPIEvent = READ_BIT(heth->Instance->MACLCSR, 0x0000000FU);
19941994

19951995
#if (USE_HAL_ETH_REGISTER_CALLBACKS == 1)
19961996
/* Call registered EEE callback*/

stm32cube/stm32h7rsxx/drivers/src/stm32h7rsxx_hal_mmc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ HAL_StatusTypeDef HAL_MMC_Init(MMC_HandleTypeDef *hmmc)
486486
HAL_StatusTypeDef HAL_MMC_InitCard(MMC_HandleTypeDef *hmmc)
487487
{
488488
uint32_t errorstate;
489-
MMC_InitTypeDef Init;
489+
MMC_InitTypeDef Init = {0U};
490490
uint32_t sdmmc_clk;
491491

492492
/* Default SDMMC peripheral configuration for MMC card initialization */
@@ -3986,7 +3986,7 @@ static uint32_t MMC_HighSpeed(MMC_HandleTypeDef *hmmc, FunctionalState state)
39863986
uint32_t response = 0U;
39873987
uint32_t count;
39883988
uint32_t sdmmc_clk;
3989-
SDMMC_InitTypeDef Init;
3989+
SDMMC_InitTypeDef Init = {0U};
39903990

39913991
if (((hmmc->Instance->CLKCR & SDMMC_CLKCR_BUSSPEED) != 0U) && (state == DISABLE))
39923992
{

stm32cube/stm32h7rsxx/drivers/src/stm32h7rsxx_hal_rcc.c

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@
4141
(+) Configure the AHB and APB buses pre-scalers
4242
(+) Enable the clock for the peripheral(s) to be used
4343
(+) Configure the clock kernel source(s) for peripherals which clocks are not
44-
derived from the System clock through :RCC_D1CCIPR,RCC_D2CCIP1R,RCC_D2CCIP2R
45-
and RCC_D3CCIPR registers
44+
derived from the System clock.
4645
4746
##### RCC Limitations #####
4847
==============================================================================
@@ -193,15 +192,10 @@ static HAL_StatusTypeDef RCC_PLL_Config(uint32_t PLLnumber, const RCC_PLLInitTyp
193192
HSE and PLL.
194193
The AHB clock (HCLK) is derived from System core clock through configurable
195194
pre-scaler and used to clock the CPU, memory and peripherals mapped
196-
on AHB and APB bus of the 3 Domains (D1, D2, D3)* through configurable pre-scalers
195+
on AHB and APB bus through configurable pre-scalers
197196
and used to clock the peripherals mapped on these buses. You can use
198197
"HAL_RCC_GetSysClockFreq()" function to retrieve system clock frequency.
199198
200-
-@- All the peripheral clocks are derived from the System clock (SYSCLK) except those
201-
with dual clock domain where kernel source clock could be selected through
202-
RCC_D1CCIPR,RCC_D2CCIP1R,RCC_D2CCIP2R and RCC_D3CCIPR registers.
203-
204-
(*) : 2 Domains (CD and SRD) for stm32h7a3xx and stm32h7b3xx family lines.
205199
@endverbatim
206200
* @{
207201
*/
@@ -248,7 +242,7 @@ HAL_StatusTypeDef HAL_RCC_DeInit(void)
248242
/* Reset CFGR register (HSI is selected as system clock source) */
249243
CLEAR_REG(RCC->CFGR);
250244

251-
/* Update the SystemCoreClock and SystemD2Clock global variables */
245+
/* Update the SystemCoreClock global variables */
252246
SystemCoreClock = HSI_VALUE;
253247

254248
/* Adapt Systick interrupt period */
@@ -874,8 +868,6 @@ HAL_StatusTypeDef HAL_RCC_OscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct)
874868
* occur when the clock source will be ready.
875869
* You can use HAL_RCC_GetClockConfig() function to know which clock is
876870
* currently used as system clock source.
877-
* @note Depending on the device voltage range, the software has to set correctly
878-
* D1CPRE[3:0] bits to ensure that Domain1 core clock not exceed the maximum allowed frequency
879871
* (for more details refer to section above "Initialization/de-initialization functions")
880872
* @retval None
881873
*/
@@ -1255,9 +1247,15 @@ void HAL_RCC_DisableCSS(void)
12551247
*/
12561248
uint32_t HAL_RCC_GetSysClockFreq(void)
12571249
{
1258-
uint32_t pllp, pllsource, pllm, pllfracen, hsivalue;
1259-
float_t fracn1, pllvco;
1260-
uint32_t sysclockfreq, prescaler;
1250+
uint32_t pllp;
1251+
uint32_t pllsource;
1252+
uint32_t pllm;
1253+
uint32_t pllfracen;
1254+
uint32_t hsivalue;
1255+
float_t fracn1;
1256+
float_t pllvco;
1257+
uint32_t sysclockfreq;
1258+
uint32_t prescaler;
12611259

12621260
/* Get SYSCLK source -------------------------------------------------------*/
12631261

@@ -1355,7 +1353,8 @@ uint32_t HAL_RCC_GetSysClockFreq(void)
13551353
*/
13561354
uint32_t HAL_RCC_GetHCLKFreq(void)
13571355
{
1358-
uint32_t clock, prescaler;
1356+
uint32_t clock;
1357+
uint32_t prescaler;
13591358
const uint8_t AHBPrescTable[8] = {1U, 2U, 3U, 4U, 6U, 7U, 8U, 9U};
13601359

13611360
/* SysClk */
@@ -1377,7 +1376,8 @@ uint32_t HAL_RCC_GetHCLKFreq(void)
13771376
*/
13781377
uint32_t HAL_RCC_GetPCLK1Freq(void)
13791378
{
1380-
uint32_t clock, prescaler;
1379+
uint32_t clock;
1380+
uint32_t prescaler;
13811381
/* Get HCLK source and compute PCLK1 frequency ---------------------------*/
13821382
clock = HAL_RCC_GetHCLKFreq();
13831383
/* APB1 prescaler */
@@ -1397,7 +1397,8 @@ uint32_t HAL_RCC_GetPCLK1Freq(void)
13971397
*/
13981398
uint32_t HAL_RCC_GetPCLK2Freq(void)
13991399
{
1400-
uint32_t clock, prescaler;
1400+
uint32_t clock;
1401+
uint32_t prescaler;
14011402
/* Get HCLK source and compute PCLK2 frequency ---------------------------*/
14021403
clock = HAL_RCC_GetHCLKFreq();
14031404
/* APB2 prescaler */
@@ -1417,7 +1418,8 @@ uint32_t HAL_RCC_GetPCLK2Freq(void)
14171418
*/
14181419
uint32_t HAL_RCC_GetPCLK4Freq(void)
14191420
{
1420-
uint32_t clock, prescaler;
1421+
uint32_t clock;
1422+
uint32_t prescaler;
14211423
/* Get HCLK source and compute PCLK4 frequency ---------------------------*/
14221424
clock = HAL_RCC_GetHCLKFreq();
14231425
/* APB4 prescaler */
@@ -1437,7 +1439,8 @@ uint32_t HAL_RCC_GetPCLK4Freq(void)
14371439
*/
14381440
uint32_t HAL_RCC_GetPCLK5Freq(void)
14391441
{
1440-
uint32_t clock, prescaler;
1442+
uint32_t clock;
1443+
uint32_t prescaler;
14411444
/* Get HCLK source and compute PCLK5 frequency ---------------------------*/
14421445
clock = HAL_RCC_GetHCLKFreq();
14431446
/* APB5 prescaler */
@@ -2100,7 +2103,7 @@ static uint32_t RCC_PLL1_GetVCOOutputFreq(void)
21002103
uint32_t pllfracn;
21012104
float_t frequency;
21022105

2103-
/* Get PLL1 CFGR and DIVR register values */
2106+
/* Get PLL1 CKSELR and DIVR register values */
21042107
tmpreg1 = RCC->PLLCKSELR;
21052108
tmpreg2 = RCC->PLL1DIVR1;
21062109

@@ -2115,7 +2118,7 @@ static uint32_t RCC_PLL1_GetVCOOutputFreq(void)
21152118
}
21162119

21172120
/* Check if fractional part is enable */
2118-
if ((tmpreg1 & RCC_PLLCFGR_PLL1FRACEN) != 0U)
2121+
if ((RCC->PLLCFGR & RCC_PLLCFGR_PLL1FRACEN) != 0U)
21192122
{
21202123
pllfracn = (RCC->PLL1FRACR & RCC_PLL1FRACR_FRACN) >> RCC_PLL1FRACR_FRACN_Pos;
21212124
}
@@ -2154,10 +2157,10 @@ static uint32_t RCC_PLL1_GetVCOOutputFreq(void)
21542157
pllsrc = 0U;
21552158
break;
21562159
}
2157-
2160+
21582161
/* Compute VCO output frequency */
21592162
frequency = ((float_t)pllsrc / (float_t)pllm) * ((float_t)plln + ((float_t)pllfracn / (float_t)0x2000U));
2160-
2163+
21612164
return (uint32_t)frequency;
21622165
}
21632166

@@ -2175,7 +2178,7 @@ static uint32_t RCC_PLL2_GetVCOOutputFreq(void)
21752178
uint32_t pllfracn;
21762179
float_t frequency;
21772180

2178-
/* Get PLL2 CFGR and DIVR register values */
2181+
/* Get PLL2 CKSELR and DIVR register values */
21792182
tmpreg1 = RCC->PLLCKSELR;
21802183
tmpreg2 = RCC->PLL2DIVR1;
21812184

@@ -2190,7 +2193,7 @@ static uint32_t RCC_PLL2_GetVCOOutputFreq(void)
21902193
}
21912194

21922195
/* Check if fractional part is enable */
2193-
if ((tmpreg1 & RCC_PLLCFGR_PLL2FRACEN) != 0U)
2196+
if ((RCC->PLLCFGR & RCC_PLLCFGR_PLL2FRACEN) != 0U)
21942197
{
21952198
pllfracn = (RCC->PLL2FRACR & RCC_PLL2FRACR_FRACN) >> RCC_PLL2FRACR_FRACN_Pos;
21962199
}
@@ -2232,7 +2235,7 @@ static uint32_t RCC_PLL2_GetVCOOutputFreq(void)
22322235

22332236
/* Compute VCO output frequency */
22342237
frequency = ((float_t)pllsrc / (float_t)pllm) * ((float_t)plln + ((float_t)pllfracn / (float_t)0x2000U));
2235-
2238+
22362239
return (uint32_t)frequency;
22372240
}
22382241

@@ -2250,7 +2253,7 @@ static uint32_t RCC_PLL3_GetVCOOutputFreq(void)
22502253
uint32_t pllfracn;
22512254
float_t frequency;
22522255

2253-
/* Get PLL3 CFGR and DIVR register values */
2256+
/* Get PLL3 CKSELR and DIVR register values */
22542257
tmpreg1 = RCC->PLLCKSELR;
22552258
tmpreg2 = RCC->PLL3DIVR1;
22562259

@@ -2265,7 +2268,7 @@ static uint32_t RCC_PLL3_GetVCOOutputFreq(void)
22652268
}
22662269

22672270
/* Check if fractional part is enable */
2268-
if ((tmpreg1 & RCC_PLLCFGR_PLL3FRACEN) != 0U)
2271+
if ((RCC->PLLCFGR & RCC_PLLCFGR_PLL3FRACEN) != 0U)
22692272
{
22702273
pllfracn = (RCC->PLL3FRACR & RCC_PLL3FRACR_FRACN) >> RCC_PLL3FRACR_FRACN_Pos;
22712274
}
@@ -2307,7 +2310,7 @@ static uint32_t RCC_PLL3_GetVCOOutputFreq(void)
23072310

23082311
/* Compute VCO output frequency */
23092312
frequency = ((float_t)pllsrc / (float_t)pllm) * ((float_t)plln + ((float_t)pllfracn / (float_t)0x2000U));
2310-
2313+
23112314
return (uint32_t)frequency;
23122315
}
23132316

stm32cube/stm32h7rsxx/drivers/src/stm32h7rsxx_hal_rng.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ HAL_StatusTypeDef HAL_RNG_Init(RNG_HandleTypeDef *hrng)
233233
/* Get tick */
234234
tickstart = HAL_GetTick();
235235
/* Check if data register contains valid random data */
236-
while (__HAL_RNG_GET_FLAG(hrng, RNG_FLAG_SECS) != RESET)
236+
while (__HAL_RNG_GET_FLAG(hrng, RNG_FLAG_DRDY) != SET)
237237
{
238238
if ((HAL_GetTick() - tickstart) > RNG_TIMEOUT_VALUE)
239239
{
@@ -676,8 +676,6 @@ HAL_StatusTypeDef HAL_RNG_GenerateRandomNumber(RNG_HandleTypeDef *hrng, uint32_t
676676
/* Update the error code and status */
677677
hrng->ErrorCode = HAL_RNG_ERROR_SEED;
678678
status = HAL_ERROR;
679-
/* Clear bit DRDY */
680-
CLEAR_BIT(hrng->Instance->SR, RNG_FLAG_DRDY);
681679
}
682680
else /* No seed error */
683681
{
@@ -1026,3 +1024,4 @@ HAL_StatusTypeDef RNG_RecoverSeedError(RNG_HandleTypeDef *hrng)
10261024
/**
10271025
* @}
10281026
*/
1027+

stm32cube/stm32h7rsxx/drivers/src/stm32h7rsxx_hal_rng_ex.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
#if defined(RNG)
3232

33-
/** @addtogroup RNG_Ex
33+
/** @addtogroup RNGEx
3434
* @brief RNG Extended HAL module driver.
3535
* @{
3636
*/
@@ -41,7 +41,7 @@
4141
/* Private defines -----------------------------------------------------------*/
4242
/* Private variables ---------------------------------------------------------*/
4343
/* Private constants ---------------------------------------------------------*/
44-
/** @addtogroup RNG_Ex_Private_Constants
44+
/** @addtogroup RNGEx_Private_Constants
4545
* @{
4646
*/
4747
#define RNG_TIMEOUT_VALUE 2U
@@ -53,11 +53,11 @@
5353
/* Private functions --------------------------------------------------------*/
5454
/* Exported functions --------------------------------------------------------*/
5555

56-
/** @defgroup RNG_Ex_Exported_Functions RNG_Ex Exported Functions
56+
/** @defgroup RNGEx_Exported_Functions RNGEx Exported Functions
5757
* @{
5858
*/
5959

60-
/** @defgroup RNG_Ex_Exported_Functions_Group1 Configuration and lock functions
60+
/** @defgroup RNGEx_Exported_Functions_Group1 Configuration and lock functions
6161
* @brief Configuration functions
6262
*
6363
@verbatim
@@ -269,7 +269,7 @@ HAL_StatusTypeDef HAL_RNGEx_LockConfig(RNG_HandleTypeDef *hrng)
269269
* @}
270270
*/
271271

272-
/** @defgroup RNG_Ex_Exported_Functions_Group2 Recover from seed error function
272+
/** @defgroup RNGEx_Exported_Functions_Group2 Recover from seed error function
273273
* @brief Recover from seed error function
274274
*
275275
@verbatim
@@ -341,3 +341,4 @@ HAL_StatusTypeDef HAL_RNGEx_RecoverSeedError(RNG_HandleTypeDef *hrng)
341341
/**
342342
* @}
343343
*/
344+

stm32cube/stm32h7rsxx/drivers/src/stm32h7rsxx_hal_sd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ HAL_StatusTypeDef HAL_SD_Init(SD_HandleTypeDef *hsd)
465465
HAL_StatusTypeDef HAL_SD_InitCard(SD_HandleTypeDef *hsd)
466466
{
467467
uint32_t errorstate;
468-
SD_InitTypeDef Init;
468+
SD_InitTypeDef Init = {0U};
469469
uint32_t sdmmc_clk;
470470

471471
/* Default SDMMC peripheral configuration for SD card initialization */

0 commit comments

Comments
 (0)