STM32CubeF1 icon indicating copy to clipboard operation
STM32CubeF1 copied to clipboard

missing static in HAL_RCC_GetSysClockFreq()

Open CanastraRF opened this issue 3 years ago • 2 comments

Hi In the function

uint32_t HAL_RCC_GetSysClockFreq(void) are five const array

#if defined(RCC_CFGR2_PREDIV1SRC)
  uint8_t const aPLLMULFactorTable[14U] = {0U, 0U, 4U, 5U, 6U, 7U, 8U, 9U, 0U, 0U, 0U, 0U, 0U, 13U};
  uint8_t const aPredivFactorTable[16U] = {1U, 2U, 3U, 4U, 5U, 6U, 7U, 8U, 9U, 10U, 11U, 12U, 13U, 14U, 15U, 16U};
#else
  uint8_t const aPLLMULFactorTable[16U] = {2U, 3U, 4U, 5U, 6U, 7U, 8U, 9U, 10U, 11U, 12U, 13U, 14U, 15U, 16U, 16U};
#if defined(RCC_CFGR2_PREDIV1)
  uint8_t const aPredivFactorTable[16U] = {1U, 2U, 3U, 4U, 5U, 6U, 7U, 8U, 9U, 10U, 11U, 12U, 13U, 14U, 15U, 16U};
#else
  uint8_t const aPredivFactorTable[2U] = {1U, 2U};
#endif /*RCC_CFGR2_PREDIV1*/

they should bee static

same in

uint32_t HAL_RCCEx_GetPeriphCLKFreq(uint32_t PeriphClk)
{
#if defined(STM32F105xC) || defined(STM32F107xC)
  uint8_t const aPLLMULFactorTable[14U] = {0U, 0U, 4U, 5U, 6U, 7U, 8U, 9U, 0U, 0U, 0U, 0U, 0U, 13U};
  uint8_t const aPredivFactorTable[16U] = {1U, 2U, 3U, 4U, 5U, 6U, 7U, 8U, 9U, 10U, 11U, 12U, 13U, 14U, 15U, 16U};

  uint32_t prediv1 = 0U, pllclk = 0U, pllmul = 0U;
  uint32_t pll2mul = 0U, pll3mul = 0U, prediv2 = 0U;
#endif /* STM32F105xC || STM32F107xC */
#if defined(STM32F102x6) || defined(STM32F102xB) || defined(STM32F103x6) || \
    defined(STM32F103xB) || defined(STM32F103xE) || defined(STM32F103xG)
  uint8_t const aPLLMULFactorTable[16U] = {2U, 3U, 4U, 5U, 6U, 7U, 8U, 9U, 10U, 11U, 12U, 13U, 14U, 15U, 16U, 16U};
  uint8_t const aPredivFactorTable[2U] = {1U, 2U};

  uint32_t prediv1 = 0U, pllclk = 0U, pllmul = 0U;
#endif /* STM32F102x6 || STM32F102xB || STM32F103x6 || STM32F103xB || STM32F103xE || STM32F103xG */

Please fix this

CanastraRF avatar Jan 03 '22 13:01 CanastraRF

Hi @CanastraRF,

Thank you for your report. An internal tracker has been logged and a fix will be implemented and made available in the frame of a future release.

Thank you again for you report.

With regards,

RKOUSTM avatar Jan 07 '22 14:01 RKOUSTM

ST Internal Reference: 120495

RKOUSTM avatar Jan 07 '22 14:01 RKOUSTM

Hello @CanastraRF

Thank you again for having reported this point. It has been fixed in the frame of version 1.8.5 of this firmware.

With regards,

RJMSTM avatar Apr 14 '23 12:04 RJMSTM